Repository 'pathogist'
hg clone https://toolshed.g2.bx.psu.edu/repos/matnguyen/pathogist

Changeset 9:728c6b81b45e (2019-03-11)
Previous changeset 8:7708da43aefb (2019-03-11)
Commit message:
New Concatenator
modified:
galaxy/tools/concatenator/concatenator
galaxy/tools/concatenator/concatenator.xml
b
diff -r 7708da43aefb -r 728c6b81b45e galaxy/tools/concatenator/concatenator
--- a/galaxy/tools/concatenator/concatenator Mon Mar 11 03:27:37 2019 -0400
+++ b/galaxy/tools/concatenator/concatenator Mon Mar 11 12:46:41 2019 -0400
[
@@ -17,22 +17,37 @@
 cluster_parser.add_argument('--snp', metavar="SNP", type=str, help="SNP clusters/distance matrix")
 cluster_parser.add_argument('--cnv', metavar="CNV", type=str, help="CNV clusters/distance matrix")
 cluster_parser.add_argument('--spoligo', metavar="SPOLIGO", type=str, help="Spoligotyping clusters/distance matrix")
-# cluster_parser.add_argument('--kwip', metavar="KWIP", type=str, help="Kwip clusters/distance matrix")
+cluster_parser.add_argument('--kwip', metavar="KWIP", type=str, help="Kwip clusters/distance matrix")
+
+reads_parser = subparser.add_parser('reads')
+reads_parser.add_argument('forward', help="Forward reads")
+reads_parser.add_argument('reverse', help="Reverse reads")
 
 if len(sys.argv) == 1:
     parser.print_usage()
     sys.exit(1)
 
 args = parser.parse_args()
-output = open('paths.txt', 'w')
 
 if args.subcommand == 'variant':
+    output = open('paths.txt', 'w')
     for index,path in enumerate(args.input):
         output.write("%s=%s\n" % (args.name[index], path))
+    output.close()
+
 elif args.subcommand == 'cluster':
-    variant_types = [(args.mlst, 'MLST'), (args.snp, 'SNP'), (args.cnv, 'CNV'), (args.spoligo, 'spoligotyping')]
+    output = open('paths.txt', 'w')
+    variant_types = [(args.mlst, 'MLST'), (args.snp, 'SNP'), (args.cnv, 'CNV'), (args.spoligo, 'spoligotyping'),
+                     (args.kwip, 'kWIP')]
     for variant in variant_types:
         if variant[0] == None:
             continue
         else:
             output.write("%s=%s\n" % (variant[1], variant[0]))
+    output.close()
+
+elif args.subcommand == 'reads':
+    with open('forward.txt', 'a') as f_out:
+        f_out.write(args.forward)
+    with open('reverse.txt', 'a') as r_out:
+        r_out.write(args.reverse)
b
diff -r 7708da43aefb -r 728c6b81b45e galaxy/tools/concatenator/concatenator.xml
--- a/galaxy/tools/concatenator/concatenator.xml Mon Mar 11 03:27:37 2019 -0400
+++ b/galaxy/tools/concatenator/concatenator.xml Mon Mar 11 12:46:41 2019 -0400
[
@@ -25,6 +25,10 @@
             #if $input_type.spoligo.spoligo_checkbox
                 --spoligo $input_type.spoligo.spoligo_path
             #end if
+         #elif $input_type.input_type_selector == "reads"
+            reads
+            $input_type.fastq.forward
+            $input_type.fastq.reverse
          #end if
     ]]></command>
 
@@ -34,6 +38,7 @@
             <param name="input_type_selector" type="select" label="Concatenation of variant calls, or clustering files">
                 <option value="variant">Variant Call Files</option>
                 <option value="clustering">Clustering/Distance Matrix Files</option>
+                <option value="reads">Raw reads</option>
             </param>
             <when value="variant">
                 <param name="paths" type="data" label="Collection of calls" help="" optional="False" multiple="True"/>
@@ -68,11 +73,24 @@
                     </when>
                 </conditional>
             </when>
+            <when value="reads">
+                <param name="fastq" type="data_collection" collection_type="paired"
+                       format="fastqsanger,fastq,fastq.gz,fastqsanger.gz" label="Select paired collection"/>
+            </when>
         </conditional>
     </inputs>
 
     <outputs>
-        <data name="output" label="Paths of ${on_string}" format="txt" from_work_dir="paths.txt"/>
+        <data name="output" label="Paths of ${on_string}" format="txt" from_work_dir="paths.txt">
+            <filter>input_type[input_type_selector] == 'variant'
+                or input_type[input_type_selector] == 'clustering'</filter>
+        </data>
+        <data name="forward" label="Paths of ${on_string} (forward reads)" format="txt" from_work_dir="forward.txt">
+            <filter>input_type[input_type_selector] == 'reads'</filter>
+        </data>
+        <data name="reverse" label="Paths of ${on_string} (reverse reads)" format="txt" from_work_dir="reverse.txt">
+            <filter>input_type[input_type_selector] == 'reads'</filter>
+        </data>
     </outputs>
 
     <help>