예제 #1
0
 def go(self):
     """Execution function: runs TAMO.MD.Meme.Meme and catches the output in self.output for access from MDAP."""
     import time
     
     # write a temp fasta file of coregulated seqs to use as input to Meme(file=TempFasta)
     ctimeStr  = time.ctime().replace(' ','_')
     fileName  = 'tempFastaOfCoRegSeqs.MDAP.%s.fas' %(ctimeStr)
     tFasta    = open(fileName, 'w')
     tFastaTxt = Fasta.text(self.coRegSeqs[0])
     tFasta.write(tFastaTxt)
     
     # Call TAMO to do its thing:
     self.output = Meme(file=fileName, width='', extra_args=self.extra_args, bfile=self.bfile)
     
     # delete temp file
     os.remove(fileName)
예제 #2
0
 def go(self):
     """Execution function: coordinates options used and background GC calculation, then runs
     TAMO.MD.AlignAce.MetaAce and catches the output in self.output for access from MDAP.
     Output is TAMO.AligAce result object."""
     import time
     # Calc GC background of genomic sequences representing the
     # entire data set if requested.
     if self.mdapOptions['background'] == 1:
         self.dataStats = seqStats.calcStats(self.mdapArgs[0])
         self.gcback = self.dataStats['percentGC']
         
     # write a temp fasta file of coregulated seqs to use as input to Meme(file=TempFasta)
     ctimeStr  = time.ctime().replace(' ','_')
     fileName  = 'tempFastaOfCoRegSeqs.MDAP.%s.fas' %(ctimeStr)
     tFasta    = open(fileName, 'w')
     tFastaTxt = Fasta.text(self.coRegSeqs[0])
     tFasta.write(tFastaTxt)
     
     # call TAMO to do its thing
     self.output = MetaAce(fileName, self.width, self.iterations, self.gcback)
     pass
예제 #3
0
from TAMO.seq import Fasta
from gusPyCode.defs.bioDefs import geneList2FastaDict
from gusPyCode.defs.mosqData import promoterSeqPaths


geneList = map(lambda l: l.strip(), \
               open('/Users/biggus/Documents/James/Collaborations/Campbell/data/CCupAt4Days.gte2x.genes.txt', 'rU'))

sourceFasta = promoterSeqPaths.Aa_2000bpUp_hardMasked_shuf1

oFile = '/Users/biggus/Documents/James/Collaborations/Campbell/data/CCupAt4Days.gte2x.masked.shuffled.1.fas'





newFasta = geneList2FastaDict(geneList, sourceFasta, hardMasked=True)

newFasta = Fasta.text(newFasta)
    
oFile = open(oFile, 'w')
oFile.write(newFasta)

print 'Done'