Repository 'prince_galaxy'
hg clone https://toolshed.g2.bx.psu.edu/repos/jowong/prince_galaxy

Changeset 4:82569b47df8d (2018-10-29)
Previous changeset 3:dde3036465de (2018-10-26) Next changeset 5:6d490b72aefa (2018-10-29)
Commit message:
planemo upload
added:
data_path.py
data_path.xml
filler.py
filler.xml
prince_postprocess.py
prince_postprocess.xml
b
diff -r dde3036465de -r 82569b47df8d data_path.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/data_path.py Mon Oct 29 07:52:12 2018 -0400
[
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import sys
+import argparse as ap
+
+parser = ap.ArgumentParser(prog='data_path', conflict_handler='resolve',
+                           description="Output the galaxy file path of datasets in a text file")
+
+input = parser.add_argument_group('Input', '')
+input.add_argument('-i', '--input', nargs='+', required=True, help="Paths to data1")
+input.add_argument('-j', '--input2', nargs='*', required=True, help="Paths to data2")
+
+if len(sys.argv) == 0:
+    parser.print_usage()
+    sys.exit(1)
+
+args = parser.parse_args()
+output = open('paths.txt', 'w')
+if len(args.input2) == 0:
+ for index,path in enumerate(args.input):
+ output.write("%s\n" % (path))
+else:
+ for index,path in enumerate(args.input):
+ output.write("%s\t%s\n" % (path, args.input2[index]))
b
diff -r dde3036465de -r 82569b47df8d data_path.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/data_path.xml Mon Oct 29 07:52:12 2018 -0400
[
@@ -0,0 +1,17 @@
+<tool id="data_path" name="Data Path" version="1.0.0">
+    <description>creates a txt file of the paths of items in a data collection</description>
+    <command interpreter="python"><![CDATA[
+        data_path.py -i #for $path in $paths# $path.forward #end for# -j #for $path in $paths# $path.reverse #end for#
+    ]]></command>
+    <inputs>
+        <param name="paths" type="data_collection" format="data" label="Collection of files" help="" optional="False" multiple="True"/>
+    </inputs>
+    <outputs>
+        <data name="output" label="Paths of ${on_string}" format="txt" from_work_dir="paths.txt"/>
+    </outputs>
+    <help>
+This tool outputs the paths of the files in a data collection
+    </help>
+    <citations>
+    </citations>
+</tool>
b
diff -r dde3036465de -r 82569b47df8d filler.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/filler.py Mon Oct 29 07:52:12 2018 -0400
[
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import sys
+import argparse as ap
+
+parser = ap.ArgumentParser(prog='filler', conflict_handler='resolve',
+                           description="produce filler collection to deal with galaxy handling")
+
+input = parser.add_argument_group('Input', '')
+input.add_argument('-i', '--input', nargs=1, required=True, help="Paths to forward reads")
+input.add_argument('-o', '--output', nargs=1, required=True, help="output")
+
+if len(sys.argv) == 0:
+    parser.print_usage()
+    sys.exit(1)
+
+args = parser.parse_args()
+output = open(args.output[0], 'w')
+output.write(args.input[0])
+output.write("\n")
b
diff -r dde3036465de -r 82569b47df8d filler.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/filler.xml Mon Oct 29 07:52:12 2018 -0400
[
@@ -0,0 +1,36 @@
+<tool id="filler" name="Filler" version="1.0.0">
+    <description>Filler Function to deal with paired collection</description>
+    <command interpreter="python"><![CDATA[
+      filler.py 
+        #if str( $data_input.data_selector ) == "paired"       
+          -i $data_input.input1.forward.element_identifier      
+        #end if
+        #if str( $data_input.data_selector ) == "single"       
+          -i "$data_input.input2.element_identifier"
+        #end if
+        
+        -o $output
+    ]]></command>
+    <inputs>
+      <conditional name="data_input">
+        <param name="data_selector" type="select" label="Single or Paired-end Data" help="Select between paired and single end data to add name to dataset">
+          <option value="paired">Paired</option>
+          <option value="single">Single</option>
+        </param>
+        <when value="paired">
+          <param name="input1" format="data" type="data_collection" collection_type="paired" label="Select a paired collection" help="a paired data"/>
+        </when>
+        <when value="single">
+          <param name="input2" format="data" type="data" label="input" help="Specify dataset with single reads"/>
+        </when>
+      </conditional>
+    </inputs>
+    <outputs>
+        <data name="output" type="data_collection"/>
+    </outputs>
+    <help>
+This tool processes the PRINCE galaxy output such that it is in line with the command line
+    </help>
+    <citations>
+    </citations>
+</tool>
b
diff -r dde3036465de -r 82569b47df8d prince_postprocess.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/prince_postprocess.py Mon Oct 29 07:52:12 2018 -0400
[
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+import sys
+import argparse as ap
+import re
+parser = ap.ArgumentParser(prog='prince_postprocess', conflict_handler='resolve',
+                           description="Postprocess galaxy PRINCE output")
+
+input = parser.add_argument_group('Input', '')
+input.add_argument('-i', '--input', nargs=1, required=True, help="PRINCE OUTPUT")
+input.add_argument('-s', '--sample', nargs='*', required=True, help="Sample names")
+
+if len(sys.argv) == 0:
+    parser.print_usage()
+    sys.exit(1)
+
+args = parser.parse_args()
+
+#print(args.input)
+#sample_name = re.sub('(_1.fastq(.gz)*|_2.fastq(.gz)*|.fastq(.gz)*)', '', args.label.rstrip().lstrip())
+
+with open(args.input[0]) as prince_output:
+ with open('prince_postprocess_output.txt', 'w') as output:
+ x = 1
+ index = 0
+ for line in prince_output:
+ if x%2 == 0:
+                                sample = re.sub('(_1.fastq(.gz)*|_2.fastq(.gz)*|.fastq(.gz)*)', '', args.sample[index])
+ output.write(re.sub('.*.dat', sample, line))
+ index += 1
+ else:
+ output.write(line)
+ x += 1
+ #output.write("\n")
+
+
b
diff -r dde3036465de -r 82569b47df8d prince_postprocess.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/prince_postprocess.xml Mon Oct 29 07:52:12 2018 -0400
[
@@ -0,0 +1,18 @@
+<tool id="prince_postprocess" name="Prince Postprocess" version="1.0.0">
+    <description>Postprocess PRINCE galaxy output</description>
+    <command interpreter="python"><![CDATA[
+        prince_postprocess.py -i $prince_output  -s #for $path in $paths# $path.element_identifier #end for#
+    ]]></command>
+    <inputs>
+        <param name="paths" type="data" format="data" label="Collection of files" help="" optional="False" multiple="True"/>
+        <param name="prince_output" format="txt" type="data" label="PRINCE output"  />
+    </inputs>
+    <outputs>
+        <data name="output" format="txt" from_work_dir="prince_postprocess_output.txt"/>
+    </outputs>
+    <help>
+This tool processes the PRINCE galaxy output such that it is in line with the command line
+    </help>
+    <citations>
+    </citations>
+</tool>