shell=True) print "Filtering folds in " + self.inPath + " down to hairpins." FoldOps.filter_hairpins('data/tmp/' + self.inPath + '.folds', 'data/tmp/' + self.inPath + '.hairpins') FileConversion.RNAL_to_fasta('data/tmp/' + self.inPath + '.hairpins', 'data/tmp/folds_from_' + self.inPath) print "Removing redundant hairpins from " + self.inPath + "." sl = SequenceList() sl.load_fasta('data/tmp/folds_from_' + self.inPath) sl.remove_all_redundant() sl.export_fasta('data/tmp/' + self.inPath + 'nrhairpins') print "Re-formatting fasta." # Step one: turn the fasta into something that RNALfold will work with FastaOps.remove_newlines('data/' + inPath, 'data/tmp/' + inPath + '.fixed') # Step two: split the fasta for mutli-threaded processing FastaOps.split_fasta('data/tmp/' + inPath + '.fixed', numThreads) # Step three: Launch threads threadPath = inPath threadExt = 'fixed' threads = [] for i in range(numThreads): threads.append(myThread(threadPath + '.' + str(i) + '.' + threadExt)) for thread in threads: thread.start() for thread in threads: thread.join() FastaOps.merge_fasta('data/tmp/' + inPath + '.fixednrhairpins', numThreads) call('cp data/tmp/' + inPath + '.fixednrhairpins data/' + inPath +
self.inPath = inPath def run(self): # Use newer local version of RNAfold call('RNALfold -T '+str(foldTemp)+' -d2 --noLP -L '+str(hairpinLength)+' < data/tmp/'+self.inPath+' > data/tmp/'+self.inPath+'.folds', shell=True) # Use older version of RNAfold # call('progs/ViennaRNA-1.8.5/Progs/RNALfold -T '+str(foldTemp)+' -d2 -noLP -L '+str(hairpinLength)+' < data/tmp/'+self.inPath+' > data/tmp/'+self.inPath+'.folds', shell=True) FoldOps.filter_hairpins('data/tmp/'+self.inPath+'.folds', 'data/tmp/'+self.inPath+'.hairpins', minMFE, basePairs) FileConversion.RNAL_to_fasta('data/tmp/'+self.inPath+'.hairpins', 'data/tmp/folds_from_'+self.inPath) sl = SequenceList() sl.load_fasta('data/tmp/folds_from_'+self.inPath) # sl.remove_all_redundant() sl.export_fasta('data/tmp/'+self.inPath+'nrhairpins') # Step one: turn the fasta into something that RNALfold will work with FastaOps.remove_newlines('data/'+inPath, 'data/tmp/'+inPath+'.fixed') FastaOps.convert_DNA_to_RNA('data/tmp/'+inPath+'.fixed', 'data/tmp/'+inPath+'.rna') # Step two: split the fasta for mutli-threaded processing FastaOps.split_fasta('data/tmp/'+inPath+'.rna', numThreads) # Step three: Launch threads threadPath = inPath threadExt = 'rna' threads = [] for i in range(numThreads): threads.append(myThread(threadPath+'.'+str(i)+'.'+threadExt)) for thread in threads: thread.start() for thread in threads: thread.join() FastaOps.merge_fasta('data/tmp/'+inPath+'.rnanrhairpins', numThreads)