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 glob | |
import os | |
inf = glob.glob("*.gz") | |
rlen = 76.0 | |
for f in inf: | |
tmp = f.split(".fastq.gz")[0] | |
os.system("zcat "+f+" | head -n 4 | tail -n 1 > "+tmp) | |
with open(tmp) as fin: |
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
# Takes a SeqFindR database and does some simple validation | |
# | |
# usage: | |
# | |
# python validate_SeqFindR.py $input.fa | |
import sys | |
stored = [] |
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 matplotlib | |
matplotlib.use('Agg') | |
import sys | |
import collections | |
import pylab as plt | |
from matplotlib import rcParams | |
rcParams.update({'figure.subplot.bottom': 0.25}) |
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 Bio.Blast import NCBIXML | |
input = 'CFT073.B2_comp.fa_blast.xml' | |
for record in NCBIXML.parse(open('CFT073.B2_comp.fa_blast.xml')): | |
for align in record.alignments: | |
for idx, hsp in enumerate(align.hsps): | |
if idx == 0: | |
print ">"+input.split("_")[0]+"_"+record.query.split(',')[1].strip() | |
print hsp.sbjct |
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 glob | |
order = open("order.dat").readlines() | |
#organism: Escherichia coli HVM1147 | |
#contigs: 93 | |
#bases: 5131204 | |
#rRNA: 4 |
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 glob | |
import os | |
inf = glob.glob("*/*.fas") | |
for f in inf: | |
#IR65/IR65_69_Contigs-against-EC958-complete.fas | |
new = f.replace("-complete", "") | |
os.system("fab bio_util.fasta_to_uppercase:"+f+","+new) | |
#new = f.replace("ordered-", '') |
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 glob | |
import sys | |
import os | |
from Bio import Entrez | |
Entrez.email = "Beatson.Lab@gmail.com" | |
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
# Mitchell Stanton-Cook | |
# m.stantoncook@gmail.com | |
# github.com/mscook | |
import glob | |
""" | |
(> XXXXX 47,065 unmapped pairs | |
(> XXXXX 19,785 unmapped reads | |
(> XXXXX 5,098,912 reads/pairs with alignments |
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 sys | |
import textwrap | |
""" | |
Usage: | |
chunk_mfa.py input.fa 500 | |
""" |
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 fabric.api import task | |
from fabric.tasks import Task | |
class MyTask(Task): | |
name = "deploy" | |
def run(self, environment, domain="whatever.com"): | |
run("git clone foo") | |
sudo("service apache2 restart") | |
instance = MyTask() |