diff parse.xml @ 15:11149c89ee4f draft

planemo upload for repository https://github.com/open2c/pairtools commit a7612b0f2c0575d6a78fb24dc87192d44817178a
author iuc
date Thu, 28 Aug 2025 18:00:12 +0000
parents bfb00f8fec97
children 987ed7d8e152
line wrap: on
line diff
--- a/parse.xml	Wed Aug 13 20:05:28 2025 +0000
+++ b/parse.xml	Thu Aug 28 18:00:12 2025 +0000
@@ -13,7 +13,6 @@
             #if str($assembly_name).strip(): 
                 --assembly '$assembly_name'
             #end if
-            -o '$output'
             --min-mapq '$min_mapq'
             --max-molecule-size '$max_molecule_size'
             $drop_readid
@@ -30,6 +29,15 @@
             --max-inter-align-gap '$max_inter_algn_gap'
             --nproc-in \${GALAXY_SLOTS:-4}
             --nproc-out \${GALAXY_SLOTS:-4}
+            #if $sort_output:
+                |
+            pairtools sort -o '$output'
+                --nproc-in \${GALAXY_SLOTS:-4}
+                --nproc-out \${GALAXY_SLOTS:-4}
+            #else
+                 -o '$output'
+            #end if
+
     ]]></command>
     <inputs>
         <param name="sam_path" type="data" format="sam,qname_input_sorted.bam,qname_sorted.bam" label="Input SAM/BAM file" help="Input SAM or BAM (unsorted/name-sorted) file with paired-end sequence alignments of Hi-C molecules."/>
@@ -70,6 +78,7 @@
             <expand macro="walks_policy_options"/>
         </param>
         <param name="compress_output" type="boolean" truevalue=".gz" falsevalue="" checked="false" label="Compress output file" />   
+        <param name="sort_output" type="boolean"  checked="true" label="generate sorted output file" />
         <param argument="max_inter_algn_gap" type="integer" min="0" value="30" label="Max alignment gap" help="read segments that are not covered by any alignment and longer than the specified value are treated as null alignments."/>
     </inputs>
     <outputs>
@@ -90,36 +99,50 @@
             <param name="min_mapq" value="1"/>
             <param name="walks_policy" value="mask"/>
             <param name="max_inter_algn_gap" value="20"/>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_sam.pairs" lines_diff="10"/>
         </test>
-        <!--Test 02 with BAM file as input and default parameters-->
+        <!--Test 02 with SAM file as input and sorted output default parameters-->
+        <test expect_num_outputs="1">
+            <param name="sam_path" value="test.sam"/>
+            <param name="chroms_path" value="test.genome"/>
+            <param name="min_mapq" value="1"/>
+            <param name="walks_policy" value="mask"/>
+            <param name="max_inter_algn_gap" value="20"/>
+            <param name="sort_output" value="true"/>
+            <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_sam.sorted.pairs" lines_diff="10"/>
+        </test>
+        <!--Test 03 with BAM file as input and default parameters-->
         <test expect_num_outputs="1">
             <param name="sam_path" value="test.bam"/>
             <param name="chroms_path" value="test.reduced.chrom.sizes"/>
             <param name="min_mapq" value="1"/>
             <param name="walks_policy" value="mask"/>
             <param name="max_inter_algn_gap" value="20"/>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_bam.pairs" lines_diff="10"/>
         </test>
-        <!--Test 03 with BAM file as input and minimal mapq of 40-->
+        <!--Test 04 with BAM file as input and minimal mapq of 40-->
         <test expect_num_outputs="1">
             <param name="sam_path" value="test.bam"/>
             <param name="chroms_path" value="test.reduced.chrom.sizes"/>
             <param name="min_mapq" value="40"/>
             <param name="walks_policy" value="mask"/>
             <param name="max_inter_algn_gap" value="20"/>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_bam_min_mapq_40.pairs" lines_diff="10"/>
         </test>
-        <!--Test 04 with BAM file as input and walk policy of 5unique-->
+        <!--Test 05 with BAM file as input and walk policy of 5unique-->
         <test expect_num_outputs="1">
             <param name="sam_path" value="test.bam"/>
             <param name="chroms_path" value="test.reduced.chrom.sizes"/>
             <param name="min_mapq" value="40"/>
             <param name="walks_policy" value="5unique"/>
             <param name="max_inter_algn_gap" value="20"/>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_bam_5unique.pairs" lines_diff="10"/>
         </test>
-        <!--Test 05 with BAM file as input and read id dropped-->
+        <!--Test 06 with BAM file as input and read id dropped-->
         <test expect_num_outputs="1">
             <param name="sam_path" value="test.bam"/>
             <param name="chroms_path" value="test.reduced.chrom.sizes"/>
@@ -127,9 +150,10 @@
             <param name="walks_policy" value="5unique"/>
             <param name="max_inter_algn_gap" value="20"/>
             <param name="drop_readid" value="true"></param>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_bam_readid_dropped.pairs" lines_diff="10"/>
         </test>
-        <!--Test 06 with SAM file as input and drop_seq enabled-->
+        <!--Test 07 with SAM file as input and drop_seq enabled-->
         <test expect_num_outputs="1">
             <param name="sam_path" value="test.sam"/>
             <param name="chroms_path" value="test.genome"/>
@@ -137,9 +161,10 @@
             <param name="walks_policy" value="5unique"/>
             <param name="max_inter_algn_gap" value="20"/>
             <param name="drop_seq" value="true"></param>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_bam_readid_dropped_seq.pairs" lines_diff="10"/>
         </test>
-        <!--Test 07 with SAM file as input and output_stats enabled-->
+        <!--Test 08 with SAM file as input and output_stats enabled-->
         <test expect_num_outputs="2">
             <param name="sam_path" value="test.sam"/>
             <param name="chroms_path" value="test.genome"/>
@@ -149,7 +174,7 @@
             <param name="output_stats" value="true"></param>
             <output name="parsed_pairs_stats" file="output_parsed_pairs.stats" lines_diff="10"/>
         </test>
-        <!--Test 08 with SAM file as input and default parameters and assembly name -->
+        <!--Test 09 with SAM file as input and default parameters and assembly name -->
         <test expect_num_outputs="1">
             <param name="sam_path" value="test.sam"/>
             <param name="chroms_path" value="test.genome"/>
@@ -157,9 +182,10 @@
             <param name="min_mapq" value="1"/>
             <param name="walks_policy" value="mask"/>
             <param name="max_inter_algn_gap" value="20"/>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_sam_assemblyname.pairs" lines_diff="10"/>
         </test>
-        <!--Test 09 with SAM file as input and default parameters and assembly name and compressed output--> 
+        <!--Test 10 with SAM file as input and default parameters and assembly name and compressed output-->
         <test expect_num_outputs="1">
             <param name="sam_path" value="test.sam"/>
             <param name="chroms_path" value="test.genome"/>
@@ -168,9 +194,21 @@
             <param name="walks_policy" value="mask"/>
             <param name="max_inter_algn_gap" value="20"/>
             <param name="compress_output" value="true"/>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam.gz" file="output_parsed_pairs_sam_assemblyname.pairs.gz" decompress="true" lines_diff="10"/>
         </test>
-        <!--Test 10 with SAM file as input and add columns-->
+        <!--Test 11 with SAM file as input and default parameters and assembly name and sorted, compressed output-->
+        <test expect_num_outputs="1">
+            <param name="sam_path" value="test.sam"/>
+            <param name="chroms_path" value="test.genome"/>
+            <param name="assembly_name" value="test_assembly"/>
+            <param name="min_mapq" value="1"/>
+            <param name="walks_policy" value="mask"/>
+            <param name="max_inter_algn_gap" value="20"/>
+            <param name="compress_output" value="true"/>
+            <output name="output_parsed_pairs" ftype="4dn_pairsam.gz" file="output_parsed_pairs_sam_assemblyname.sorted.pairs.gz" decompress="true" lines_diff="10"/>
+        </test>
+        <!--Test 12 with SAM file as input and add columns-->
         <test expect_num_outputs="1">
             <param name="sam_path" value="test.sam"/>
             <param name="chroms_path" value="test.genome"/>
@@ -181,6 +219,7 @@
                 <param name="add_columns_selection" value="yes"/>
                 <param name="add_columns" value="mapq,seq"/>
             </conditional>
+            <param name="sort_output" value="false"/>
             <output name="output_parsed_pairs" ftype="4dn_pairsam" file="output_parsed_pairs_sam_mapq.pairs" lines_diff="10"/>
         </test>
     </tests>
@@ -190,7 +229,9 @@
         Detects ligation events in the aligned sequences of DNA molecules formed in Hi-C experiments and reports them in the .pairs/.pairsam format.
         
         sam_path : an input .sam/.bam (unsorted/name-sorted) file with paired-end sequence alignments of Hi-C molecules. 
-              
+
+        By default, the generated .pair/.pairsam output is sorted by piping it through pairtools sort. You can disable this behavior by unchecking the “Generate sorted output file” checkbox.
+
     ]]></help>
     <expand macro="citations"/>
     <expand macro="creator"/>