NAME

fassort - sort sequences based on identifiers

SYNOPSIS

fassort [OPTION]... [MULTIFASTA-FILE]...

DESCRIPTION

fassort takes sequence or alignment data as input, and outputs sequence records sorted by some user-defined criteria. By default, sequences are sorted ASCIIbetically by their identifiers. Optionally sequences may be sorted by their sequences, descriptions or components of descripions.

Options specific to fassort: -d, --description sort on description -s, --sequence sort on sequence -f, --field=<int> sort on field in description -t, --tag=<string> sort on value of a (tag,value) pair in the description -x, --regex=<regex> sort on value of a regex capture -S, --split-on-regex=<regex> split description for field matching using regex -r, --reverse reverse result of comparisons -n, --numeric compare according to string numerical value

Options general to FAST: -h, --help print a brief help message --man print full documentation --version print version -l, --log create/append to logfile -L, --logname=<string> use logfile name <string> -C, --comment=<string> save comment <string> to log --format=<format> use alternative format for input --moltype=<[dna|rna|protein]> specify input sequence type -q, --fastq use fastq format as input and output

INPUT AND OUTPUT

fassort is part of FAST, the FAST Analysis of Sequences Toolbox, based on Bioperl. Most core FAST utilities expect input and return output in multifasta format. Input can occur in one file or on STDIN. Output occurs to STDOUT. The FAST utility fasconvert can reformat other formats to and from multifasta.

DEFAULT AND OPTIONAL SORTING BEHAVIOR

By default, fassort sorts sequence records by their identifiers. Options described below modify which parts of sequence records are sorted on. These options take effect as follows with decreasing priority: -t > -xd > -xs > -x > -f > -d > -s

OPTIONS

-d, --description

Sort sequence records by their descriptions. If used in combination with the -x, --regex option, sort records by values of a regex capture applied to their descriptions.

-s, --sequence

Sort sequence records by their sequences. If used in combination with the -x, --regex option, sort records by values of a regex capture applied to their sequences.

-f [int], --field=[int]

Sort sequence records by values at a specific field in sequence descriptions. With this option, the description is split into fields using strings of white space as field delimiters (the default Perl behavior for splitting lines of data into fields).

This option takes a mandatory positive integer option argument giving the index for which field the regex should query. One-based indexing is used, so the first field after the sequence identifier has index 1. As standard in Perl, negative indices count backwards from the last field in the description; field "-1" is the last field, "-2" is the second-to-last etc. Sequence records for which the specified field does not exist will sort on a null key.

-S [regex], --split-on-regex=[regex]

Use regex <regex> to split descriptions for the -f option instead of the perl default (which splits on one or more whitespace characters). Special characters must be quoted to protect them from the shell.

-t [string], --tag=[string]

Sort sequence records by values of a named tag in the description. Name-value pairs in the description are expected to have the format "name:value" as generated by FAST tools (such as faslen) or "name=value" as common in General Feature Format. The "name" must contain only characters from the set [a-zA-Z0-9_-]. The "value" is any string of non-whitespace characters. Sequence records for which the specified tag does not exist will sort on a null key.

-x [regex], --regex=[regex]

Sort sequence records by values of a regex capture applied to identifers (by default), descriptions (in combination with the -d option), or sequences (in combination with the -s option). The format of the regex is a perl regular expression that must contain exactly one "capture buffer" indicated by a pair or parentheses. The value captured in this buffer is the sort key. Sequence records that do not match the regex will sort on a null key.

-r, --reverse

Reverse the result of comparisons so that greater keys come first.

-n, --numeric

Compare keys by their string numerical value.

-h, --help

Print a brief help message and exit.

--man

Print the manual page and exit.

--version

Print version information and exit.

-l, --log

Creates, or appends to, a generic FAST logfile in the current working directory. The logfile records date/time of execution, full command with options and arguments, and an optional comment.

-L [string], --logname=[string]

Use [string] as the name of the logfile. Default is "FAST.log.txt".

-C [string], --comment=[string]

Include comment [string] in logfile. No comment is saved by default.

--format=[format]

Use alternative format for input. See man page for "fasconvert" for allowed formats. This is for convenience; the FAST tools are designed to exchange data in Fasta format, and "fasta" is the default format for this tool.

-m [dna|rna|protein], --moltype=[dna|rna|protein]

Specify the type of sequence on input (should not be needed in most cases, but sometimes Bioperl cannot guess and complains when processing data).

-q --fastq

Use fastq format as input and output.

EXAMPLES

Sort sequences by their length:

    faslen data.fas | fassort -nt length

Sort sequences by their third-position adenosine contents:

    fascut 3:-1:3 cds.fas | fascomp | fassort -nt comp_A

SEE ALSO

man perlre
perldoc perlre

Documentation on perl regular expressions.

man FAST
perldoc FAST

Introduction and cookbook for FAST

The FAST Home Page"

CITING

If you use FAST, please cite Lawrence et al. (2015). FAST: FAST Analysis of Sequences Toolbox. and Bioperl Stajich et al..