Repository 'splitfasta'
hg clone https://toolshed.g2.bx.psu.edu/repos/rnateam/splitfasta

Changeset 0:bc25ba9d9fcf (2015-07-05)
Next changeset 1:279e2625de3a (2015-07-05)
Commit message:
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/hacked/splitFasta commit fcd6ef7e59971abd6b6a3a5401f92bcdef6ef76c
added:
splitFasta.py
splitfasta.xml
b
diff -r 000000000000 -r bc25ba9d9fcf splitFasta.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/splitFasta.py Sun Jul 05 08:37:52 2015 -0400
[
@@ -0,0 +1,14 @@
+import sys, os
+if __name__ == "__main__":
+    #assuming perfect input, read every two lines
+    inpath = sys.argv[1]
+    file_contents = open(inpath, 'r').readlines()
+    os.makedirs('splits')
+    inname = os.path.basename(inpath)
+    for i in range(0, len(file_contents), 2):
+        headline = file_contents[i]
+        outname = headline[1:headline.index(' ')]+'.fa'
+        outfile = open(os.path.join('splits',outname), 'w')
+        outfile.write(file_contents[i])
+        outfile.write(file_contents[i+1])
+        outfile.close()
b
diff -r 000000000000 -r bc25ba9d9fcf splitfasta.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/splitfasta.xml Sun Jul 05 08:37:52 2015 -0400
[
@@ -0,0 +1,23 @@
+<tool id="rbc_splitfasta" name="SplitFasta" version="0.1.0">
+    <requirements>
+    </requirements>
+    <stdio>
+        <exit_code range="1:" />
+    </stdio>
+
+    <command interpreter="python">
+    <![CDATA[
+        splitFasta.py $inputFile; echo 'blah' > blah
+    ]]></command>
+    <inputs>
+        <param name="inputFile" type="data" format="txt" label="Fasta file to split"/>
+    </inputs>
+    <outputs>
+        <collection type="list">
+            <discover_datasets pattern="(?P&lt;designation&gt;.*)" directory="splits" visible="false"/>
+        </collection>
+    </outputs>
+    <help><![CDATA[
+        Takes an input file and writes each consecutive two lines to a separate file, in a dataset collection.
+    ]]></help>
+</tool>