Mercurial > repos > galaxyp > filter_by_fasta_ids
diff filter_by_fasta_ids.xml @ 3:3c623e81be77 draft
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/filter_by_fasta_ids commit 0556e0fe5aa17c84033a75a45baeb3a4c2b5ff76
author | galaxyp |
---|---|
date | Fri, 15 Feb 2019 16:38:31 -0500 |
parents | 1bd985f14938 |
children | cd22452edec2 |
line wrap: on
line diff
--- a/filter_by_fasta_ids.xml Sat Apr 28 03:49:28 2018 -0400 +++ b/filter_by_fasta_ids.xml Fri Feb 15 16:38:31 2019 -0500 @@ -1,4 +1,4 @@ -<tool id="filter_by_fasta_ids" name="Filter FASTA" version="2.0"> +<tool id="filter_by_fasta_ids" name="Filter FASTA" version="2.1"> <description>on the headers and/or the sequences</description> <macros> <xml name="regexp_macro" token_label="Regular expression pattern"> @@ -23,6 +23,11 @@ -i '$input' #if $header_criteria.header_criteria_select == 'id_list' --id_list '$header_criteria.identifiers' + #if $header_criteria.id_regex.find == 'pattern': + --pattern '$header_criteria.id_regex.pattern' + #elif $header_criteria.id_regex.find == 'beginning': + --pattern '$header_criteria.id_regex.pattern' + #end if #elif $header_criteria.header_criteria_select == 'regexp' --header_regexp '$header_criteria.regexp' #end if @@ -51,6 +56,30 @@ <when value="" /> <when value="id_list"> <param name="identifiers" type="data" format="txt" label="List of IDs to extract sequences for"/> + + + <conditional name="id_regex"> + <param name="find" type="select" label="Match IDs by"> + <option value="beginning">Default: ID is expected at the beginning: >ID </option> + <help>Default: >ID will use search pattern >([^| ]+) to input ID; Use custom regex to change</help> + <option value="pattern">Custom regex pattern</option> + </param> + <when value="beginning"> + <param name="pattern" type="hidden" value=">([^| ]+)" label="regex search pattern for ID" > + <sanitizer sanitize="False"/> + <validator type="regex" message="must include a group that returns an ID">^.*[(](?![?]:).*[)].*$</validator> + </param> + </when> + <when value="pattern"> + <param name="pattern" type="text" value="" label="regex search pattern for ID"> + <help>search pattern must contain %s where the ID will be substituted. Use this for Uniprot Acc: >.+?\|(.+?)\|.*$ </help> + <sanitizer sanitize="False"/> + <validator type="regex" message="must include a group that returns an ID">^.*[(](?![?]:).*[)].*$</validator> + </param> + </when> + </conditional> + + </when> <when value="regexp"> <expand macro="regexp_macro" label="Regular expression pattern the header should match" /> @@ -88,6 +117,15 @@ <param name="dedup" value="True" /> <output name="output" file="output_dedup.fasta" /> </test> + <test expect_num_outputs="1"> + <param name="input" ftype="fasta" value="input_sp.fasta" /> + <param name="header_criteria_select" value="id_list" /> + <param name="find" value="pattern" /> + <param name="pattern" value=">.+?\|(.+?)\|.*$" /> + <param name="identifiers" ftype="txt" value="ids_sp.txt" /> + <param name="dedup" value="True" /> + <output name="output" file="output_sp_dedup.fasta" /> + </test> <test expect_num_outputs="2"> <param name="input" ftype="fasta" value="input.fasta" /> <param name="header_criteria_select" value="id_list" />