Skip to content

Commit

Permalink
Merge pull request #1342 from SaimMomin12/4.0.0
Browse files Browse the repository at this point in the history
Fixing issue for some Galaxy tools reported for failed linting and tests
  • Loading branch information
WardDeb authored Nov 27, 2024
2 parents 3572061 + 08f477c commit 4e35caa
Show file tree
Hide file tree
Showing 17 changed files with 432 additions and 470 deletions.
73 changes: 34 additions & 39 deletions galaxy/wrapper/alignmentSieve.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<token name="@BINARY@">alignmentSieve</token>
<import>deepTools_macros.xml</import>
</macros>
<expand macro="requirements" />
<expand macro="requirements"/>
<command>
<![CDATA[
#import re
Expand All @@ -15,13 +15,10 @@
#else:
ln -s '${bamfile.metadata.cram_index}' one.bam.crai &&
#end if
@BINARY@
@THREADS@
-b one.bam
--label '$label'
#if str($filterRNAstrand) != 'no':
--filterRNAstrand '$filterRNAstrand'
#end if
Expand Down Expand Up @@ -86,9 +83,8 @@
</command>

<inputs>
<param name="bamfile" format="bam,cram" type="data" label="BAM file" />
<param name="BED" argument="--BED" type="boolean" label="Output in BEDPE format?"
help="Instead of producing BAM files, write output in BEDPE format (as defined by MACS2). Note that only reads/fragments passing filtering criterion are written in BEDPE format." />
<param name="bamfile" format="bam,cram" type="data" label="BAM file"/>
<param argument="--BED" type="boolean" label="Output in BEDPE format?" help="Instead of producing BAM files, write output in BEDPE format (as defined by MACS2). Note that only reads/fragments passing filtering criterion are written in BEDPE format."/>
<param argument="--shift" type="text" label="Amount to shift fragments" value=""
help="Shift the left and right end of a fragment. A positive
value shift an end to the right (on the + strand) and
Expand All @@ -101,7 +97,7 @@
right, respectively. Consequently, it is possible to
take strand into consideration for strand-specific
protocols. Note that only properly paired reads are considered."/>
<param argument="--ATACshift" type="boolean" label="Shift fragment ends as appropriate for ATAC-seq" />
<param argument="--ATACshift" type="boolean" label="Shift fragment ends as appropriate for ATAC-seq"/>
<param argument="filterRNAstrand" type="select" label="Only include reads originating from fragments from the forward or reverse strand."
help="By default (the no option), all reads are processed, regardless of the strand they originated from. For RNAseq, it can be useful to separately create bigWig files for the forward or reverse strands.
Note that this tools assumes that a dUTP-based method was used, so fragments will be assigned to the reverse strand if the second read in a pair is reverse complemented.">
Expand All @@ -110,13 +106,13 @@
<option value="reverse">reverse</option>
</param>

<expand macro="ignoreDuplicates" />
<expand macro="minMappingQuality" />
<expand macro="samFlags" />
<expand macro="fragLength" />
<expand macro="blacklist" />
<param argument="--filterMetrics" type="boolean" label="Save the total number of reads seen and remaining after filtering to a text file?" help="" />
<param argument="--filteredOutReads" type="boolean" label="Save alignments NOT passing the filtering criteria?" help="" />
<expand macro="ignoreDuplicates"/>
<expand macro="minMappingQuality"/>
<expand macro="samFlags"/>
<expand macro="fragLength"/>
<expand macro="blacklist"/>
<param argument="--filterMetrics" type="boolean" label="Save the total number of reads seen and remaining after filtering to a text file?"/>
<param argument="--filteredOutReads" type="boolean" label="Save alignments NOT passing the filtering criteria?"/>
</inputs>
<outputs>
<data format="tabular" name="filterMetricsFile" label="${tool.name} on ${on_string}: filtering metrics">
Expand All @@ -132,34 +128,33 @@
</data>
</outputs>
<tests>
<test>
<param name="bamfile" value="paired_chr2L.bam" ftype="bam" />
<param name="minMappingQuality" value="10" />
<param name="filterMetrics" value="True" />
<output name="outFile" file="alignmentSieve.bam" ftype="bam" lines_diff="1" />
<output name="filterMetricsFile" file="alignmentSieve.txt" ftype="tabular" />
<test expect_num_outputs="2">
<param name="bamfile" value="paired_chr2L.bam" ftype="bam"/>
<param name="minMappingQuality" value="10"/>
<param name="filterMetrics" value="True"/>
<output name="outFile" file="alignmentSieve.bam" ftype="bam" lines_diff="1"/>
<output name="filterMetricsFile" file="alignmentSieve.txt" ftype="tabular"/>
</test>
<test>
<param name="bamfile" value="paired_chr2L.bam" ftype="bam" />
<param name="minMappingQuality" value="10" />
<param name="BED" value="yes" />
<param name="shift" value="1 -2 3 -4" />
<output name="outFile" file="alignmentSieve.bed" ftype="bed" />
<test expect_num_outputs="1">
<param name="bamfile" value="paired_chr2L.bam" ftype="bam"/>
<param name="minMappingQuality" value="10"/>
<param name="BED" value="yes"/>
<param name="shift" value="1 -2 3 -4"/>
<output name="outFile" file="alignmentSieve.bed" ftype="bed"/>
</test>
<test>
<param name="bamfile" value="paired_chr2L.bam" ftype="bam" />
<param name="minMappingQuality" value="10" />
<param name="shift" value="1 -2 3 -4" />
<output name="outFile" file="alignmentSieve2.bam" ftype="bam" lines_diff="2" />
<test expect_num_outputs="1">
<param name="bamfile" value="paired_chr2L.bam" ftype="bam"/>
<param name="minMappingQuality" value="10"/>
<param name="shift" value="1 -2 3 -4"/>
<output name="outFile" file="alignmentSieve2.bam" ftype="bam" lines_diff="2"/>
</test>
<test>
<param name="bamfile" value="paired_chr2L.cram" ftype="cram" />
<param name="minMappingQuality" value="10" />
<param name="shift" value="1 -2 3 -4" />
<output name="outFile" file="alignmentSieve3.bam" ftype="bam" lines_diff="2" />
<test expect_num_outputs="1">
<param name="bamfile" value="paired_chr2L.cram" ftype="cram"/>
<param name="minMappingQuality" value="10"/>
<param name="shift" value="1 -2 3 -4"/>
<output name="outFile" file="alignmentSieve3.bam" ftype="bam" lines_diff="2"/>
</test>
</tests>

<help>
<![CDATA[
Expand Down Expand Up @@ -212,5 +207,5 @@ As can be seen, such fragments are considered to be on the ``-`` strand, so nega
@REFERENCES@
]]>
</help>
<expand macro="citations" />
<expand macro="citations"/>
</tool>
95 changes: 45 additions & 50 deletions galaxy/wrapper/bamCompare.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<token name="@BINARY@">bamCompare</token>
<import>deepTools_macros.xml</import>
</macros>
<expand macro="requirements" />
<expand macro="requirements"/>
<command>
<![CDATA[
ln -s '$bamFile1' one.bam &&
Expand Down Expand Up @@ -74,16 +74,12 @@
]]>
</command>
<inputs>
<param argument="--bamFile1" format="bam,cram" type="data" label="First BAM/CRAM file (e.g. treated sample)"
help=""/>
<param argument="--bamFile2" format="bam,cram" type="data" label="Second BAM/CRAM file (e.g. control sample)"
help=""/>

<param argument="--bamFile1" format="bam,cram" type="data" label="First BAM/CRAM file (e.g. treated sample)"/>
<param argument="--bamFile2" format="bam,cram" type="data" label="Second BAM/CRAM file (e.g. control sample)"/>
<param argument="--binSize" type="integer" value="50" min="1"
label="Bin size in bases"
help="The genome will be divided into bins of the specified size. For each bin, the overlapping number of fragments (or reads) will be reported.
If only half a fragment overlaps then this fraction will be reported."/>

<conditional name="scaling">
<param name="method" type="select"
label="Method to use for scaling the largest sample to the smallest">
Expand All @@ -95,14 +91,13 @@
<when value="SES">
<param argument="--sampleLength" type="integer" value="1000" min="10"
label="Length in bases used to sample the genome and compute the size or scaling factors."
help="The default is fine. Only change it if you know what you are doing." />
help="The default is fine. Only change it if you know what you are doing."/>
<param argument="--numberOfSamples" type="integer" value="100000" min="0"
label="Number of samplings taken from the genome to compute the scaling factors"
help="" />
label="Number of samplings taken from the genome to compute the scaling factors"/>
</when>
<when value="readCount" />
<when value="readCount"/>
<when value="own">
<expand macro="scaleFactors" />
<expand macro="scaleFactors"/>
</when>
<when value="None">
<param name="type" type="select" label="Normalization method" >
Expand Down Expand Up @@ -132,78 +127,78 @@
<option value="second">Returns the scaled value of the second BAM file</option>
</param>
<when value="log2">
<expand macro="pseudocount" />
<expand macro="pseudocount"/>
</when>
<when value="ratio">
<expand macro="pseudocount" />
<expand macro="pseudocount"/>
</when>
<when value="add" />
<when value="subtract" />
<when value="mean" />
<when value="first" />
<when value="second" />
<when value="add"/>
<when value="subtract"/>
<when value="mean"/>
<when value="first"/>
<when value="second"/>
<when value="reciprocal_ratio">
<expand macro="pseudocount" />
<expand macro="pseudocount"/>
</when>
</conditional>

<expand macro="exactScaling" />
<expand macro="exactScaling"/>
<param name="outFileFormat" type="select" label="Coverage file format">
<option value="bigwig" selected="true">bigwig</option>
<option value="bedgraph">bedgraph</option>
</param>
<expand macro="region_limit_operation" />
<expand macro="region_limit_operation"/>
<conditional name="advancedOpt">
<param name="showAdvancedOpt" type="select" label="Show advanced options" >
<option value="no" selected="true">no</option>
<option value="yes">yes</option>
</param>
<when value="no" />
<when value="no"/>
<when value="yes">
<expand macro="smoothLength" />
<expand macro="read_processing_options" />
<expand macro="smoothLength"/>
<expand macro="read_processing_options"/>

<expand macro="skipNAs" />
<expand macro="skipZeroOverZero" />
<expand macro="skipNAs"/>
<expand macro="skipZeroOverZero"/>

<param argument="--ignoreForNormalization" type="text" value="" size="50"
label="regions that should be excluded for calculating the scaling factor"
help="Sometimes it makes sense to exclude certain regions when calculating the scaling factor.
For example, if you know of copy number variations between samples then you may want to exclude these.
Another typical example is the difference in chromosome X copies between males and females in many species.
Example inputs are chrX,chrY,chr3 or chr10:12220-128932" />
<expand macro="blacklist" />
Example inputs are chrX,chrY,chr3 or chr10:12220-128932"/>
<expand macro="blacklist"/>
</when>
</conditional>
</inputs>
<outputs>
<data format="bigwig" name="outFileName">
<change_format>
<when input="outFileFormat" value="bigwig" format="bigwig" />
<when input="outFileFormat" value="bedgraph" format="bedgraph" />
<when input="outFileFormat" value="bigwig" format="bigwig"/>
<when input="outFileFormat" value="bedgraph" format="bedgraph"/>
</change_format>
</data>
</outputs>
<tests>
<test>
<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" />
<output name="outFileName" file="bamCompare_result1.bg" ftype="bedgraph" />
<test expect_num_outputs="1">
<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"/>
<output name="outFileName" file="bamCompare_result1.bg" ftype="bedgraph"/>
</test>
<test>
<param name="bamFile1" value="bowtie2 test1.bam" ftype="bam" />
<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 expect_num_outputs="1">
<param name="bamFile1" value="bowtie2 test1.bam" ftype="bam"/>
<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>
</tests>
<help>
Expand Down Expand Up @@ -248,5 +243,5 @@ Like BAM files, bigWig files are compressed, binary files. If you would like to
@REFERENCES@
]]>
</help>
<expand macro="citations" />
<expand macro="citations"/>
</tool>
Loading

0 comments on commit 4e35caa

Please sign in to comment.