changeset 1:4cd611004dc4 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/pgsnp2gd_snp commit a1517c9d22029095120643bbe2c8fa53754dd2b7
author devteam
date Wed, 11 Nov 2015 12:22:57 -0500
parents d281062566f9
children
files pgSnp2gd_snp.pl pgSnp2gd_snp.xml
diffstat 2 files changed, 54 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/pgSnp2gd_snp.pl	Mon Jul 28 11:55:36 2014 -0400
+++ b/pgSnp2gd_snp.pl	Wed Nov 11 12:22:57 2015 -0500
@@ -59,7 +59,7 @@
 }
 
 if ($in =~ /.gz$/) { 
-   open(FH, "zcat $in |") or die "Couldn't open $in, $!\n";
+   open(FH, "zcat < $in |") or die "Couldn't open $in, $!\n";
 }elsif ($in =~ /.bz2$/) {
    open(FH, "bzcat $in |") or die "Couldn't open $in, $!\n";
 }else {
--- a/pgSnp2gd_snp.xml	Mon Jul 28 11:55:36 2014 -0400
+++ b/pgSnp2gd_snp.xml	Wed Nov 11 12:22:57 2015 -0500
@@ -1,55 +1,58 @@
 <tool id="pgSnp2gd_snp" name="pgSnp to gd_snp" hidden="false" version="1.0.0">
-  <description>Convert from pgSnp to gd_snp</description>
-  <command interpreter="perl">
-    #if $snptab.tab2 == "yes" 
-      #if $snptab.colsOnly == "addColsOnly" #pgSnp2gd_snp.pl $input1 -tab=$snptab.input2 -name=$indName -build=${input1.metadata.dbkey} -addColsOnly -chr=${input1.metadata.chromCol} > $out_file1 
-      #else #pgSnp2gd_snp.pl $input1 -tab=$snptab.input2 -name=$indName -build=${input1.metadata.dbkey} -ref=${ref} -chr=${input1.metadata.chromCol} > $out_file1
-      #end if
-    #else #pgSnp2gd_snp.pl $input1 -name=$indName -build=${input1.metadata.dbkey} -ref=${ref} -chr=${input1.metadata.chromCol} > $out_file1
+    <description>Convert from pgSnp to gd_snp</description>
+    <command interpreter="perl">
+<![CDATA[
+#if $snptab.tab2 == "yes"
+    #if $snptab.needRef.colsOnly == "addColsOnly"
+        pgSnp2gd_snp.pl '$input1' -tab=${snptab.input2} -name=$indName -build=${input1.metadata.dbkey} -addColsOnly -chr=${input1.metadata.chromCol} > '$out_file1'
+    #else
+        pgSnp2gd_snp.pl '$input1' -tab=${snptab.input2} -name=$indName -build=${input1.metadata.dbkey} -ref=${snptab.needRef.ref} -chr=${input1.metadata.chromCol} > '$out_file1'
     #end if
-  </command>
-  <inputs>
-    <param format="tab" name="input1" type="data" label="pgSnp dataset" />
-    <conditional name="snptab">
-      <param name="tab2" type="select" label="Append to gd_snp dataset in history">
-        <option value="yes">yes</option>
-        <option value="no" selected="true">no</option>
-      </param>
-      <when value="yes">
-      <param format="gd_snp" name="input2" type="data" label="gd_snp dataset" />
-        <conditional name="needRef">
-        <param name="colsOnly" type="select" label="Skip new SNPs">
-          <option value="no" selected="true">no</option>
-          <option value="addColsOnly">yes</option>
-        </param>
-        <when value="no"> 
-        <param name="ref" type="data_column" data_ref="input1" label="Column with reference allele" />
-        </when>
-        <when value="addColsOnly"> <!-- do nothing -->
-        </when>
+#else
+    pgSnp2gd_snp.pl '$input1' -name=$indName -build=${input1.metadata.dbkey} -ref=${snptab.ref} -chr=${input1.metadata.chromCol} > '$out_file1'
+#end if
+]]>
+    </command>
+    <inputs>
+        <param format="tab" name="input1" type="data" label="pgSnp dataset" />
+        <conditional name="snptab">
+            <param name="tab2" type="select" label="Append to gd_snp dataset in history">
+                <option value="yes">yes</option>
+                <option value="no" selected="true">no</option>
+            </param>
+            <when value="yes">
+                <param format="gd_snp" name="input2" type="data" label="gd_snp dataset" />
+                <conditional name="needRef">
+                    <param name="colsOnly" type="select" label="Skip new SNPs">
+                        <option value="no" selected="true">no</option>
+                        <option value="addColsOnly">yes</option>
+                    </param>
+                    <when value="no">
+                        <param name="ref" type="data_column" data_ref="input1" label="Column with reference allele" />
+                    </when>
+                    <when value="addColsOnly" />
+                </conditional>
+            </when>
+            <when value="no">
+                <param name="ref" type="data_column" data_ref="input1" label="Column with reference allele" />
+            </when>
         </conditional>
-      </when>
-      <when value="no">
-      <param name="ref" type="data_column" data_ref="input1" label="Column with reference allele" />
-      </when>
-    </conditional>
-    <param name="indName" type="text" size="20" label="Label for new individual/group" value="na" />
-  </inputs>
-  <outputs>
-  <data format="gd_snp" name="out_file1" />
-  </outputs>
-  <tests>
-    <test>
-      <param name='input1' value='pgSnpTest.ref.txt' ftype='interval' />
-      <param name='tab2' value='no' />
-      <param name='ref' value='8' />
-      <param name='indName' value='na' />
-      <output name="output" file="pgSnp2snp_output.txt" />
-    </test>
-  </tests>
+        <param name="indName" type="text" label="Label for new individual/group" value="na" />
+    </inputs>
+    <outputs>
+        <data format="gd_snp" name="out_file1" />
+    </outputs>
+    <tests>
+        <test>
+            <param name="input1" value="pgSnpTest.ref.txt" ftype="interval" dbkey="hg19" />
+            <param name="tab2" value="no" />
+            <param name="ref" value="8" />
+            <param name="indName" value="na" />
+            <output name="output" file="pgSnp2snp_output.txt" />
+        </test>
+    </tests>
 
-  <help>
-
+    <help>
 **Dataset formats**
 
 The input dataset is of Galaxy datatype interval_, with the additional columns
@@ -69,7 +72,7 @@
 This tool converts a pgSnp dataset to gd_snp format, either starting a new
 dataset or appending to an old one.  When appending,
 if any new SNPs appear only in the pgSnp file they can either be skipped entirely, or
-backfilled with "-1" (meaning "unknown") for previous individuals/groups in the 
+backfilled with "-1" (meaning "unknown") for previous individuals/groups in the
 input gd_snp dataset.
 If any new SNPs are being added (either by creating a new table or by backfilling),
 then an extra column with the reference allele must be supplied in the pgSnp dataset,
@@ -92,6 +95,5 @@
    chr1    3118325   C       T      -1      0       8       0     0.8796
    chr1    3211457   A       C      -1      17      10      1     0.8576
    etc.
-
-</help>
+    </help>
 </tool>