Skip to content

Commit

Permalink
Merge pull request #16668 from bernt-matthias/topic/samtools-bump
Browse files Browse the repository at this point in the history
Bump samtools converters
  • Loading branch information
mvdbeek authored Sep 10, 2023
2 parents 174257d + b2a3208 commit f43f350
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 26 deletions.
12 changes: 8 additions & 4 deletions lib/galaxy/datatypes/converters/bam_to_bai.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<tool id="CONVERTER_Bam_Bai_0" name="Convert Bam to Bai" version="1.0.0" hidden="true" profile="16.04">
<tool id="CONVERTER_Bam_Bai_0" name="Convert Bam to Bai" version="1.0.1" hidden="true" profile="16.04">
<requirements>
<requirement type="package" version="1.10">samtools</requirement>
<requirement type="package" version="1.17">samtools</requirement>
</requirements>
<command>samtools index -@ \${GALAXY_SLOTS:-1} '$input1' '$output1'</command>
<command>samtools index -@ \${GALAXY_SLOTS:-1} -b '$input1' -o '$output1'</command>
<inputs>
<param format="bam" name="input1" type="data" label="Choose BAM"/>
</inputs>
Expand All @@ -12,7 +12,11 @@
<tests>
<test>
<param name="input1" ftype="bam" value="srma_out2.bam"/>
<output name="output1" ftype="bai" value="srma_out2.bai"/>
<output name="output1" ftype="bai">
<assert_contents>
<has_size value="7584" delta="10"/>
</assert_contents>
</output>
</test>
</tests>
<help>
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/datatypes/converters/cram_to_bam_converter.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tool id="CONVERTER_cram_to_bam_0" name="Convert CRAM to BAM" version="1.0.1" hidden="true" profile="16.04">
<tool id="CONVERTER_cram_to_bam_0" name="Convert CRAM to BAM" version="1.0.2" hidden="true" profile="16.04">
<requirements>
<requirement type="package" version="1.16.1">samtools</requirement>
<requirement type="package" version="1.17">samtools</requirement>
</requirements>
<command><![CDATA[
samtools sort -@\${GALAXY_SLOTS:-1} -T "\${TMPDIR:-.}" -o '$output' --output-fmt BAM '$input'
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/datatypes/converters/fasta_to_fai.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tool id="CONVERTER_fasta_to_fai" name="Convert FASTA to fai file" version="1.0.0">
<tool id="CONVERTER_fasta_to_fai" name="Convert FASTA to fai file" version="1.0.1">
<requirements>
<requirement type="package" version="0.1.19">samtools</requirement>
<requirement type="package" version="1.17">samtools</requirement>
</requirements>
<command><![CDATA[
ln -s '$input' temp.fasta &&
Expand Down
8 changes: 4 additions & 4 deletions lib/galaxy/datatypes/converters/sam_to_bigwig_converter.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<tool id="CONVERTER_sam_to_bigwig_0" name="Convert SAM to BigWig" version="1.0.2" hidden="true">
<tool id="CONVERTER_sam_to_bigwig_0" name="Convert SAM to BigWig" version="1.0.3" hidden="true">
<requirements>
<requirement type="package" version="357">ucsc-bedgraphtobigwig</requirement>
<requirement type="package" version="1.6">samtools</requirement>
<requirement type="package" version="2.27.1">bedtools</requirement>
<requirement type="package" version="445">ucsc-bedgraphtobigwig</requirement>
<requirement type="package" version="1.17">samtools</requirement>
<requirement type="package" version="2.31.0">bedtools</requirement>
</requirements>
<command detect_errors="aggressive"><![CDATA[
samtools view -bh '$input' | bedtools genomecov -bg -split -ibam stdin
Expand Down
5 changes: 3 additions & 2 deletions lib/galaxy/datatypes/converters/sam_to_unsorted_bam.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<tool id="CONVERTER_sam_to_unsorted_bam" name="Convert SAM to BAM without sorting" version="1.0.0" profile="18.01">
<tool id="CONVERTER_sam_to_unsorted_bam" name="Convert SAM to BAM without sorting" version="1.0.1" profile="18.01">
<requirements>
<requirement type="package" version="1.6">samtools</requirement>
<requirement type="package" version="1.17">samtools</requirement>
</requirements>
<command><![CDATA[
samtools view
-b
-h
-@ \${GALAXY_SLOTS:-2}
--no-PG
-o '${output}'
'$input'
]]>
Expand Down
10 changes: 6 additions & 4 deletions lib/galaxy/datatypes/converters/to_coordinate_sorted_bam.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<tool id="CONVERTER_bam_to_coodinate_sorted_bam" name="Convert BAM to coordinate-sorted BAM" version="1.0.0" hidden="true" profile="18.01">
<tool id="CONVERTER_bam_to_coodinate_sorted_bam" name="Convert BAM to coordinate-sorted BAM" version="1.0.1" hidden="true" profile="18.01">
<requirements>
<requirement type="package" version="1.6">samtools</requirement>
<requirement type="package" version="1.17">samtools</requirement>
</requirements>
<command><![CDATA[
samtools sort
-@ \${GALAXY_SLOTS:-1}
--no-PG
-o '${output}'
-O bam
-T dataset
-T "\${TMPDIR:-.}"
'${input}'
]]>
</command>
Expand All @@ -20,7 +21,8 @@
<tests>
<test>
<param name="input" ftype="sam" value="bfast_out1.sam"/>
<output name="output" ftype="bam" value="bfast_out1.bam"/>
<!--lines diff due to @HD line which contained GO:none before-->
<output name="output" ftype="bam" value="bfast_out1.bam" lines_diff="2"/>
</test>
</tests>
<help>
Expand Down
10 changes: 6 additions & 4 deletions lib/galaxy/datatypes/converters/to_qname_sorted_bam.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<tool id="CONVERTER_bam_to_qname_sorted_bam" name="Convert BAM to queryname-sorted BAM" version="1.0.0" hidden="true" profile="18.01">
<tool id="CONVERTER_bam_to_qname_sorted_bam" name="Convert BAM to queryname-sorted BAM" version="1.0.1" hidden="true" profile="18.01">
<requirements>
<requirement type="package" version="1.6">samtools</requirement>
<requirement type="package" version="1.17">samtools</requirement>
</requirements>
<command><![CDATA[
samtools sort
-@ \${GALAXY_SLOTS:-1}
-o '${output}'
-n
--no-PG
-O bam
-T dataset
-T "\${TMPDIR:-.}"
'${input}'
]]>
</command>
Expand All @@ -21,7 +22,8 @@
<tests>
<test>
<param name="input" ftype="sam" value="bfast_out1.sam"/>
<output name="output" ftype="qname_sorted.bam" value="bfast_out1.qname_sorted.bam"/>
<!--lines diff due to @HD line which contained GO:none before-->
<output name="output" ftype="qname_sorted.bam" value="bfast_out1.qname_sorted.bam" lines_diff="2"/>
</test>
</tests>
<help>
Expand Down
6 changes: 6 additions & 0 deletions lib/galaxy/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ class safe_update(NamedTuple):
"Show tail1": safe_update(parse_version("1.0.0"), parse_version("1.0.1")),
"sort1": safe_update(parse_version("1.1.0"), parse_version("1.2.0")),
"CONVERTER_interval_to_bgzip_0": safe_update(parse_version("1.0.1"), parse_version("1.0.2")),
"CONVERTER_Bam_Bai_0": safe_update(parse_version("1.0.0"), parse_version("1.0.1")),
"CONVERTER_cram_to_bam_0": safe_update(parse_version("1.0.1"), parse_version("1.0.2")),
"CONVERTER_fasta_to_fai": safe_update(parse_version("1.0.0"), parse_version("1.0.1")),
"CONVERTER_sam_to_bigwig_0": safe_update(parse_version("1.0.2"), parse_version("1.0.3")),
"CONVERTER_bam_to_coodinate_sorted_bam": safe_update(parse_version("1.0.0"), parse_version("1.0.1")),
"CONVERTER_bam_to_qname_sorted_bam": safe_update(parse_version("1.0.0"), parse_version("1.0.1")),
}


Expand Down
3 changes: 2 additions & 1 deletion test/functional/tools/sam_to_bam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ cat '$input1' > '$out_file1'
<tests>
<test>
<param name="input1" value="sam_with_header.sam" ftype="sam"/>
<output name="out_file1" file="bam_from_sam.bam" ftype="bam"/>
<!-- allow up to 2 differences (4 lines) due to version change of the implicitly running converter -->
<output name="out_file1" file="bam_from_sam.bam" ftype="bam" lines_diff="4"/>
</test>
</tests>
<help>
Expand Down
6 changes: 3 additions & 3 deletions test/functional/tools/sam_to_unsorted_bam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@
<!-- Test that sam input is properly converted to bam -->
<test>
<param name="input3" value="sam_with_header.sam" ftype="sam"/>
<output name="bam_output" file="bam_from_sam.bam" ftype="bam"/>
<output name="bam_output" file="bam_from_sam.bam" ftype="bam" lines_diff="2"/>
</test>
<!-- Test that sam input is properly converted to qname_sorted.bam -->
<test>
<param name="input4" value="sam_with_header.sam" ftype="sam"/>
<output name="qname_sorted_bam_output" file="qname_sorted.bam" ftype="qname_sorted.bam"/>
<output name="qname_sorted_bam_output" file="qname_sorted.bam" ftype="qname_sorted.bam" lines_diff="2"/>
</test>
<!-- Test that sam input is properly converted to qname_sorted.bam (which is qname_input_sorted.bam compatible) -->
<test>
<param name="input4" value="sam_with_header.sam" ftype="sam"/>
<output name="qname_sorted_bam_output" file="qname_sorted.bam" ftype="qname_sorted.bam"/>
<output name="qname_sorted_bam_output" file="qname_sorted.bam" ftype="qname_sorted.bam" lines_diff="2"/>
</test>
</tests>
<help>
Expand Down

0 comments on commit f43f350

Please sign in to comment.