コード例 #1
0
                            features = inFile.readline()
                            if features != '':
                                finalOut.write(header)
                                finalOut.write(features)


###########################################
# Main script starts here
###########################################

# Move data file into microPred directory
call('cp data/' + inPath + ' progs/microPred/data/' + inPath, shell=True)
exitFlag = 0

# Split input fasta into <numThreads> smaller fasta files
FastaOps.split_fasta('progs/microPred/data/' + inPath, numThreads)

#Get a path to the input file that doesn't have '.fasta' on the end
threadPath = inPath.rsplit('.', 1)[0]
threadExt = inPath.rsplit('.', 1)[1]
# Move to microPred directory and run microPred on all the smaller files (multi-threaded)
os.chdir('progs/microPred/progs')
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()
コード例 #2
0
ファイル: build_hmp_features.py プロジェクト: jrgreen7/SMIRP
							exit()
						if features != '':
							finalOut.write(header)
							finalOut.write(features)
		call('rm *.ps', shell=True)

###########################################
# Main script starts here
###########################################

# Move data file into microPred directory
call('cp data/'+inPath+' progs/HeteroMirPred/'+inPath, shell=True)
exitFlag = 0

# Split input fasta into <numThreads> smaller fasta files
FastaOps.split_fasta('progs/HeteroMirPred/'+inPath, numThreads)

#Get a path to the input file that doesn't have '.fasta' on the end
threadPath = inPath.rsplit('.',1)[0]
threadExt = inPath.rsplit('.',1)[1]
# Move to microPred directory and run microPred on all the smaller files (multi-threaded)
os.chdir('progs/HeteroMirPred/')
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()
コード例 #3
0
                            features = inFile.readline()
                            if features != '':
                                finalOut.write(header)
                                finalOut.write(features)


###########################################
# Main script starts here
###########################################

# Move data file into microPred directory
call('cp data/' + inPath + ' progs/HeteroMirPred/' + inPath, shell=True)
exitFlag = 0

# Split input fasta into <numThreads> smaller fasta files
FastaOps.split_fasta('progs/HeteroMirPred/' + inPath, numThreads)

#Get a path to the input file that doesn't have '.fasta' on the end
threadPath = inPath.rsplit('.', 1)[0]
threadExt = inPath.rsplit('.', 1)[1]
# Move to microPred directory and run microPred on all the smaller files (multi-threaded)
os.chdir('progs/HeteroMirPred/')
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()
コード例 #4
0
ファイル: extract_hairpins.py プロジェクト: CU-BIC/SMIRP
        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 +
     '.nr.hairpins',
     shell=True)
コード例 #5
0
ファイル: extract_hairpins.py プロジェクト: jrgreen7/SMIRP
		# 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)
FastaOps.remove_AU('data/tmp/'+inPath+'.rnanrhairpins', 'data/tmp/'+inPath+'.hairpins.noAU', 5)

if clusterSim > 0.0:
コード例 #6
0
ファイル: split_fasta.py プロジェクト: jrgreen7/SMIRP
import sys
import getopt
import classes.FastaOperations as fo

# Arguments
############
# -i: Input file (in data/ directory)
# -n: Number of output files

# Output
#########
# n fasta files, with 


opts, extraparams = getopt.getopt(sys.argv[1:], 'i:n:')
for o,p in opts:
	if o == '-i':
		inPath = p
	if o == '-n':
		numFiles = p

fo.split_fasta('data/'+inPath, int(numFiles))
コード例 #7
0
						with open("../data/selected."+self.inPath+".-21.features", 'a') as finalOut:
							features = inFile.readline()
							if features != '':
								finalOut.write(header)
								finalOut.write(features)

###########################################
# Main script starts here
###########################################

# Move data file into microPred directory
call('cp data/'+inPath+' progs/microPred/data/'+inPath, shell=True)
exitFlag = 0

# Split input fasta into <numThreads> smaller fasta files
FastaOps.split_fasta('progs/microPred/data/'+inPath, numThreads)

#Get a path to the input file that doesn't have '.fasta' on the end
threadPath = inPath.rsplit('.',1)[0]
threadExt = inPath.rsplit('.',1)[1]
# Move to microPred directory and run microPred on all the smaller files (multi-threaded)
os.chdir('progs/microPred/progs')
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()