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