changeset 3:e659bd662045 draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_paired_end_joiner commit 06ff7f8972dcefaf52121c22ec82cf5d315adb3e-dirty
author devteam
date Mon, 14 Dec 2015 16:03:18 -0500
parents ab37758348d0
children bce792b8e239
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	Tue Oct 13 12:44:00 2015 -0400
+++ b/fastq_paired_end_joiner.py	Mon Dec 14 16:03:18 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	Tue Oct 13 12:44:00 2015 -0400
+++ b/fastq_paired_end_joiner.xml	Mon Dec 14 16:03:18 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	Tue Oct 13 12:44:00 2015 -0400
+++ b/tool_dependencies.xml	Mon Dec 14 16:03:18 2015 -0500
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <tool_dependency>
-  <package name="galaxy_sequence_utils" version="1.0.0">
-      <repository changeset_revision="195699b1562a" name="package_galaxy_utils_1_0" owner="devteam" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+  <package name="galaxy_sequence_utils" version="1.0.1">
+      <repository changeset_revision="c38bd3fe9da6" name="package_galaxy_sequence_utils_1_0_1" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>