Skip to content

Commit

Permalink
picard sortSam: fix output type
Browse files Browse the repository at this point in the history
we have now query sorted bam .. so use it

guess we do not need sam output
  • Loading branch information
bernt-matthias committed Jan 27, 2023
1 parent 7d61eb2 commit 63b995c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2,023 deletions.
25 changes: 5 additions & 20 deletions tools/picard/picard_SortSam.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
<tool id="picard_SortSam" name="SortSam" version="@TOOL_VERSION@.@WRAPPER_VERSION@">
<tool id="picard_SortSam" name="SortSam" version="@TOOL_VERSION@.@WRAPPER_VERSION@" profile="18.01">
<description>sort SAM/BAM dataset</description>
<macros>
<import>picard_macros.xml</import>
<token name="@WRAPPER_VERSION@">1</token>
</macros>
<expand macro="requirements" />
<command detect_errors="exit_code"><![CDATA[
#if $sort_order == "queryname":
#set $output = "output.sam"
ln -s '${outFile}' output.sam &&
#else:
#set $output = $outFile
#end if
@java_options@
@symlink_element_identifier@
picard
SortSam
INPUT='$escaped_element_identifier'
OUTPUT='${output}'
OUTPUT='sorted.bam'
SORT_ORDER="${sort_order}"
QUIET=true
VERBOSITY=ERROR
Expand All @@ -35,28 +29,19 @@
</inputs>

<outputs>
<data name="outFile" format="bam" label="${tool.name} on ${on_string}: Alignment sorted in ${sort_order} order">
<data name="outFile" format="bam" from_work_dir="sorted.bam" label="${tool.name} on ${on_string}: Alignment sorted in ${sort_order} order">
<change_format>
<when input="sort_order" value="queryname" format="sam"/>
<when input="sort_order" value="queryname" format="qname_sorted.bam"/>
</change_format>
</data>
</outputs>


<tests>
<!-- This test fails when setting metadata on non-coordinate sorted bam files.
This should be handled better in Galaxy (info as of release 16.0).
Workaroudn is to produce queryname sorted sam files.
<test>
<param name="inputFile" ftype="bam" value="picard_SortSam.bam" />
<param name="sort_order" value="queryname"/>
<output name="outFile" file="picard_SortSam_test1.bam" ftype="bam" lines_diff="4"/>
</test>
-->
<test>
<param name="inputFile" ftype="bam" value="picard_SortSam.bam" />
<param name="sort_order" value="queryname"/>
<output name="outFile" file="picard_SortSam_test1.sam" ftype="sam" lines_diff="4" compare="contains"/>
<output name="outFile" file="picard_SortSam_queryname.bam" ftype="qname_sorted.bam" lines_diff="4"/>
</test>
<test>
<param name="inputFile" ftype="bam" value="picard_SortSam.bam" />
Expand Down
Binary file not shown.
Loading

0 comments on commit 63b995c

Please sign in to comment.