Skip to content

Commit

Permalink
samtools fixes (galaxyproject#4598)
Browse files Browse the repository at this point in the history
* allow 4 diff for bam files

an additional diff line is due to more processors used

xref galaxyproject#4490

* link fasta file

because a .fai is written next to it

leads to a failing ci job due to galaxyproject/planemo#1199
  • Loading branch information
bernt-matthias authored Jun 21, 2022
1 parent e5b0861 commit 84db51c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
10 changes: 8 additions & 2 deletions tool_collections/samtools/samtools_markdup/samtools_markdup.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="samtools_markdup" name="Samtools markdup" version="@TOOL_VERSION@" profile="@PROFILE@" >
<tool id="samtools_markdup" name="Samtools markdup" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@" >
<description>marks duplicate alignments</description>
<macros>
<import>macros.xml</import>
Expand All @@ -19,6 +19,12 @@
ln -s '$bamfile' coordsort.sam &&
#end if
## copy fasta reference if needed
## because samtools will try to write a .fai file next to it
#if $output_options.output_format.select_oformat == "CRAM"
ln -s '$output_options.output_format.ref_file' ref_file.fa &&
#end if
samtools markdup
-@ \$addthreads
Expand All @@ -39,7 +45,7 @@ $include_fails
#end if
-O $output_options.output_format.select_oformat
#if $output_options.output_format.select_oformat == "CRAM"
--reference '$output_options.output_format.ref_file'
--reference ref_file.fa
#end if
coordsort.sam
'$output'
Expand Down
14 changes: 7 additions & 7 deletions tool_collections/samtools/samtools_stats/samtools_stats.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="samtools_stats" name="Samtools stats" version="2.0.3" profile="@PROFILE@">
<tool id="samtools_stats" name="Samtools stats" version="2.0.4" profile="@PROFILE@">
<description>generate statistics for BAM dataset</description>
<macros>
<import>macros.xml</import>
Expand Down Expand Up @@ -170,7 +170,7 @@
<param name="addref_select" value="history" />
<param name="ref" value="test.fa" ftype="fasta" />
</conditional>
<output name="output" file="1.stats.expected" ftype="tabular" lines_diff="2" />
<output name="output" file="1.stats.expected" ftype="tabular" lines_diff="4" />
</test>
<!-- test_cmd($opts,out=>'stat/1.stats.expected',cmd=>"$$opts{bin}/samtools stats -r $$opts{path}/stat/test.fa $$opts{path}/stat/1_map_cigar.sam | tail -n+4", exp_fix=>$efix);-->
<test>
Expand All @@ -179,7 +179,7 @@
<param name="addref_select" value="history" />
<param name="ref" value="test.fa" ftype="fasta" />
</conditional>
<output name="output" file="2.stats.expected" ftype="tabular" lines_diff="2" />
<output name="output" file="2.stats.expected" ftype="tabular" lines_diff="4" />
</test>
<!-- test_cmd($opts,out=>'stat/2.stats.expected',cmd=>"$$opts{bin}/samtools stats -r $$opts{path}/stat/test.fa $$opts{path}/stat/2_equal_cigar_full_seq.sam | tail -n+4", exp_fix=>$efix);-->
<!-- test_cmd($opts,out=>'stat/3.stats.expected',cmd=>"$$opts{bin}/samtools stats -r $$opts{path}/stat/test.fa $$opts{path}/stat/3_map_cigar_equal_seq.sam | tail -n+4", exp_fix=>$efix);-->
Expand All @@ -192,7 +192,7 @@
<param name="addref_select" value="history" />
<param name="ref" value="test.fa" ftype="fasta" />
</conditional>
<output name="output" file="6.stats.expected" ftype="tabular" lines_diff="2" />
<output name="output" file="6.stats.expected" ftype="tabular" lines_diff="4" />
</test>
<!-- test_cmd($opts,out=>'stat/6.stats.expected',cmd=>"$$opts{bin}/samtools stats -r $$opts{path}/stat/test.fa -i 0 $$opts{path}/stat/5_insert_cigar.sam | tail -n+4", exp_fix=>$efix); -->
<!-- test_cmd($opts,out=>'stat/7.stats.expected',cmd=>"$$opts{bin}/samtools stats -r $$opts{path}/stat/test.fa $$opts{path}/stat/7_supp.sam | tail -n+4", exp_fix=>$efix); -->
Expand Down Expand Up @@ -223,7 +223,7 @@
<param name="regions_repeat_1|region" value="ref1:30-46"/>
<param name="regions_repeat_2|region" value="ref1:39-56"/>
</conditional>
<output name="output" file="11.stats.expected" ftype="tabular" lines_diff="2" />
<output name="output" file="11.stats.expected" ftype="tabular" lines_diff="4" />
</test>
<!-- test_cmd($opts,out=>'stat/11.stats.expected',cmd=>"$$opts{bin}/samtools stats $$opts{path}/stat/11_target.bam ref1:10-24 ref1:30-46 ref1:39-56 | tail -n+4", exp_fix=>$efix);
-->
Expand Down Expand Up @@ -252,7 +252,7 @@
<param name="regions_repeat_2|region" value="ref1:39-56"/>
</conditional>
<param name="cov_threshold" value="4" />
<output name="output" file="11.stats.g4.expected" ftype="tabular" lines_diff="2" />
<output name="output" file="11.stats.g4.expected" ftype="tabular" lines_diff="4" />
</test>
<!-- test_cmd($opts,out=>'stat/11.stats.g4.expected',cmd=>"$$opts{bin}/samtools stats -g 4 $$opts{path}/stat/11_target.bam ref1:10-24 ref1:30-46 ref1:39-56 | tail -n+4", exp_fix=>$efix); -->
<test>
Expand Down Expand Up @@ -311,7 +311,7 @@
<param name="addref_select" value="history" />
<param name="ref" value="samtools_stats_ref.fa" ftype="fasta" />
</conditional>
<output name="output" file="samtools_stats_out1.tab" ftype="tabular" lines_diff="2" />
<output name="output" file="samtools_stats_out1.tab" ftype="tabular" lines_diff="4" />
</test>
<test>
<param name="input" value="samtools_stats_input.bam" ftype="bam" />
Expand Down

0 comments on commit 84db51c

Please sign in to comment.