/
bed_gff_or_vcf_to_bigwig_converter.xml
43 lines (37 loc) · 1.49 KB
/
bed_gff_or_vcf_to_bigwig_converter.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<tool id="CONVERTER_bed_gff_or_vcf_to_bigwig_0" name="Convert BED, GFF, or VCF to BigWig" version="1.0.1" hidden="true">
<!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
<requirements>
<requirement type="package" version="357">ucsc-bedgraphtobigwig</requirement>
<requirement type="package" version="2.27.1">bedtools</requirement>
</requirements>
<command>
<![CDATA[
## Remove comments and sort by chromosome. Remove anything after ##FASTA in gff files.
#if $input.is_of_type("gff"):
sed -e '/^\#\#FASTA$/,\$d' '$input' | grep -v '^#' |
#else:
grep -v '^#' '$input' |
#end if
sort -k1,1 |
## Generate coverage bedgraph.
bedtools genomecov -bg -i stdin -g '$chromInfo'
## Only use split option for bed and gff/gff3/gtf.
#if $input.ext in [ 'bed', 'gff', 'gff3', 'gtf' ]:
-split
#end if
## Streaming the bedgraph file to wigToBigWig is fast but very memory intensive; hence, this
## should only be used on systems with large RAM.
## | wigToBigWig stdin '$chromInfo' '$output'
## This can be used anywhere.
> temp.bg && bedGraphToBigWig temp.bg '$chromInfo' '$output'
]]>
</command>
<inputs>
<param format="bed,gff,vcf" name="input" type="data" label="Choose input file"/>
</inputs>
<outputs>
<data format="bigwig" name="output"/>
</outputs>
<help>
</help>
</tool>