Skip to content

Instantly share code, notes, and snippets.

View Swarchal's full-sized avatar

Scott Warchal Swarchal

View GitHub Profile
"""
docstring
"""
import os
import glob
import itertools
import numpy as np
import skimage.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Swarchal
Swarchal / test_index_error_bodge(1).ipynb
Last active September 27, 2018 15:17
Test IndexError fix
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Swarchal
Swarchal / readmap.ipynb
Created September 25, 2018 09:58
Adding data from a plate-map matrix
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Swarchal
Swarchal / multi_z_factor.py
Created August 23, 2018 18:05
Multivariate Z-prime/factor (Kummel et al, 2010) in python
import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
def z_factor(p, n):
numerator = 3 * (np.std(p) + np.std(n))
denominator = np.abs(np.mean(p) - np.mean(n))
return 1 - (numerator / denominator)
def multivariate_z_factor(data, labels):
@Swarchal
Swarchal / bashpy.sh
Created June 30, 2018 07:03
writing python within a shell script
#!/bin/bash
MY_ARG="world"
python /dev/stdin "$MY_ARG" << EOF
import sys
print(f"Hello {sys.argv[1]}")
EOF
@Swarchal
Swarchal / install_cellprofiler.sh
Last active April 3, 2018 14:04
install cellprofiler into a conda env on eddie
#!/bin/bash
# script to install cellprofiler into a conda environment
# named 'cellprofiler'
#
# to activate this environment you will need to load anaconda/4.3.1
# then run
#>>> source activate cellprofiler
# load anaconda
codon_table = {
'AUA':'I', 'AUC':'I', 'AUU':'I', 'AUG':'M',
'ACA':'U', 'ACC':'U', 'ACG':'U', 'ACU':'U',
'AAC':'N', 'AAU':'N', 'AAA':'K', 'AAG':'K',
'AGC':'S', 'AGU':'S', 'AGA':'R', 'AGG':'R',
'CUA':'L', 'CUC':'L', 'CUG':'L', 'CUU':'L',
'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCU':'P',
'CAC':'H', 'CAU':'H', 'CAA':'Q', 'CAG':'Q',
'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGU':'R',
'GUA':'V', 'GUC':'V', 'GUG':'V', 'GUU':'V',
#!/usr/bin/env python3
import train_funcs
cell_lines = [
"MDA-157",
"MDA-231",
"MCF7",
"KPL4",
"T47D",
@Swarchal
Swarchal / list_comprehensions.ipynb
Last active September 16, 2017 23:04
list comprehension tutorial
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.