comparison find_in_reference.xml @ 0:e7e56b51d156

Uploaded
author jjohnson
date Wed, 05 Feb 2014 08:12:47 -0500
parents
children e83e0ce8fb68
comparison
equal deleted inserted replaced
-1:000000000000 0:e7e56b51d156
1 <?xml version="1.0"?>
2 <tool id="find_in_reference" name="find in reference" version="0.0.1">
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
10 $case_insensitive
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"/>
46 <param name="outputs" type="select" multiple="true" display="checkboxes" label="Choose outputs">
47 <option value="novel" selected="true">lines with no match in reference</option>
48 <option value="found">lines with match in reference</option>
49 </param>
50 <conditional name="annotate">
51 <param name="from_ref" type="select" label="Annotate found input entries with columns from reference">
52 <option value="no" selected="true">No</option>
53 <option value="yes">Yes</option>
54 </param>
55 <when value="no"/>
56 <when value="yes">
57 <param name="annotation_columns" type="data_column" data_ref="reference" multiple="true" label="columns from reference to append to found input lines"
58 help=""/>
59 <param name="annotation_separator" type="text" value=";" optional="true" label="separator to place between annotations from different reference lines"
60 help="defaults to ;">
61 <validator type="regex" message="Single quote character is not allowed">^[^']*$</validator>
62 <sanitizer>
63 <valid initial="string.printable">
64 <remove value="&apos;"/>
65 </valid>
66 <mapping initial="none">
67 <add source="&apos;" target=""/>
68 </mapping>
69 </sanitizer>
70 </param>
71 <param name="annotation_col_sep" type="text" value="," optional="true" label="separator to place between annotation columns from the same reference line"
72 help="defaults to ,">
73 <validator type="regex" message="Single quote character is not allowed">^[^']*$</validator>
74 <sanitizer>
75 <valid initial="string.printable">
76 <remove value="&apos;"/>
77 </valid>
78 <mapping initial="none">
79 <add source="&apos;" target=""/>
80 </mapping>
81 </sanitizer>
82 </param>
83 </when>
84 </conditional>
85 </inputs>
86 <stdio>
87 <exit_code range="1:" level="fatal" description="Error" />
88 </stdio>
89 <outputs>
90 <data name="found" metadata_source="input" format_source="input" label="${tool.name} on ${on_string}: found">
91 <filter>'found' in str(outputs)</filter>
92 </data>
93 <data name="novel" metadata_source="input" format_source="input" label="${tool.name} on ${on_string}: novel">
94 <filter>'novel' in str(outputs) or not 'found' in str(outputs)</filter>
95 </data>
96 </outputs>
97 <tests>
98 <test>
99 <param name="input" value="human_peptides.tabular" ftype="tabular" dbkey="hg19"/>
100 <param name="reference" value="human_proteins.tabular" ftype="tabular" dbkey="hg19"/>
101 <output name="novel" file="novel_peptides.tabular"/>
102 </test>
103 </tests>
104 <help>
105 **Find in Reference**
106
107 Filters lines of a tabular input file by checking if the selected input column value
108 is a substring of the selected column of any line in the reference file.
109
110 This can be used to check if peptides sequences are present in a set of reference proteins,
111 as a means of filtering out uninteresting peptide sequences.
112
113 For Example with::
114
115 Input
116 >pep1 LIL
117 >pep2 WTF
118 >pep3 ISK
119
120 Reference
121 >prot1 RLET
122 >prot2 LLIL
123 >prot3 LAPSE
124 >prot3 RISKY
125
126 The outputs
127
128 Not found in reference
129 >pep2 WTF
130
131 Found in reference
132 >pep1 LIL
133 >pep3 ISK
134
135
136 </help>
137 </tool>