annotate find_in_reference.xml @ 1:e83e0ce8fb68

Add option to reverse the search, find reference field in input field
author Jim Johnson <jj@umn.edu>
date Wed, 13 Aug 2014 15:01:33 -0500
parents e7e56b51d156
children c4fd2ea4f988
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
1 <?xml version="1.0"?>
1
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
2 <tool id="find_in_reference" name="find in reference" version="0.0.2">
0
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
3 <description>filter peptides that are present in proteins</description>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
4 <command interpreter="python">find_in_reference.py --input "$input"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
5 --reference "$reference"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
6 #if $column.set == 'yes':
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
7 --input_column $column.input_column
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
8 --reference_column $column.reference_column
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
9 #end if
1
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
10 $case_insensitive $reverse_find
0
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
11 #if 'novel' in $outputs.__str__ or not 'found' in $outputs.__str__:
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
12 --output "$novel"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
13 #end if
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
14 #if 'found' in $outputs.__str__:
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
15 --filtered "$found"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
16 #if $annotate.from_ref == 'yes' and str($annotate.annotation_columns) != 'None':
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
17 --annotation_columns $annotate.annotation_columns
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
18 #if $annotate.annotation_separator != '':
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
19 --annotation_separator '$annotate.annotation_separator'
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
20 #end if
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
21 #if $annotate.annotation_col_sep != '':
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
22 --annotation_col_sep '$annotate.annotation_col_sep'
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
23 #end if
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
24 #end if
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
25 #end if
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
26 </command>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
27 <inputs>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
28 <param name="input" type="data" format="tabular" label="Input file to be filtered"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
29 help="e.g. a peptide fasta converted to tabular"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
30 <param name="reference" type="data" format="tabular" label="reference file to search"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
31 help="e.g. a protein fasta converted to tabular"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
32 <conditional name="column">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
33 <param name="set" type="select" label="select columns to compare">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
34 <option value="no" selected="true">Use last column of input and reference</option>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
35 <option value="yes">Choose the column of input and reference to compare</option>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
36 </param>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
37 <when value="no"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
38 <when value="yes">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
39 <param name="input_column" type="data_column" data_ref="input" label="column in input (defaults to last column)"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
40 help=""/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
41 <param name="reference_column" type="data_column" data_ref="reference" label="column in reference (defaults to last column)"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
42 help=""/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
43 </when>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
44 </conditional>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
45 <param name="case_insensitive" type="boolean" truevalue="--case_insensitive" falsevalue="" checked="false" label="Ignore case when comparing"/>
1
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
46 <param name="reverse_find" type="boolean" truevalue="--reverse_find" falsevalue="" checked="false" label="reverse search: find the reference in the input" />
0
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
47 <param name="outputs" type="select" multiple="true" display="checkboxes" label="Choose outputs">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
48 <option value="novel" selected="true">lines with no match in reference</option>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
49 <option value="found">lines with match in reference</option>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
50 </param>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
51 <conditional name="annotate">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
52 <param name="from_ref" type="select" label="Annotate found input entries with columns from reference">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
53 <option value="no" selected="true">No</option>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
54 <option value="yes">Yes</option>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
55 </param>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
56 <when value="no"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
57 <when value="yes">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
58 <param name="annotation_columns" type="data_column" data_ref="reference" multiple="true" label="columns from reference to append to found input lines"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
59 help=""/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
60 <param name="annotation_separator" type="text" value=";" optional="true" label="separator to place between annotations from different reference lines"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
61 help="defaults to ;">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
62 <validator type="regex" message="Single quote character is not allowed">^[^']*$</validator>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
63 <sanitizer>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
64 <valid initial="string.printable">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
65 <remove value="&apos;"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
66 </valid>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
67 <mapping initial="none">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
68 <add source="&apos;" target=""/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
69 </mapping>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
70 </sanitizer>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
71 </param>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
72 <param name="annotation_col_sep" type="text" value="," optional="true" label="separator to place between annotation columns from the same reference line"
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
73 help="defaults to ,">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
74 <validator type="regex" message="Single quote character is not allowed">^[^']*$</validator>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
75 <sanitizer>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
76 <valid initial="string.printable">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
77 <remove value="&apos;"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
78 </valid>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
79 <mapping initial="none">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
80 <add source="&apos;" target=""/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
81 </mapping>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
82 </sanitizer>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
83 </param>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
84 </when>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
85 </conditional>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
86 </inputs>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
87 <stdio>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
88 <exit_code range="1:" level="fatal" description="Error" />
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
89 </stdio>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
90 <outputs>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
91 <data name="found" metadata_source="input" format_source="input" label="${tool.name} on ${on_string}: found">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
92 <filter>'found' in str(outputs)</filter>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
93 </data>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
94 <data name="novel" metadata_source="input" format_source="input" label="${tool.name} on ${on_string}: novel">
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
95 <filter>'novel' in str(outputs) or not 'found' in str(outputs)</filter>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
96 </data>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
97 </outputs>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
98 <tests>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
99 <test>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
100 <param name="input" value="human_peptides.tabular" ftype="tabular" dbkey="hg19"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
101 <param name="reference" value="human_proteins.tabular" ftype="tabular" dbkey="hg19"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
102 <output name="novel" file="novel_peptides.tabular"/>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
103 </test>
1
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
104 <test>
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
105 <param name="input" value="human_proteins.tabular" ftype="tabular" dbkey="hg19"/>
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
106 <param name="reference" value="human_peptides.tabular" ftype="tabular" dbkey="hg19"/>
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
107 <param name="reverse_find" value="True"/>
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
108 <param name="outputs" value="found"/>
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
109 <output name="found" file="found_proteins.tabular"/>
e83e0ce8fb68 Add option to reverse the search, find reference field in input field
Jim Johnson <jj@umn.edu>
parents: 0
diff changeset
110 </test>
0
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
111 </tests>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
112 <help>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
113 **Find in Reference**
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
114
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
115 Filters lines of a tabular input file by checking if the selected input column value
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
116 is a substring of the selected column of any line in the reference file.
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
117
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
118 This can be used to check if peptides sequences are present in a set of reference proteins,
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
119 as a means of filtering out uninteresting peptide sequences.
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
120
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
121 For Example with::
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
122
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
123 Input
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
124 >pep1 LIL
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
125 >pep2 WTF
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
126 >pep3 ISK
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
127
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
128 Reference
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
129 >prot1 RLET
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
130 >prot2 LLIL
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
131 >prot3 LAPSE
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
132 >prot3 RISKY
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
133
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
134 The outputs
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
135
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
136 Not found in reference
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
137 >pep2 WTF
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
138
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
139 Found in reference
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
140 >pep1 LIL
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
141 >pep3 ISK
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
142
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
143
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
144 </help>
e7e56b51d156 Uploaded
jjohnson
parents:
diff changeset
145 </tool>