if os.path.exists(tophat_dir) and os.path.exists(index_dir): os.system('tophat -o ' + tophat_dir + ' ' + index_dir + \ sample.fastq) else: print'You have to create tophat and/or index directories before running your wrapper'
from pathvariables import tophat_dir, index_dir if os.path.exists(tophat_dir) and os.path.exists(index_dir): os.system('tophat -o ' + tophat_dir + ' ' + index_dir + \ sample.fastq) else: print'You have to create tophat and/or index directories before running your wrapper'
import sys import os sys.path.append('home/RNA-seq/') from pathvariables import tophat_dir, index_dir, cufflinks_dir os.system('tophat -o ' + tophat_dir + ' ' + index_dir + \ sample.fastq) # here we don't know whether the tophat output file is completed and available # we open and close a dummy file, so the operating system catches up lag_file = open('dummy.txt', 'w') lag_file.write('tophat completed') lag_file.close() # read the output file if os.path.exists('home/RNA-seq/dummy.txt'): os.system('cufflinks -o ' + cufflinks_dir + ' '\ + tophat_dir + '/accepted_hits.bam')