Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronizing Planemo test with Pytests for bamCompare and bamCoverage tool #1366

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 82 additions & 3 deletions galaxy/wrapper/bamCompare.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
<param name="bamFile1" value="bowtie2 test1.bam" ftype="bam"/>
<param name="bamFile2" value="bowtie2 test1.bam" ftype="bam"/>
<param name="showAdvancedOpt" value="no"/>
<param name="outFileFormat" value="bigwig"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="binSize" value="5"/>
<param name="type" value="ratio"/>
Expand All @@ -195,11 +194,91 @@
<param name="bamFile2" value="bowtie2 test1.bam" ftype="bam"/>
<param name="showAdvancedOpt" value="yes"/>
<param name="outFileFormat" value="bigwig"/>
<param name="outFileFormat" value="bigwig"/>
<param name="binSize" value="10"/>
<param name="type" value="ratio"/>
<output name="outFileName" file="bamCompare_result2.bw" ftype="bigwig"/>
</test>
<!-- Test with BAM and CRAM file as input-->
<test expect_num_outputs="1">
<param name="bamFile1" value="testA.bam" ftype="bam"/>
<param name="bamFile2" value="testA.cram" ftype="cram"/>
<param name="showAdvancedOpt" value="yes"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="binSize" value="10"/>
<param name="type" value="ratio"/>
<output name="outFileName" ftype="bedgraph">
<assert_contents>
<has_text_matching expression="3R\t0\t200\t1"/>
<has_text_matching expression="chr_cigar\t0\t200\t1"/>
</assert_contents>
</output>
</test>
<!-- Test with BAM and CRAM files and substract option-->
<test expect_num_outputs="1">
<param name="bamFile1" value="testA.bam" ftype="bam"/>
<param name="bamFile2" value="testA.cram" ftype="cram"/>
<param name="showAdvancedOpt" value="yes"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="binSize" value="10"/>
<param name="type" value="substract"/>
<output name="outFileName" ftype="bedgraph">
<assert_contents>
<has_text_matching expression="3R\t0\t200\t0"/>
<has_text_matching expression="chr_cigar\t0\t200\t0"/>
</assert_contents>
</output>
</test>
<!-- Test with BAM files with pseudocounts-->
<test expect_num_outputs="1">
<param name="bamFile1" value="testA.bam" ftype="bam"/>
<param name="bamFile2" value="testB.bam" ftype="bam"/>
<param name="showAdvancedOpt" value="yes"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="binSize" value="10"/>
<param name="type" value="ratio"/>
<param name="pseudocount" value="1 1"/>
<output name="outFileName" ftype="bedgraph">
<assert_contents>
<has_text_matching expression="3R\t0\t50\t1"/>
<has_text_matching expression="3R\t50\t100\t0.571429"/>
<has_text_matching expression="3R\t100\t150\t1.14286"/>
<has_text_matching expression="3R\t150\t200\t0.8"/>
</assert_contents>
</output>
</test>
<!-- Test with BAM files with skipZeroOverZero -->
<test expect_num_outputs="1">
<param name="bamFile1" value="testA.bam" ftype="bam"/>
<param name="bamFile2" value="testB.bam" ftype="bam"/>
<param name="showAdvancedOpt" value="yes"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="binSize" value="10"/>
<param name="type" value="ratio"/>
<param name="skipZeroOverZero" value="--skipZeroOverZero"/>
<output name="outFileName" ftype="bedgraph">
<assert_contents>
<has_text_matching expression="3R\t50\t100\t0.571429"/>
<has_text_matching expression="3R\t100\t150\t1.14286"/>
<has_text_matching expression="3R\t150\t200\t0.8"/>
</assert_contents>
</output>
</test>
<!-- Test with BAM files with skipNAs -->
<test expect_num_outputs="1">
<param name="bamFile1" value="testA.bam" ftype="bam"/>
<param name="bamFile2" value="testB.bam" ftype="bam"/>
<param name="showAdvancedOpt" value="yes"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="binSize" value="10"/>
<param name="type" value="ratio"/>
<param name="skipNAs" value="true"/>
<output name="outFileName" ftype="bedgraph">
<assert_contents>
<has_text_matching expression="3R\t100\t150\t1.14286"/>
<has_text_matching expression="3R\t150\t200\t0.8"/>
</assert_contents>
</output>
</test>
</tests>
<help>
<![CDATA[
Expand Down Expand Up @@ -244,4 +323,4 @@ Like BAM files, bigWig files are compressed, binary files. If you would like to
]]>
</help>
<expand macro="citations"/>
</tool>
</tool>
47 changes: 46 additions & 1 deletion galaxy/wrapper/bamCoverage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,39 @@
</data>
</outputs>
<tests>
<!-- Test minimal arguments for bamCoverage-->
<test expect_num_outputs="1">
<param name="bamInput" value="testA.bam" ftype="bam"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="showAdvancedOpt" value="no"/>
<param name="type" value="no"/>
<output name="outFileName" ftype="bedgraph">
<assert_contents>
<has_text_matching expression="3R\t0\t100\t0"/>
<has_text_matching expression="3R\t100\t200\t1"/>
<has_text_matching expression="chr_cigar\t0\t50\t1"/>
<has_text_matching expression="chr_cigar\t50\t200\t0"/>
</assert_contents>
</output>
</test>

<!-- Test skipNAs for bamCoverage-->
<test expect_num_outputs="1">
<param name="bamInput" value="testA.bam" ftype="bam"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="showAdvancedOpt" value="no"/>
<param name="type" value="no"/>
<param name="skipNAs" value="true"/>
<output name="outFileName" ftype="bedgraph">
<assert_contents>
<has_text_matching expression="3R\t0\t100\t0"/>
<has_text_matching expression="3R\t100\t200\t1"/>
<has_text_matching expression="chr_cigar\t0\t50\t1"/>
<has_text_matching expression="chr_cigar\t50\t200\t0"/>
</assert_contents>
</output>
</test>

<test expect_num_outputs="1">
<param name="bamInput" value="bowtie2 test1.bam" ftype="bam"/>
<param name="outFileFormat" value="bigwig"/>
Expand Down Expand Up @@ -223,6 +256,18 @@
<param name="type" value="no"/>
<output name="outFileName" file="bamCoverage_result6.bw" ftype="bigwig"/>
</test>

<!-- Test bamCoverage with filter blacklist-->
<test expect_num_outputs="1">
<param name="bamInput" value="coverage_filtering.bam" ftype="bam"/>
<param name="blackListFileName" value="coverage_filtering.blacklist.bed"/>
<param name="outFileFormat" value="bedgraph"/>
<param name="showAdvancedOpt" value="yes"/>
<param name="type" value="1x"/>
<param name="effectiveGenomeSize_opt" value="specific"/>
<param name="effectiveGenomeSize" value="1400"/>
<output name="outFileName" file="coverage_filtered.bg" ftype="bedgraph"></output>
</test>
</tests>
<help>
<![CDATA[
Expand Down Expand Up @@ -281,4 +326,4 @@ WARNING: If you already normalized for GC bias using ``correctGCbias``, you shou
]]>
</help>
<expand macro="citations"/>
</tool>
</tool>
2 changes: 1 addition & 1 deletion galaxy/wrapper/deepTools_macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<token name="@GALAXY_VERSION@">23.2</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">deeptools</requirement>
<!-- <requirement type="package" version="@TOOL_VERSION@">deeptools</requirement> -->
<requirement type="package" version="1.21">samtools</requirement>
</requirements>
<expand macro="stdio"/>
Expand Down
19 changes: 19 additions & 0 deletions galaxy/wrapper/test-data/coverage_filtered.bg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
3R 0 50 0.295172
3R 50 100 0.885515
3R 100 150 2.21379
3R 150 250 4.87034
3R 250 300 3.0993
3R 300 350 2.36137
3R 350 400 2.21379
3R 400 450 3.54206
3R 450 500 4.13241
3R 500 550 2.0662
3R 550 600 2.50896
3R 600 650 4.57516
3R 650 700 3.24689
3R 700 750 3.39448
3R 750 800 3.83723
3R 900 950 1.91862
3R 950 1000 1.32827
3R 1000 1050 0.73793
3R 1050 1500 0
Binary file added galaxy/wrapper/test-data/coverage_filtering.bam
Binary file not shown.
1 change: 1 addition & 0 deletions galaxy/wrapper/test-data/coverage_filtering.blacklist.bed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3R 800 900
Binary file added galaxy/wrapper/test-data/testA.bam
Binary file not shown.
Binary file added galaxy/wrapper/test-data/testA.cram
Binary file not shown.
Binary file added galaxy/wrapper/test-data/testB.bam
Binary file not shown.
Binary file added galaxy/wrapper/test-data/testB.cram
Binary file not shown.
Loading