Skip to content

Instantly share code, notes, and snippets.

View ctokheim's full-sized avatar

Collin Tokheim ctokheim

  • Dana-Farber Cancer Institute
  • Boston, MA
View GitHub Profile
@tycheleturner
tycheleturner / alphafold_viewer_final.Rmd
Last active October 30, 2022 23:43
bulk_AlphaFold_viewer
---
title: "AlphaFold Viewer Final"
author: "Tychele N. Turner, Ph.D."
date: "Created on October 30, 2022"
output:
html_document: default
pdf_document: default
abstract: This document contains the documentation for making the AlphaFold html.
---
tranches = pd.read_csv('https://gist.githubusercontent.com/whitead/f47887e45bbd2f38332182d2d422da6b/raw/a3948beac9b9034dab432b697c5ec238503ac5d0/tranches.txt')
def get_mol_batch(batch_size = 32):
for t in tranches.values:
d = pd.read_csv(t[0], sep=' ')
for i in range(len(d) // batch_size):
yield d.iloc[i * batch_size:(i + 1) * batch_size, 0].values
@deannachurch
deannachurch / ExcelMangledGenes
Created March 13, 2015 15:23
List of symbols that excel 'datifies'
##Mar 13, 2015
##Some 'date-names' are aliases and map to more than one gene
#symbol date name
SEPT1 1-Sep
SEPT2 2-Sep
SEPT3 3-Sep
SEPT4 4-Sep
SEPT5 5-Sep
SEPT6 6-Sep
SEPT7 7-Sep
@ctokheim
ctokheim / cython_tricks.md
Last active March 4, 2024 23:27
cython tricks

Cython

Cython has two major benefits:

  1. Making python code faster, particularly things that can't be done in scipy/numpy
  2. Wrapping/interfacing with C/C++ code

Cython gains most of it's benefit from statically typing arguments. However, statically typing is not required, in fact, regular python code is valid cython (but don't expect much of a speed up). By incrementally adding more type information, the code can speed up by several factors. This gist just provides a very basic usage of cython.