Mercurial > repos > peterjc > fasta_filter_by_id
comparison tools/fasta_tools/fasta_filter_by_id.xml @ 3:812383b5d3b8 draft default tip
v0.0.5 - galaxy_sequence_utils dependency and other cleanups inc using MIT license
author | peterjc |
---|---|
date | Fri, 03 Feb 2017 05:32:34 -0500 |
parents | 5b552b3005f2 |
children |
comparison
equal
deleted
inserted
replaced
2:5b552b3005f2 | 3:812383b5d3b8 |
---|---|
1 <tool id="fasta_filter_by_id" name="Filter FASTA by ID" version="0.0.4" hidden="true"> | |
2 <description>from a tabular file</description> | |
3 <command interpreter="python"> | |
4 fasta_filter_by_id.py $input_tabular $columns $input_fasta | |
5 #if $output_choice_cond.output_choice=="both" | |
6 $output_pos $output_neg | |
7 #elif $output_choice_cond.output_choice=="pos" | |
8 $output_pos - | |
9 #elif $output_choice_cond.output_choice=="neg" | |
10 - $output_neg | |
11 #end if | |
12 </command> | |
13 <inputs> | |
14 <param name="input_fasta" type="data" format="fasta" label="FASTA file to filter on the identifiers"/> | |
15 <param name="input_tabular" type="data" format="tabular" label="Tabular file containing FASTA identifiers"/> | |
16 <param name="columns" type="data_column" data_ref="input_tabular" multiple="True" numerical="False" label="Column(s) containing FASTA identifiers" help="Multi-select list - hold the appropriate key while clicking to select multiple columns"> | |
17 <validator type="no_options" message="Pick at least one column"/> | |
18 </param> | |
19 <conditional name="output_choice_cond"> | |
20 <param name="output_choice" type="select" label="Output positive matches, negative matches, or both?"> | |
21 <option value="both">Both positive matches (ID on list) and negative matches (ID not on list), as two FASTA files</option> | |
22 <option value="pos">Just positive matches (ID on list), as a single FASTA file</option> | |
23 <option value="neg">Just negative matches (ID not on list), as a single FASTA file</option> | |
24 </param> | |
25 <!-- Seems need these dummy entries here, compare this to indels/indel_sam2interval.xml --> | |
26 <when value="both" /> | |
27 <when value="pos" /> | |
28 <when value="neg" /> | |
29 </conditional> | |
30 </inputs> | |
31 <outputs> | |
32 <data name="output_pos" format="fasta" label="With matched ID"> | |
33 <filter>output_choice_cond["output_choice"] != "neg"</filter> | |
34 </data> | |
35 <data name="output_neg" format="fasta" label="Without matched ID"> | |
36 <filter>output_choice_cond["output_choice"] != "pos"</filter> | |
37 </data> | |
38 </outputs> | |
39 <tests> | |
40 <!-- Can't get these unit tests to run, may be a Galaxy problem | |
41 <test> | |
42 <param name="input_fasta" value="four_human_proteins.fasta" ftype="fasta" /> | |
43 <param name="input_tabular" value="blastp_four_human_vs_rhodopsin.tabular" ftype="tabular" /> | |
44 <param name="columns" value="1" /> | |
45 <param name="output_choice" value="both" /> | |
46 <output name="output_pos" file="four_human_proteins_filter_a.fasta" ftype="fasta" /> | |
47 <output name="output_neg" file="four_human_proteins_filter_b.fasta" ftype="fasta" /> | |
48 </test> | |
49 <test> | |
50 <param name="input_fasta" value="four_human_proteins.fasta" ftype="fasta" /> | |
51 <param name="input_tabular" value="blastp_four_human_vs_rhodopsin.tabular" ftype="tabular" /> | |
52 <param name="columns" value="1" /> | |
53 <param name="output_choice" value="pos" /> | |
54 <output name="output_pos" file="four_human_proteins_filter_a.fasta" ftype="fasta" /> | |
55 </test> | |
56 <test> | |
57 <param name="input_fasta" value="four_human_proteins.fasta" ftype="fasta" /> | |
58 <param name="input_tabular" value="blastp_four_human_vs_rhodopsin.tabular" ftype="tabular" /> | |
59 <param name="columns" value="1" /> | |
60 <param name="output_choice" value="neg" /> | |
61 <output name="output_neg" file="four_human_proteins_filter_b.fasta" ftype="fasta" /> | |
62 </test> | |
63 --> | |
64 </tests> | |
65 <help> | |
66 | |
67 **Deprecated** | |
68 | |
69 This tool is now obsolete, and should not be used in future. It has been | |
70 replaced by a more general version covering FASTA, FASTQ and SFF in one | |
71 single tool. | |
72 | |
73 **What it does** | |
74 | |
75 By default it divides a FASTA file in two, those sequences with or without an | |
76 ID present in the tabular file column(s) specified. You can opt to have a | |
77 single output file of just the matching records, or just the non-matching ones. | |
78 | |
79 Note that the order of sequences in the original FASTA file is preserved. | |
80 Also, if any sequences share an identifier, duplicates are not removed. | |
81 | |
82 **Example Usage** | |
83 | |
84 Given a FASTA file of proteins you might run a signal peptide search (e.g. | |
85 via the SignalP wrapper for Galaxy), then filtered these tabular results to | |
86 select just those with a signal peptide. You could then use this tool to get | |
87 a FASTA file of only the proteins with predicted signal peptides. | |
88 | |
89 </help> | |
90 </tool> |