diff crossmap_bam.xml @ 1:8e5feca6a518 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/crossmap commit e365f2835488e73b870c73502c24ff23d28b76a5
author iuc
date Fri, 20 Oct 2017 02:48:57 -0400
parents d04d5afec2e0
children 083774cc8472
line wrap: on
line diff
--- a/crossmap_bam.xml	Tue Sep 26 05:44:53 2017 -0400
+++ b/crossmap_bam.xml	Fri Oct 20 02:48:57 2017 -0400
@@ -7,70 +7,38 @@
     <expand macro="stdio"/>
     <expand macro="version_command"/>
     <command><![CDATA[
-        #if $input_file.extension == "bam":
-            #set $input_file = "input.sam"
-            samtools view -h '${seq_source.input}' > '${input_file}' &&
-        #else:
-            #set $input_file = "input.bam"
-            ln -s '${seq_source.input}' '${input_file}'
-        #end if
 
-        CrossMap.py
-            bam
+CrossMap.py bam
+'${chain_source.input_chain}'
+$optional_tags
 
-            "$chain_source.input_chain"
-            $optional_tags
-
-            -m $insert_size
-            -s $insert_size_stdev
-            -t $insert_size_fold
+-m $insert_size
+-s $insert_size_stdev
+-t $insert_size_fold
 
-            '${input_file}'
-            '${output}'
+'${input}'
+'${output}'
 
-            && samtools sort "${output}.sam" > '${output}'
-            && samtools sort "${output}.unmap.sam" > '${output_unmapped}'
+&& mv '${output}.sorted.bam' '${output}'
     ]]></command>
-
     <inputs>
-        <conditional name="seq_source">
-            <expand macro="source" />
-            <when value="cached">
-                <param type="data" format="bam" name="input" label="BAM file">
-                    <validator type="unspecified_build"/>
-                    <!-- Gives error in tests
-                    <validator type="dataset_metadata_in_file" filename="liftOver.loc" metadata_name="dbkey" metadata_column="0" message="LiftOver mapping (chain file) is not available for the specified build."/>
-                    -->
-                </param>
-                <param name="input_chain" type="select" label="Lift Over To">
-                    <options from_file="liftOver.loc">
-                        <column name="name" index="1"/>
-                        <column name="value" index="2"/>
-                        <column name="dbkey" index="0"/>
-                        <filter type="data_meta" ref="input" key="dbkey" column="0"/>
-                    </options>
-                </param>
-            </when>
-            <when value="history">
-                <param type="data" format="bam" name="input" label="BAM/SAM file"/>
-                <param type="data" format="csv" name="input_chain" label="LiftOver chain file"/>
-            </when>
-        </conditional>
+        <param name="input" type="data" format="bam" label="BAM file"/>
+
         <expand macro="chain" />
-        <param name="optional_tags" type="boolean" truevalue="-a" falsevalue="" label="Add optional BAM/SAM Headers" argument="-a"/>
+
+        <param name="optional_tags" argument="-a" type="boolean" truevalue="-a" falsevalue="" label="Add optional BAM Headers"/>
 
-        <param name="insert_size" type="float" value="200.0" label="Insert size" argument="-m" help="Average insert size of pair-end sequencing (bp) [default=200.0]"/>
-        <param name="insert_size_stdev" type="float" value="30.0" label="Insert size std. dev" argument="-s" help="Stanadard deviation of insert size. [default=30.0]"/>
-        <param name="insert_size_fold" type="float" value="3.0" label="Insert size std. dev foldchange" argument="-t" help="A mapped pair is considered as 'proper pair' if both ends mapped to different strand and the distance between them is less then '-t' * stdev from the mean. [default=3.0]"/>
-</inputs>
+        <param name="insert_size" argument="-m" type="float" value="200.0" label="Insert size" help="Average insert size of pair-end sequencing (bp)"/>
+        <param name="insert_size_stdev" argument="-s" type="float" value="30.0" label="Insert size std. dev" help="Stanadard deviation of insert size"/>
+        <param name="insert_size_fold" argument="-t" type="float" value="3.0" label="Insert size std. dev foldchange" help="A mapped pair is considered as 'proper pair' if both ends mapped to different strand and the distance between them is less then '-t' * stdev from the mean"/>
+    </inputs>
 
     <outputs>
-        <data format="bam" name="output" label="${tool.name} on ${on_string}" />
-        <data format="bam" name="output_unmapped" label="${tool.name} (unmapped) on ${on_string}" />
+        <data name="output" format="bam" label="${tool.name} on ${on_string}" />
+        <!-- CrossMap 0.2.5 does not produce output_unmapped -->
     </outputs>
 
     <tests>
-    <!-- BAM/SAM -->
         <test>
             <param name="index_source" value="history"/>
             <param name="input" value="test_bam_01_input_a.bam" ftype="bam"/>
@@ -78,57 +46,77 @@
             <param name="include_fails" value="False"/>
 
             <output name="output" file="test_bam_01_output_a.bam" compare="diff" lines_diff="8"/>
-            <output name="output_unmapped" file="test_bam_01_output_a.unmap.bam" compare="diff" lines_diff="8"/>
+        </test>
+        <test>
+            <param name="index_source" value="cached"/>
+
+            <param name="input" value="test_bam_01_input_a.bam" ftype="bam"/>
+            <param name="include_fails" value="False"/>
+
+            <output name="output" file="test_bam_01_output_a.bam" compare="diff" lines_diff="8"/>
         </test>
     </tests>
     <help><![CDATA[
 @HELP_GENERAL@
 
-SAM / BAM
+BAM
 ---------
 
-    CrossMap updates chromosomes, genome coordinates, header sections, and all
-    SAM flags accordingly. The program version (of CrossMap) is inserted into the
-    header section, along with the names of the original BAM file and the chain
-    file. For pair-end sequencing, insert size is also recalculated.
+CrossMap updates chromosomes, genome coordinates, header sections, and all
+BAM flags accordingly. The program version (of CrossMap) is inserted into the
+header section, along with the names of the original BAM file and the chain
+file. For pair-end sequencing, insert size is also recalculated.
 
 
-    **Optional tags**
+**Optional tags**
 
-    Q
-      QC. QC failed.
+Q
+    QC. QC failed.
 
-    N
-      Unmapped. Originally unmapped or originally mapped but failed to liftover to new assembly.
+N
+    Unmapped. Originally unmapped or originally mapped but failed to liftover to new assembly.
 
-    M
-      Multiple mapped. Alignment can be liftover to multiple places.
+M
+    Multiple mapped. Alignment can be liftover to multiple places.
 
-    U
-      Unique mapped. Alignment can be liftover to only 1 place.
+U
+    Unique mapped. Alignment can be liftover to only 1 place.
 
-    **Tags for pair-end sequencing include:**
+**Tags for pair-end sequencing include:**
 
-    QF = QC failed
-    NN = both read1 and read2 unmapped
-    NU = read1 unmapped, read2 unique mapped
-    NM = read1 unmapped, multiple mapped
-    UN = read1 uniquely mapped, read2 unmap
-    UU = both read1 and read2 uniquely mapped
-    UM = read1 uniquely mapped, read2 multiple mapped
-    MN = read1 multiple mapped, read2 unmapped
-    MU = read1 multiple mapped, read2 unique mapped
-    MM = both read1 and read2 multiple mapped
+QF
+    QC failed
+NN
+    both read1 and read2 unmapped
+NU
+    read1 unmapped, read2 unique mapped
+NM
+    read1 unmapped, multiple mapped
+UN
+    read1 uniquely mapped, read2 unmap
+UU
+    both read1 and read2 uniquely mapped
+UM
+    read1 uniquely mapped, read2 multiple mapped
+MN
+    read1 multiple mapped, read2 unmapped
+MU
+    read1 multiple mapped, read2 unique mapped
+MM
+    both read1 and read2 multiple mapped
 
-    **Tags for single-end sequencing include**
+**Tags for single-end sequencing include**
 
-    QF = QC failed
-    SN = unmaped
-    SM = multiple mapped
-    SU = uniquely mapped
+QF
+    QC failed
+SN
+    unmaped
+SM
+    multiple mapped
+SU
+    uniquely mapped
 
-See `the manual <http://crossmap.sourceforge.net/#convert-bam-sam-format-files>`__ for more details
-]]></help>
+    ]]></help>
 
     <citations>
         <citation type="doi">10.1093/bioinformatics/btt730</citation>