changeset 3:6a7f5da7c76d draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_paired_end_joiner commit 117bc9911926e06d4541daffbb7b0e27d38d67a7
author devteam
date Wed, 16 Dec 2015 14:30:33 -0500
parents 41ab1243e8f9
children 080a058abf1e
files fastq_paired_end_joiner.py fastq_paired_end_joiner.xml tool_dependencies.xml
diffstat 3 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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 )
--- 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 @@
-<tool id="fastq_paired_end_joiner" name="FASTQ joiner" version="2.0.0">
+<tool id="fastq_paired_end_joiner" name="FASTQ joiner" version="2.0.1">
   <description>on paired end reads</description>
   <requirements>
-    <requirement type="package" version="1.0.0">galaxy_sequence_utils</requirement>
+    <requirement type="package" version="1.0.1">galaxy_sequence_utils</requirement>
   </requirements>
-  <command interpreter="python">fastq_paired_end_joiner.py '$input1_file' '${input1_file.extension[len( 'fastq' ):]}' '$input2_file' '${input2_file.extension[len( 'fastq' ):]}' '$output_file' '$style'</command>
+  <command interpreter="python">fastq_paired_end_joiner.py '$input1_file' '${input1_file.extension[len( 'fastq' ):]}' '$input2_file' '${input2_file.extension[len( 'fastq' ):]}' '$output_file' '$style' '${paste_sequence}'</command>
   <inputs>
     <param name="input1_file" type="data" format="fastqsanger,fastqcssanger" label="Left-hand Reads" />
     <param name="input2_file" type="data" format="fastqsanger,fastqcssanger" label="Right-hand Reads" />
@@ -11,6 +11,7 @@
       <option value="old" selected="true">old</option>
       <option value="new">new</option>
     </param>
+    <param name="paste_sequence" type="text" label="Bases to insert between joined reads" value="" help="Values are in Base-space and quality scores of maximal value will be used"/>
   </inputs>
   <outputs>
     <data name="output_file" format="input" />
--- 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 @@
 <?xml version="1.0"?>
 <tool_dependency>
-  <package name="galaxy_sequence_utils" version="1.0.0">
-      <repository changeset_revision="0643676ad5f7" name="package_galaxy_utils_1_0" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
+  <package name="galaxy_sequence_utils" version="1.0.1">
+      <repository changeset_revision="c1ab450748ba" name="package_galaxy_sequence_utils_1_0_1" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>