annotate bbgbigwig/bam_bed_gff_to_bigwig.xml @ 0:4eadb56fa314 draft

Uploaded
author fubar
date Fri, 14 Jun 2024 06:06:45 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
1 <tool id="bbgtobigwig" name="Convert BAM/BED/GFF to BigWig" version="0.1" profile="22.05">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
2 <requirements>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
3 <requirement type="package" version="455">ucsc-bedgraphtobigwig</requirement>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
4 <requirement type="package" version="2.31.1">bedtools</requirement>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
5 <requirement type="package" version="9.5">coreutils</requirement>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
6 <requirement type="package" version="3.12.3">python</requirement>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
7 </requirements>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
8 <required_files>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
9 <include path="gff_to_bed_converter.py"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
10 </required_files>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
11 <command detect_errors="aggressive"><![CDATA[
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
12 #if $hist_or_builtin.genosrc == "indexed":
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
13 ln -s '$hist_or_builtin.chromfile.fields.len_path' ./CHROMFILE &&
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
14 #else:
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
15 ln -s '$chromfile' ./CHROMFILE &&
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
16 #end if
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
17 #if $input1.ext in ['gff', 'gff3']:
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
18 python '$__tool_directory__/gff_to_bed_converter.py' < '$input1' > input2 &&
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
19 #else:
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
20 ln -s '$input1' input2 &&
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
21 #end if
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
22 #if $input1.ext == "bam":
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
23 bedtools genomecov -bg -split -ibam input2 |
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
24 #else
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
25 bedtools genomecov -bg -i input2 -g ./CHROMFILE |
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
26 #end if
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
27 LC_COLLATE=C sort -k1,1 -k2,2n > temp.bg &&
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
28 bedGraphToBigWig temp.bg ./CHROMFILE '$output'
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
29 ]]></command>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
30 <inputs>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
31 <conditional name="hist_or_builtin">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
32 <param name="genosrc" type="select" label="Is the input assigned to a built-in or custom reference genome?"
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
33 help="If the input has no dbkey, supply a chromosome lengths file">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
34 <option selected="True" value="indexed">Input data was made with a built-in genome or already has a custom genome dbkey</option>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
35 <option value="history">Input data mapped on a genome from the current history. The chromosome lengths file is also in the history</option>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
36 </param>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
37 <when value="indexed">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
38 <param name="input1" type="data" format="bam,unsorted.bam,bed,gff,gff3" label="bam/bed/gff to convert">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
39 <validator type="unspecified_build" />
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
40 </param>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
41 <param name="chromfile" type="select" label="Source Genome Build">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
42 <options from_data_table="__dbkeys__">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
43 <filter type="data_meta" column="0" key="dbkey" ref="input1"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
44 </options>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
45 <validator type="no_options" message="The chosen genome build is not available."/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
46 </param>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
47 </when>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
48 <when value="history">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
49 <param name="input1" type="data" format="bam,unsorted.bam,bed,gff,gff3" label="bam/bed/gff to convert"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
50 <param name="chromfile" type="data" format="len,txt,tabular" label="Chromosome length file"
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
51 help="Sequence lengths for the history reference are required to make a bigwig. Compute sequence length tool makes these from fasta files"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
52 </when>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
53 </conditional>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
54 </inputs>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
55 <outputs>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
56 <data name="output" format="bigwig"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
57 </outputs>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
58 <tests>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
59 <test expect_num_outputs="1">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
60 <conditional name="hist_or_builtin">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
61 <param name="genosrc" value="indexed"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
62 <param name="input1" value="featureCounts_input1.bam" dbkey="hg38"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
63 <param name="chromfile" value="hg38"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
64 </conditional>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
65 <output name="output" value="featureCounts_input1.bigwig" compare="sim_size"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
66 </test>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
67 <test expect_num_outputs="1">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
68 <conditional name="hist_or_builtin">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
69 <param name="genosrc" value="history"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
70 <param name="input1" value="srma_out2.bam"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
71 <param name="chromfile" value="testing.len"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
72 </conditional>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
73 <output name="output" value="srma_out2.bigwig" compare="sim_size"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
74 </test>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
75 <test expect_num_outputs="1">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
76 <conditional name="hist_or_builtin">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
77 <param name="genosrc" value="history"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
78 <param name="input1" value="test5.gff3"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
79 <param name="chromfile" value="testing.len"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
80 </conditional>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
81 <output name="output" value="test5.gff.bigwig" compare="sim_size"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
82 </test>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
83 <test expect_num_outputs="1">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
84 <conditional name="hist_or_builtin">
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
85 <param name="genosrc" value="history"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
86 <param name="input1" value="test5.bed"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
87 <param name="chromfile" value="testing.len"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
88 </conditional>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
89 <output name="output" value="test5.bed.bigwig" compare="sim_size"/>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
90 </test>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
91 </tests>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
92 <help>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
93
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
94 Converter for bam, bed or gff to bigwig
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
95 If the input does not have a dbkey, a chromosome lengths file is needed.
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
96 This can be useful in workflows with assemblies in progress before a stable reference is available for
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
97 a custom or built in reference dbkey.
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
98
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
99 </help>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
100 <citations>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
101 <citation type="doi">10.1093/bioinformatics/btq351</citation>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
102 </citations>
4eadb56fa314 Uploaded
fubar
parents:
diff changeset
103 </tool>