Skip to content

Commit

Permalink
add expect_num_outputs and reformat all tools
Browse files Browse the repository at this point in the history
  • Loading branch information
bgruening committed Mar 6, 2024
1 parent 0449e4b commit f2839f2
Show file tree
Hide file tree
Showing 21 changed files with 338 additions and 567 deletions.
31 changes: 10 additions & 21 deletions tools/rseqc/FPKM_count.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@
<macros>
<import>rseqc_macros.xml</import>
</macros>

<expand macro="bio_tools"/>

<expand macro="requirements" />

<expand macro="stdio" />

<expand macro="requirements"/>
<expand macro="stdio"/>
<version_command><![CDATA[FPKM_count.py --version]]></version_command>

<command><![CDATA[
@BAM_SAM_INPUTS@
FPKM_count.py -i 'input.${extension}' -o output -r '${refgene}'
Expand All @@ -36,31 +31,28 @@
--single-read="${singleread}"
]]>
</command>

<inputs>
<expand macro="bam_param" />
<expand macro="refgene_param" />
<expand macro="strand_type_param" />
<expand macro="multihits_param" />
<expand macro="bam_param"/>
<expand macro="refgene_param"/>
<expand macro="strand_type_param"/>
<expand macro="multihits_param"/>
<param name="onlyexonic" type="boolean" value="false" truevalue="--only-exonic" falsevalue="" label="Only use exonic (UTR exons and CDS exons) reads, otherwise use all reads" help="(--only-exonic)"/>
<param name="singleread" type="select" label="How should read-pairs that only have one end mapped be counted?" help="(--single-read)">
<option value="1" selected="true">Treat it as a whole fragment (1)</option>
<option value="0.5">Treat it as a half fragment (0.5)</option>
<option value="0">Ignore it (0)</option>
</param>
</inputs>

<outputs>
<data format="tabular" name="output" from_work_dir="output.FPKM.xls" label="${tool.name} on ${on_string}: FPKM counts"/>
</outputs>

<tests>
<test>
<test expect_num_outputs="1">
<param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam"/>
<param name="refgene" value="hg19_RefSeq_chr1_1-100000.bed" ftype="bed12"/>
<output name="output" file="output01.tab"/>
</test>
<test>
<test expect_num_outputs="1">
<param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam"/>
<param name="refgene" value="hg19_RefSeq_chr1_1-100000.bed" ftype="bed12"/>
<conditional name="multihits_type">
Expand All @@ -69,11 +61,10 @@
</conditional>
<output name="output" file="output02.tab"/>
<assert_command>
<has_text text="--mapq=20" />
<has_text text="--mapq=20"/>
</assert_command>
</test>
</tests>

<help><![CDATA[
FPKM_count.py
+++++++++++++
Expand Down Expand Up @@ -134,7 +125,5 @@ chr1 32479294 32509482 NM_006559 2891.0 ‘+’ 2151.0
]]>
</help>

<expand macro="citations" />

<expand macro="citations"/>
</tool>
46 changes: 18 additions & 28 deletions tools/rseqc/RNA_fragment_size.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,41 @@
<import>rseqc_macros.xml</import>
</macros>
<expand macro="bio_tools"/>

<expand macro="requirements" />

<expand macro="stdio" />

<expand macro="requirements"/>
<expand macro="stdio"/>
<version_command><![CDATA[RNA_fragment_size.py --version]]></version_command>

<command><![CDATA[
@BAM_SAM_INPUTS@
RNA_fragment_size.py -i 'input.${extension}' --refgene='${refgene}' --mapq=${mapq} --frag-num=${fragnum} > '${output}'
]]>
</command>

<inputs>
<expand macro="bam_param" />
<expand macro="refgene_param" />
<expand macro="mapq_param" />
<param name="fragnum" type="integer" value="3" label="Minimum number of fragments (default: 3)" help="(--frag-num)" />
<expand macro="bam_param"/>
<expand macro="refgene_param"/>
<expand macro="mapq_param"/>
<param name="fragnum" type="integer" value="3" label="Minimum number of fragments (default: 3)" help="(--frag-num)"/>
</inputs>

<outputs>
<data format="tabular" name="output" />
<data format="tabular" name="output"/>
</outputs>

<tests>
<test>
<param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam" />
<test expect_num_outputs="1">
<param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam"/>
<param name="refgene" value="hg19_RefSeq_chr1_1-100000.bed" ftype="bed12"/>
<output name="output">
<assert_contents>
<has_line_matching expression="^chrom\ttx_start\ttx_end\tsymbol\tfrag_count\tfrag_mean\tfrag_median\tfrag_std$" />
<has_line_matching expression="^chr1\t11873\t14409\tNR_046018\t1\t0\t0\t0$" />
<has_line_matching expression="^chr1\t14361\t29370\tNR_024540\t14\t66.5\t51.0\t41.119599080\d+$" />
<has_line_matching expression="^chr1\t17368\t17436\tNR_106918\t0\t0\t0\t0$" />
<has_line_matching expression="^chr1\t17368\t17436\tNR_107062\t0\t0\t0\t0$" />
<has_line_matching expression="^chr1\t34610\t36081\tNR_026818\t0\t0\t0\t0$" />
<has_line_matching expression="^chr1\t34610\t36081\tNR_026820\t0\t0\t0\t0$" />
<has_line_matching expression="^chr1\t69090\t70008\tNM_001005484\t0\t0\t0\t0$" />
<has_line_matching expression="^chrom\ttx_start\ttx_end\tsymbol\tfrag_count\tfrag_mean\tfrag_median\tfrag_std$"/>
<has_line_matching expression="^chr1\t11873\t14409\tNR_046018\t1\t0\t0\t0$"/>
<has_line_matching expression="^chr1\t14361\t29370\tNR_024540\t14\t66.5\t51.0\t41.119599080\d+$"/>
<has_line_matching expression="^chr1\t17368\t17436\tNR_106918\t0\t0\t0\t0$"/>
<has_line_matching expression="^chr1\t17368\t17436\tNR_107062\t0\t0\t0\t0$"/>
<has_line_matching expression="^chr1\t34610\t36081\tNR_026818\t0\t0\t0\t0$"/>
<has_line_matching expression="^chr1\t34610\t36081\tNR_026820\t0\t0\t0\t0$"/>
<has_line_matching expression="^chr1\t69090\t70008\tNM_001005484\t0\t0\t0\t0$"/>
</assert_contents>
</output>
</test>
</tests>

<help><![CDATA[
RNA_fragment_size.py
++++++++++++++++++++
Expand Down Expand Up @@ -80,7 +72,5 @@ Minimum number of fragments
]]>

</help>

<expand macro="citations" />

<expand macro="citations"/>
</tool>
66 changes: 28 additions & 38 deletions tools/rseqc/RPKM_saturation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
<import>rseqc_macros.xml</import>
</macros>
<expand macro="bio_tools"/>

<expand macro="requirements" />

<expand macro="stdio" />

<expand macro="requirements"/>
<expand macro="stdio"/>
<version_command><![CDATA[RPKM_saturation.py --version]]></version_command>

<command><![CDATA[
@BAM_SAM_INPUTS@
RPKM_saturation.py -i 'input.${extension}' -o output -r '${refgene}'
Expand All @@ -36,53 +32,49 @@
-l ${percentileFloor} -u ${percentileCeiling} -s ${percentileStep} -c ${rpkmCutoff}
--mapq $mapq
]]></command>

<inputs>
<expand macro="bam_sam_param" />
<expand macro="refgene_param" />
<expand macro="strand_type_param" />
<expand macro="bam_sam_param"/>
<expand macro="refgene_param"/>
<expand macro="strand_type_param"/>
<param name="percentileFloor" type="integer" value="5" label="Begin sampling from this percentile (default=5)" help="(--percentile-floor)"/>
<param name="percentileCeiling" type="integer" value="100" label="End sampling at this percentile (default=100)" help="(--percentile-ceiling)" />
<param name="percentileStep" type="integer" value="5" label="Sampling step size (default=5)" help="(--percentile-step)" />
<param name="rpkmCutoff" type="text" value="0.01" label="Ignore transcripts with RPKM smaller than this number (default=0.01)" help="(--rpkm-cutoff)" />
<expand macro="mapq_param" />
<expand macro="rscript_output_param" />
<param name="percentileCeiling" type="integer" value="100" label="End sampling at this percentile (default=100)" help="(--percentile-ceiling)"/>
<param name="percentileStep" type="integer" value="5" label="Sampling step size (default=5)" help="(--percentile-step)"/>
<param name="rpkmCutoff" type="text" value="0.01" label="Ignore transcripts with RPKM smaller than this number (default=0.01)" help="(--rpkm-cutoff)"/>
<expand macro="mapq_param"/>
<expand macro="rscript_output_param"/>
</inputs>

<outputs>
<expand macro="pdf_output_data" filename="output.saturation.pdf" />
<expand macro="pdf_output_data" filename="output.saturation.pdf"/>
<data format="tabular" name="outputxls" from_work_dir="output.eRPKM.xls" label="${tool.name} on ${on_string}: RPKM"/>
<data format="tabular" name="outputrawxls" from_work_dir="output.rawCount.xls" label="${tool.name} on ${on_string}: raw count"/>
<expand macro="rscript_output_data" filename="output.saturation.r" />
<expand macro="rscript_output_data" filename="output.saturation.r"/>
</outputs>

<tests>
<test>
<test expect_num_outputs="4">
<param name="input" value="pairend_strandspecific_51mer_hg19_random.bam"/>
<param name="refgene" value="hg19.HouseKeepingGenes_30.bed"/>
<param name="rscript_output" value="true" />
<param name="rscript_output" value="true"/>
<output name="outputxls">
<assert_contents>
<has_n_columns n="26" />
<has_line_matching expression="chr1\t16174358\t16266950\tNM_015001.*" />
</assert_contents>
<assert_contents>
<has_n_columns n="26"/>
<has_line_matching expression="chr1\t16174358\t16266950\tNM_015001.*"/>
</assert_contents>
</output>
<output name="outputrawxls">
<assert_contents>
<has_n_columns n="26" />
<has_line_matching expression="chr1\t16174358\t16266950\tNM_015001.*" />
</assert_contents>
<assert_contents>
<has_n_columns n="26"/>
<has_line_matching expression="chr1\t16174358\t16266950\tNM_015001.*"/>
</assert_contents>
</output>
<output name="outputr">
<assert_contents>
<has_text text="pdf('output.saturation.pdf')" />
<has_line_matching expression="S5=c\(\d+\.\d+\)" />
</assert_contents>
<assert_contents>
<has_text text="pdf('output.saturation.pdf')"/>
<has_line_matching expression="S5=c\(\d+\.\d+\)"/>
</assert_contents>
</output>
<output name="outputpdf" file="output.saturation.pdf" compare="sim_size" />
<output name="outputpdf" file="output.saturation.pdf" compare="sim_size"/>
</test>
</tests>

<help><![CDATA[
RPKM_saturation.py
++++++++++++++++++
Expand Down Expand Up @@ -163,7 +155,5 @@ Output
]]>
</help>

<expand macro="citations" />

<expand macro="citations"/>
</tool>
32 changes: 11 additions & 21 deletions tools/rseqc/bam2wig.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
<tool id="rseqc_bam2wig" name="BAM to Wiggle" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@GALAXY_VERSION@">
<description>
converts all types of RNA-seq data from .bam to .wig
converts all types of RNA-seq data from BAM to Wiggle
</description>
<macros>
<import>rseqc_macros.xml</import>
</macros>

<expand macro="bio_tools"/>

<expand macro="requirements" />

<expand macro="stdio" />

<expand macro="requirements"/>
<expand macro="stdio"/>
<version_command><![CDATA[bam2wig.py --version]]></version_command>

<command><![CDATA[
@BAM_SAM_INPUTS@
bam2wig.py -i 'input.${extension}' -s '${chromsize}' -o outfile
Expand Down Expand Up @@ -44,9 +39,9 @@
]]>
</command>
<inputs>
<expand macro="bam_param" />
<expand macro="bam_param"/>
<param name="chromsize" type="data" label="Chromosome size file (tab or space separated)" format="txt,tabular" help="(--chromSize)"/>
<expand macro="multihits_param" />
<expand macro="multihits_param"/>
<conditional name="wigsum_type">
<param name="wigsum_type_selector" type="select" label="Normalization">
<option value="normalize">Normalize to specified sum</option>
Expand All @@ -57,9 +52,8 @@
</when>
<when value="raw"/>
</conditional>
<expand macro="strand_type_param" />
<expand macro="strand_type_param"/>
</inputs>

<outputs>
<data format="wig" name="output" from_work_dir="outfile.wig">
<filter>strand_type['strand_specific'] == 'none'</filter>
Expand All @@ -71,37 +65,35 @@
<filter>strand_type['strand_specific'] != 'none'</filter>
</data>
</outputs>

<tests>
<test>
<test expect_num_outputs="1">
<param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam"/>
<param name="chromsize" value="hg19.chrom.sizes"/>
<output name="output" file="testwig.wig"/>
</test>
<test>
<test expect_num_outputs="1">
<param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam"/>
<param name="chromsize" value="hg19.chrom.sizes"/>
<param name="multihits_type_selector" value="skip_multihits"/>
<param name="mapq" value="20"/>
<output name="output" file="testwig.wig"/>
</test>
<test>
<test expect_num_outputs="2">
<param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam"/>
<param name="chromsize" value="hg19.chrom.sizes"/>
<param name="strand_specific" value="pair"/>
<param name="pair_type" value="sd"/>
<output name="outputfwd" file="testwig.Forward.wig"/>
<output name="outputrv" file="testwig.Reverse.wig"/>
</test>
<test>
<test expect_num_outputs="1">
<param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam"/>
<param name="chromsize" value="hg19.chrom.sizes"/>
<param name="wigsum_type_selector" value="normalize"/>
<param name="totalwig" value="100"/>
<output name="output" file="testwig_wigsum100.wig"/>
</test>
</tests>

<help><![CDATA[
bam2wig.py
++++++++++
Expand Down Expand Up @@ -149,7 +141,5 @@ is strand specific, two wig files corresponding to Forward and Reverse will be g
.. _bigwig: http://genome.ucsc.edu/FAQ/FAQformat.html#format6.1
]]>
</help>

<expand macro="citations" />

<expand macro="citations"/>
</tool>
Loading

0 comments on commit f2839f2

Please sign in to comment.