def mapReadsWithTophat(infiles, outfile): """map reads with tophat """ inifile, infile = infiles local_params = P.loadParameters(inifile) job_options = "-l mem_free=16G" job_threads = PARAMS["tophat_threads"] tmpfile = P.getTempFilename(".") # qualfile = P.snip(infile, "csfasta.gz" ) + "qual.gz" """ gunzip < %(infile)s > %(tmpfile)s.csfasta; checkpoint; gunzip < %(qualfile)s > %(tmpfile)s.qual; checkpoint; """ statement = """ zcat %(infile)s | python %(scriptsdir)s/fastq2solid.py --method=change-format --target-format=integer --pattern-identifier="%(tmpfile)s.%%s" >& %(outfile)s.log; checkpoint; tophat --output-dir %(outfile)s.dir --num-threads %(tophat_threads)s --library-type %(tophat_library_type)s --color --quals --integer-quals %(tophat_options)s %(tophat_genome_dir)s/%(genome)s_cs %(tmpfile)s.csfasta %(tmpfile)s.qual >> %(outfile)s.log; checkpoint; mv %(outfile)s.dir/accepted_hits.bam %(outfile)s; checkpoint; samtools index %(outfile)s; checkpoint; rm -f %(tmpfile)s.csfasta %(tmpfile)s.qual """ # use local parameters to overwrite default ones. P.run(**local_params) os.unlink(tmpfile)
def mapReadsWithTophat(infiles, outfile): '''map reads with tophat ''' inifile, infile = infiles local_params = P.loadParameters(inifile) job_options = "-l mem_free=16G" job_threads = PARAMS["tophat_threads"] tmpfile = P.getTempFilename(".") #qualfile = P.snip(infile, "csfasta.gz" ) + "qual.gz" ''' gunzip < %(infile)s > %(tmpfile)s.csfasta; checkpoint; gunzip < %(qualfile)s > %(tmpfile)s.qual; checkpoint; ''' statement = ''' zcat %(infile)s | python %(scriptsdir)s/fastq2solid.py --method=change-format --target-format=integer --pattern-identifier="%(tmpfile)s.%%s" >& %(outfile)s.log; checkpoint; tophat --output-dir %(outfile)s.dir --num-threads %(tophat_threads)s --library-type %(tophat_library_type)s --color --quals --integer-quals %(tophat_options)s %(tophat_genome_dir)s/%(genome)s_cs %(tmpfile)s.csfasta %(tmpfile)s.qual >> %(outfile)s.log; checkpoint; mv %(outfile)s.dir/accepted_hits.bam %(outfile)s; checkpoint; samtools index %(outfile)s; checkpoint; rm -f %(tmpfile)s.csfasta %(tmpfile)s.qual ''' # use local parameters to overwrite default ones. P.run(**local_params) os.unlink(tmpfile)