This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from colonyzer2 import * | |
import time, sys | |
def main(fmt="384"): | |
# Lydall lab file naming convention | |
# First 15 characters in filename identify unique plates | |
# Remaining charaters can be used to store date, time etc. | |
barcRange=(0,15) | |
if len(sys.argv)>1: | |
fmt=sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import winsound, time, Tkinter | |
slides=[] | |
cells=[0,0,0] | |
labels=["G1","S","G2/M"] | |
print "Slide: %02d"%(len(slides)+1) | |
def key(event): | |
if event.char=="g": | |
cells[0]+=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PIL, os, math | |
from PIL import Image | |
resizeWidth=500 | |
allfiles=os.listdir(os.getcwd()) | |
filelist=[f for f in allfiles if f[-4:] in ['.jpg','.JPG','.jpeg','.JPEG','.png','.PNG']] | |
Nimages=len(filelist) | |
im0=Image.open(filelist[0]) | |
w,h=im0.size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo Making indices... | |
# Set up path to include bowtie2 and samtools | |
export PATH=$PATH:/home/username/bowtie2-2.1.0:/home/username/samtools:/home/username/samtools/bcftools:/home/username/samtools/misc | |
# Generate an index file from the reference genome | |
bowtie2-build reference_SGD/S288C_reference_genome_R64-1-1_20110203/S288C_reference_sequence_R64-1-1_20110203.fsa indices/SGD_S288C | |
roots=( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Make indices | |
bowtie2-build reference_SGD/S288C_reference_genome_R64-1-1_20110203/S288C_reference_sequence_R64-1-1_20110203.fsa indices/SGD_S288C | |
for /f "tokens=*" %%x in (roots.txt) do ( | |
echo %%x | |
:: Align reads | |
bowtie2-align -x indices/SGD_S288C -1 data/%%x_1_sequence.fq -2 data/%%x_2_sequence.fq -S alignments/%%x.sam -p 12 --end-to-end | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ShortRead) | |
# Root of .bam filename | |
sname="HG00100.unmapped.ILLUMINA.bwa.GBR.low_coverage.20130415" | |
# Construct path to file | |
fname=file.path("alignments",paste(sname,".bam",sep="")) | |
# Read alignments | |
bm=readGappedAlignments(fname) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo Generating consensus sequences | |
export PATH=$PATH:/home/username/bowtie2-2.1.0:/home/username/samtools:/home/username/samtools/bcftools:/home/username/samtools/misc | |
roots=( | |
SN7640178_10172_8183 | |
SN7640178_10173_8265 | |
SN7640178_10174_8266 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#source("http://bioconductor.org/biocLite.R") | |
#biocLite("ecolitk") | |
#biocLite("ShortRead") | |
library(ecolitk) | |
library(plotrix) | |
library(ShortRead) | |
# Read in some alignments | |
getReads=function(fname,rad=1.5,readmax=29000,logb=10){ | |
bm=readGappedAlignments(fname) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://cnr.lwlss.net/seqConsensus | |
import os | |
from Bio import SeqIO | |
def checkMutations(ref_dict, roots, genedict,showSeq=False): | |
'''Comparing a reference sequence (ref_dict) with a series of sample sequences.''' | |
# Sample sequences are read in from .fastq files in a "pileups" directory. | |
# Filenames are constructed from a list of roots (e.g. filenames without extensions). | |
# A Python dictionary specifying genes to analyze connects gene labels (e.g. "HIS3") with a tuple of chromosome number, start position and stop position (e.g. (15,721946,722608)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install and load ODE solver package | |
install.packages("deSolve") | |
library(deSolve) | |
# Named vector of parameter values | |
parameters=c(k1=0.15,k2=0.075,V=1.0) | |
# Named vector of initial conditions | |
state=c(A=4,B=2,AB=0) |