# HG changeset patch # User devteam # Date 1450294233 18000 # Node ID 6a7f5da7c76d5c4014034e6fd80ee1a565745329 # Parent 41ab1243e8f9b51016c5513fc3151889a1496e69 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_paired_end_joiner commit 117bc9911926e06d4541daffbb7b0e27d38d67a7 diff -r 41ab1243e8f9 -r 6a7f5da7c76d fastq_paired_end_joiner.py --- a/fastq_paired_end_joiner.py Wed Nov 11 12:42:03 2015 -0500 +++ b/fastq_paired_end_joiner.py Wed Dec 16 14:30:33 2015 -0500 @@ -54,8 +54,8 @@ class FastqJoiner( fq.fastqJoiner ): - def __init__( self, format, force_quality_encoding=None, sep="\t" ): - super( FastqJoiner, self ).__init__( format, force_quality_encoding ) + def __init__( self, format, force_quality_encoding=None, sep="\t", paste="" ): + super( FastqJoiner, self ).__init__( format, force_quality_encoding, paste=paste ) self.id_manager = IDManager( sep ) def join( self, read1, read2 ): @@ -84,16 +84,20 @@ # convert to nuc space, join, then convert back rval.sequence = rval.convert_base_to_color_space( read1.convert_color_to_base_space( read1.sequence ) + + self.paste_sequence + read2.convert_color_to_base_space( read2.sequence ) ) else: - rval.sequence = read1.sequence + read2.sequence + rval.sequence = read1.sequence + self.paste_sequence + read2.sequence if force_quality_encoding == 'ascii': - rval.quality = read1.quality + read2.quality + rval.quality = read1.quality + self.paste_ascii_quality + read2.quality else: rval.quality = "%s %s" % ( - read1.quality.strip(), read2.quality.strip() + read1.quality.strip(), self.paste_decimal_quality ) + rval.quality = ("%s %s" % ( + rval.quality.strip(), read2.quality.strip() + )).strip() return rval def get_paired_identifier( self, read ): @@ -119,15 +123,17 @@ output_filename = sys.argv[5] fastq_style = sys.argv[6] or 'old' + + paste = sys.argv[7] or '' #-- if input1_type != input2_type: print "WARNING: You are trying to join files of two different types: %s and %s." % ( input1_type, input2_type ) if fastq_style == 'new': sep = sniff_sep( input1_filename ) - joiner = FastqJoiner( input1_type, sep=sep ) + joiner = FastqJoiner( input1_type, sep=sep, paste=paste ) else: - joiner = fq.fastqJoiner( input1_type ) + joiner = fq.fastqJoiner( input1_type, paste=paste ) #-- input2 = fq.fastqNamedReader( open( input2_filename, 'rb' ), input2_type ) out = fq.fastqWriter( open( output_filename, 'wb' ), format=input1_type ) diff -r 41ab1243e8f9 -r 6a7f5da7c76d fastq_paired_end_joiner.xml --- a/fastq_paired_end_joiner.xml Wed Nov 11 12:42:03 2015 -0500 +++ b/fastq_paired_end_joiner.xml Wed Dec 16 14:30:33 2015 -0500 @@ -1,9 +1,9 @@ - + on paired end reads - galaxy_sequence_utils + galaxy_sequence_utils - fastq_paired_end_joiner.py '$input1_file' '${input1_file.extension[len( 'fastq' ):]}' '$input2_file' '${input2_file.extension[len( 'fastq' ):]}' '$output_file' '$style' + fastq_paired_end_joiner.py '$input1_file' '${input1_file.extension[len( 'fastq' ):]}' '$input2_file' '${input2_file.extension[len( 'fastq' ):]}' '$output_file' '$style' '${paste_sequence}' @@ -11,6 +11,7 @@ + diff -r 41ab1243e8f9 -r 6a7f5da7c76d tool_dependencies.xml --- a/tool_dependencies.xml Wed Nov 11 12:42:03 2015 -0500 +++ b/tool_dependencies.xml Wed Dec 16 14:30:33 2015 -0500 @@ -1,6 +1,6 @@ - - + +