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