#!/usr/bin/env python """ doBlast.py Author: Tony Papenfuss Date: Fri Oct 20 12:26:08 EST 2006 """ import os, sys, glob from useful import extractRootName cmd = 'blast -p tblastn -d %s -i %s -o %s' blastdb = '/database/opossum/assembly/blastdb/assembly' filenames = glob.glob('seq/*') for filename in filenames: name = extractRootName(filename) print name oFilename = 'blast/%s.txt' % name os.system(cmd % (blastdb, filename, oFilename))
#!/usr/bin/env python """ doBlast.py Author: Tony Papenfuss Date: Fri Oct 20 12:26:08 EST 2006 """ import os, sys, glob from useful import extractRootName cmd = "blast -p tblastn -d %s -i %s -o %s" blastdb = "/database/opossum/assembly/blastdb/assembly" filenames = glob.glob("seq/*") for filename in filenames: name = extractRootName(filename) print name oFilename = "blast/%s.txt" % name os.system(cmd % (blastdb, filename, oFilename))
ioDir = sys.argv[1] os.chdir(ioDir) oFile = open('checkResults.txt', 'w') sys.stdout = oFile hmmerModel = { 'round1': '../../HMMs/Defensin_beta.hmm', 'round2': '../../HMMs/Defensin_beta_new.hmm'}[ioDir] writer = fasta.MfaWriter('peptides.fa') annotFile = open('annot.txt', 'w') annotFilenames = glob.glob('gsAnnotations/*.txt') for annotFilename in annotFilenames: name = extractRootName(annotFilename) print '>>>', name + '\n' annotFilename = 'gsAnnotations/%s.txt' % name annotation = open(annotFilename).readlines() predictions = parseGenscan(annotation) pepFilename = 'gsPeptides/%s.fa' % name peptides = fasta.load_mfa(pepFilename) peptides = [(h.split()[0],s) for h,s in peptides] peptides = dict(peptides) print 'Lengths' for h in peptides: print h, len(peptides[h]) print
ioDir = sys.argv[1] os.chdir(ioDir) oFile = open('checkResults.txt', 'w') sys.stdout = oFile hmmerModel = { 'round1': '../../HMMs/Defensin_beta.hmm', 'round2': '../../HMMs/Defensin_beta_new.hmm' }[ioDir] writer = fasta.MfaWriter('peptides.fa') annotFile = open('annot.txt', 'w') annotFilenames = glob.glob('gsAnnotations/*.txt') for annotFilename in annotFilenames: name = extractRootName(annotFilename) print '>>>', name + '\n' annotFilename = 'gsAnnotations/%s.txt' % name annotation = open(annotFilename).readlines() predictions = parseGenscan(annotation) pepFilename = 'gsPeptides/%s.fa' % name peptides = fasta.load_mfa(pepFilename) peptides = [(h.split()[0], s) for h, s in peptides] peptides = dict(peptides) print 'Lengths' for h in peptides: print h, len(peptides[h]) print