# HG changeset patch # User devteam # Date 1450482653 18000 # Node ID 867a8c8e870e45d3c84d73563af1ab3edc2dd6d8 # Parent 4926b3e1e2fe6e9ba18f5b7d5d29668477333331 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/bowtie_wrappers commit de7140295cce07e1bc1697e51dab4271c8d7a8a6 diff -r 4926b3e1e2fe -r 867a8c8e870e bowtie_wrapper.py --- a/bowtie_wrapper.py Mon Nov 09 11:18:30 2015 -0500 +++ b/bowtie_wrapper.py Fri Dec 18 18:50:53 2015 -0500 @@ -13,6 +13,7 @@ --output_suppressed_reads=: File name for suppressed reads because of max setting (single-end) --output_suppressed_reads_l=: File name for suppressed reads because of max setting (left, paired-end) --output_suppressed_reads_r=: File name for suppressed reads because of max setting (right, paired-end) + --output_mapping_stats=: File name for mapping statistics (output on stderr by bowtie) -i, --input1=i: The (forward or single-end) reads file in Sanger FASTQ format -I, --input2=I: The reverse reads file in Sanger FASTQ format -4, --dataType=4: The type of data (SOLiD or Solexa) @@ -86,6 +87,7 @@ parser.add_option( '', '--output_suppressed_reads', dest='output_suppressed_reads', help='File name for suppressed reads because of max setting (single-end)' ) parser.add_option( '', '--output_suppressed_reads_l', dest='output_suppressed_reads_l', help='File name for suppressed reads because of max setting (left, paired-end)' ) parser.add_option( '', '--output_suppressed_reads_r', dest='output_suppressed_reads_r', help='File name for suppressed reads because of max setting (right, paired-end)' ) + parser.add_option( '', '--output_mapping_stats', dest='output_mapping_stats', help='File for mapping statistics (i.e. stderr from bowtie)' ) parser.add_option( '-4', '--dataType', dest='dataType', help='The type of data (SOLiD or Solexa)' ) parser.add_option( '-i', '--input1', dest='input1', help='The (forward or single-end) reads file in Sanger FASTQ format' ) parser.add_option( '-I', '--input2', dest='input2', help='The reverse reads file in Sanger FASTQ format' ) @@ -415,7 +417,7 @@ # align tmp = tempfile.NamedTemporaryFile( dir=tmp_index_dir ).name tmp_stderr = open( tmp, 'wb' ) - proc = subprocess.Popen( args=cmd2, shell=True, cwd=tmp_index_dir, stderr=tmp_stderr.fileno() ) + proc = subprocess.Popen( args=cmd2, shell=True, cwd=tmp_index_dir, stdout=sys.stdout, stderr=tmp_stderr.fileno() ) returncode = proc.wait() tmp_stderr.close() # get stderr, allowing for case where it's very large @@ -432,6 +434,10 @@ tmp_stderr.close() if returncode != 0: raise Exception, stderr + elif options.output_mapping_stats is not None: + # Write stderr (containing the mapping statistics) to a named file + with open(options.output_mapping_stats, 'w') as mapping_stats: + mapping_stats.write( stderr ) # get suppressed and unmapped reads output files in place if appropriate if options.paired == 'paired' and tmp_suppressed_file_name and \ options.output_suppressed_reads_l and options.output_suppressed_reads_r: diff -r 4926b3e1e2fe -r 867a8c8e870e bowtie_wrapper.xml --- a/bowtie_wrapper.xml Mon Nov 09 11:18:30 2015 -0500 +++ b/bowtie_wrapper.xml Fri Dec 18 18:50:53 2015 -0500 @@ -1,4 +1,4 @@ - + bowtie @@ -148,6 +148,9 @@ --seed="${singlePaired.pParams.pSeed}" #end if #end if + #if $save_mapping_stats + --output_mapping_stats="$mapping_stats" + #end if @@ -415,6 +418,7 @@ + @@ -437,6 +441,9 @@ + + save_mapping_stats is True + (( singlePaired['sPaired'] == "single" and @@ -744,6 +751,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -r 4926b3e1e2fe -r 867a8c8e870e test-data/bowtie_out11.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/bowtie_out11.txt Fri Dec 18 18:50:53 2015 -0500 @@ -0,0 +1,4 @@ +# reads processed: 18 +# reads with at least one reported alignment: 13 (72.22%) +# reads that failed to align: 5 (27.78%) +Reported 13 paired-end alignments to 1 output stream(s)