Mercurial > repos > jjohnson > find_in_reference
annotate find_in_reference.xml @ 2:30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
| author | Jim Johnson <jj@umn.edu> |
|---|---|
| date | Thu, 23 Jan 2014 10:52:30 -0600 |
| parents | 856033fb26e8 |
| children | fe044d480b3a |
| rev | line source |
|---|---|
| 0 | 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 | |
| 1 | 10 $case_insensitive |
| 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" | |
|
2
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
16 #if $annotate.from_ref == 'yes' and str($annotate.annotation_columns) != 'None': |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
17 --annotation_columns $annotate.annotation_columns |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
18 #if $annotate.annotation_separator != '': |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
19 --annotation_separator '$annotate.annotation_separator' |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
20 #end if |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
21 #if $annotate.annotation_col_sep != '': |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
22 --annotation_col_sep '$annotate.annotation_col_sep' |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
23 #end if |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
24 #end if |
| 0 | 25 #end if |
| 26 </command> | |
| 27 <inputs> | |
| 28 <param name="input" type="data" format="tabular" label="Input file to be filtered" | |
| 1 | 29 help="e.g. a peptide fasta converted to tabular"/> |
| 0 | 30 <param name="reference" type="data" format="tabular" label="reference file to search" |
| 1 | 31 help="e.g. a protein fasta converted to tabular"/> |
| 0 | 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> | |
| 1 | 45 <param name="case_insensitive" type="boolean" truevalue="--case_insensitive" falsevalue="" checked="false" label="Ignore case when comparing"/> |
| 0 | 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> | |
|
2
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
50 <conditional name="annotate"> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
51 <param name="from_ref" type="select" label="Annotate found input entries with columns from reference"> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
52 <option value="no" selected="true">No</option> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
53 <option value="yes">Yes</option> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
54 </param> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
55 <when value="no"/> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
56 <when value="yes"> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
57 <param name="annotation_columns" type="data_column" data_ref="reference" multiple="true" label="columns from reference to append to found input lines" |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
58 help=""/> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
59 <param name="annotation_separator" type="text" value="" optional="true" label="separator to place between annotations from different reference lines" |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
60 help="defaults to ;"/> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
61 <param name="annotation_col_sep" type="text" value="" optional="true" label="separator to place between annotation columns from the same reference line" |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
62 help="defaults to ,"/> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
63 </when> |
|
30975b3ff0dc
Allow user to add annotation columns from reference to found input entries
Jim Johnson <jj@umn.edu>
parents:
1
diff
changeset
|
64 </conditional> |
| 0 | 65 </inputs> |
| 66 <stdio> | |
| 67 <exit_code range="1:" level="fatal" description="Error" /> | |
| 68 </stdio> | |
| 69 <outputs> | |
| 70 <data name="found" metadata_source="input" format_source="input" label="${tool.name} on ${on_string}: found"> | |
| 71 <filter>'found' in str(outputs)</filter> | |
| 72 </data> | |
| 73 <data name="novel" metadata_source="input" format_source="input" label="${tool.name} on ${on_string}: novel"> | |
| 74 <filter>'novel' in str(outputs) or not 'found' in str(outputs)</filter> | |
| 75 </data> | |
| 76 </outputs> | |
| 77 <tests> | |
| 78 <test> | |
| 79 <param name="input" value="human_peptides.tabular" ftype="tabular" dbkey="hg19"/> | |
| 80 <param name="reference" value="human_proteins.tabular" ftype="tabular" dbkey="hg19"/> | |
| 81 <output name="novel" file="novel_peptides.tabular"/> | |
| 82 </test> | |
| 83 </tests> | |
| 84 <help> | |
| 85 **Find in Reference** | |
| 86 | |
| 1 | 87 Filters lines of a tabular input file by checking if the selected input column value |
| 0 | 88 is a substring of the selected column of any line in the reference file. |
| 89 | |
| 90 This can be used to check if peptides sequences are present in a set of reference proteins, | |
| 91 as a means of filtering out uninteresting peptide sequences. | |
| 92 | |
| 1 | 93 For Example with:: |
| 94 | |
| 95 Input | |
| 96 >pep1 LIL | |
| 97 >pep2 WTF | |
| 98 >pep3 ISK | |
| 99 | |
| 100 Reference | |
| 101 >prot1 RLET | |
| 102 >prot2 LLIL | |
| 103 >prot3 LAPSE | |
| 104 >prot3 RISKY | |
| 105 | |
| 106 The outputs | |
| 107 | |
| 108 Not found in reference | |
| 109 >pep2 WTF | |
| 110 | |
| 111 Found in reference | |
| 112 >pep1 LIL | |
| 113 >pep3 ISK | |
| 114 | |
| 115 | |
| 0 | 116 </help> |
| 117 </tool> |
