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