comparison twobit_mask.xml @ 0:fb318f9a36f3 draft default tip

planemo upload commit c1f0c5ceaac87b6b1db12160a8f5b287635db61b
author yating-l
date Thu, 01 Jun 2017 14:10:35 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:fb318f9a36f3
1 <?xml version="1.0"?>
2 <tool id="twobit_mask" name="twoBitMask" version="1.0">
3 <description>Apply repeat masking to a twoBit file</description>
4
5 <macros>
6 <import>ucsc_macros.xml</import>
7 </macros>
8
9 <expand macro="requirements_twobit" />
10
11 <command detect_errors="exit_code">
12 <![CDATA[
13 #if str($maskfile_type.maskfile_type_selector) == "out":
14 ## twoBitMask expects the first column of the RepeatMasker header to
15 ## contain only three leading spaces. RepeatMasker output with large
16 ## SW scores could contain more leading spaces.
17
18 awk '{ sub(/^\s+SW/, " SW"); print }' "${out_maskfile}" |
19 twoBitMask
20 ${add_mask}
21 -type=.out
22 "${twobit_input}" stdin "${twobit_output}"
23 #else:
24 ## The BED Output from TRF is in bed4+ format, but twoBitMask
25 ## only uses the first three fields of a BED file.
26 ## The extra columns result in a warning from twoBitMask
27
28 awk 'BEGIN { OFS="\t" } { print $1, $2, $3 }' "${bed_maskfile}" |
29 twoBitMask
30 ${add_mask}
31 -type=.bed
32 "${twobit_input}" stdin "${twobit_output}"
33 #end if
34 ]]>
35 </command>
36 <inputs>
37 <param name="twobit_input" type="data" format="twobit" label="twoBit input file" />
38
39 <param name="add_mask" type="boolean" checked="true"
40 truevalue="-add" falsevalue=""
41 label="Keep pre-existing masking"
42 help="-add" />
43
44 <conditional name="maskfile_type">
45 <param name="maskfile_type_selector" type="select"
46 label="Choose the type of mask file"
47 help="Mask file can be a RepeatMasker .out file or a BED file">
48 <option value="out">RepeatMasker .out file</option>
49 <option value="bed" selected="true">BED file</option>
50 </param>
51
52 <when value="out">
53 <param name="out_maskfile" type="data" format="txt"
54 label="Mask file in RepeatMasker .out format" />
55 </when>
56
57 <when value="bed">
58 <param name="bed_maskfile" type="data" format="bed"
59 label="Mask file in BED format" />
60 </when>
61 </conditional>
62 </inputs>
63 <outputs>
64 <data name="twobit_output" format="twobit" />
65 </outputs>
66 <tests>
67 <test>
68 <!-- Test standard RepeatMasker .out file -->
69 <param name="twobit_input" value="contig1.2bit" ftype="twobit" />
70 <param name="maskfile_type_selector" value="out" />
71 <param name="out_maskfile" value="contig1.fasta.out" />
72 <output name="twobit_output" file="contig1.out.2bit" />
73 </test>
74 <test>
75 <!-- Test RepeatMasker .out file with extra space in header -->
76 <param name="twobit_input" value="contig1.2bit" ftype="twobit" />
77 <param name="maskfile_type_selector" value="out" />
78 <param name="out_maskfile" value="contig1.fasta.extraspace.out" />
79 <output name="twobit_output" file="contig1.out.2bit" />
80 </test>
81 <test>
82 <!-- Test TRF .bed output -->
83 <param name="twobit_input" value="contig1.2bit" ftype="twobit" />
84 <param name="maskfile_type_selector" value="bed" />
85 <param name="bed_maskfile" value="contig1.fasta.bed" ftype="bed" />
86 <output name="twobit_output" file="contig1.bed.2bit" />
87 </test>
88 <test>
89 <!-- Test keep pre-existing masking -->
90 <param name="twobit_input" value="contig1.bed.2bit" ftype="twobit" />
91 <param name="maskfile_type_selector" value="out" />
92 <param name="out_maskfile" value="contig1.fasta.out" />
93 <output name="twobit_output" file="contig1.both.2bit" />
94 </test>
95 <test>
96 <!-- Test ignore pre-existing masking -->
97 <param name="twobit_input" value="contig1.bed.2bit" ftype="twobit" />
98 <param name="maskfile_type_selector" value="out" />
99 <param name="out_maskfile" value="contig1.fasta.out" />
100 <param name="add_mask" value="" />
101 <output name="twobit_output" file="contig1.out.2bit" />
102 </test>
103 </tests>
104 <help>
105 <![CDATA[
106 **What it does**
107
108 twoBitMask applies a mask to a twoBit file based on repeat information
109 from a `RepeatMasker <http://www.repeatmasker.org/>`_ .out file or
110 a BED file (e.g., from
111 `Tandem Repeats Finder <https://tandem.bu.edu/trf/trf.html>`_).
112
113 ]]></help>
114
115 <expand macro="citations" />
116 </tool>