# HG changeset patch # User peterjc # Date 1307481768 14400 # Node ID 5cd569750e8581cb99d13888bbacfe07209bfccb # Parent 2e5f8ad1a096972bef55a06f5cd9c55992a1989d Migrated tool version 0.0.3 from old tool shed archive to new tool shed repository diff -r 2e5f8ad1a096 -r 5cd569750e85 tools/fasta_tools/fasta_filter_by_id.py --- a/tools/fasta_tools/fasta_filter_by_id.py Tue Jun 07 17:22:24 2011 -0400 +++ b/tools/fasta_tools/fasta_filter_by_id.py Tue Jun 07 17:22:48 2011 -0400 @@ -3,8 +3,9 @@ Takes five command line options, tabular filename, ID column numbers (comma separated list using one based counting), input FASTA filename, and -two output FASTA filenames (for records with and without any BLAST hits). -If the either output filename is just a minus sign, that file is not created. +two output FASTA filenames (for records with and without the given IDs). + +If either output filename is just a minus sign, that file is not created. This is intended to allow output for just the matched (or just the non-matched) records. @@ -51,7 +52,7 @@ print "Using %i IDs from tabular file" % (len(ids)) handle.close() -#Write filtered FASTA file based on IDs from BLAST file +#Write filtered FASTA file based on IDs from tabular file reader = fastaReader(open(in_file, "rU")) if out_positive_file != "-" and out_negative_file != "-": print "Generating two FASTA files" diff -r 2e5f8ad1a096 -r 5cd569750e85 tools/fasta_tools/fasta_filter_by_id.txt --- a/tools/fasta_tools/fasta_filter_by_id.txt Tue Jun 07 17:22:24 2011 -0400 +++ b/tools/fasta_tools/fasta_filter_by_id.txt Tue Jun 07 17:22:48 2011 -0400 @@ -14,7 +14,7 @@ * fasta_filter_by_id.py (the Python script) * fasta_filter_by_id.xml (the Galaxy tool definition) -The suggested location is next to the similarly names fasta_filter_by_length.py +The suggested location is next to the similarly named fasta_filter_by_length.py and fasta_filter_by_length.xml files which are included with Galaxy, i.e. in the Galaxy folder tools/fasta_tools @@ -30,13 +30,15 @@ History ======= -v0.0.1 - Initial verion (not publicly released) +v0.0.1 - Initial version (not publicly released) v0.0.2 - Allow both, just pos or just neg output files +v0.0.3 - Include FASTA in tool name Developers ========== -These wrappers are currently being developed on the following hg branch: +This script and similar versions for FASTQ and SFF files are currently being +developed on the following hg branch: http://bitbucket.org/peterjc/galaxy-central/src/fasta_filter For making the "Galaxy Tool Shed" http://community.g2.bx.psu.edu/ tarball use diff -r 2e5f8ad1a096 -r 5cd569750e85 tools/fasta_tools/fasta_filter_by_id.xml --- a/tools/fasta_tools/fasta_filter_by_id.xml Tue Jun 07 17:22:24 2011 -0400 +++ b/tools/fasta_tools/fasta_filter_by_id.xml Tue Jun 07 17:22:48 2011 -0400 @@ -1,4 +1,4 @@ - + from a tabular file fasta_filter_by_id.py $input_tabular $columns $input_fasta @@ -73,5 +73,12 @@ Note that the order of sequences in the original FASTA file is preserved. Also, if any sequences share an identifier, duplicates are not removed. +**Example Usage** + +Given a FASTA file of proteins you might run a signal peptide search (e.g. +via the SignalP wrapper for Galaxy), then filtered these tabular results to +select just those with a signal peptide. You could then use this tool to get +a FASTA file of only the proteins with predicted signal peptides. +