NAME
fastr - character-based transformations on sequence records
SYNOPSIS
fastr [OPTION]... [SEARCHLIST] [REPLACELIST] [MULTIFASTA-FILE...]
fastr -n [OPTION]... [SEARCHLIST] [MULTIFASTA-FILE...]
fastr --strict [--ambig=<char>] [MULTIFASTA-FILE...]
fastr --iupac [--ambig=<char>] [MULTIFASTA-FILE...]
fastr --degap [MULTIFASTA-FILE...]
DESCRIPTION
fastr takes multifasta format sequence or alignment data as input, and faciliates character transliterations on identifiers (by default), sequences or descriptions using the Perl tr/// character transliteration operator. This faciliates character remapping, case changes, character deletions, degapping, squashing of repeated characters, and more. Special modes --strict, --iupac, and --degap automatically direct transliterations on facilitate enforcement of sequence alphabets, and remapping illegal characters to 'N' or 'X' or a user-defined character.
Options specific to fastr: -s, --sequence transliterate sequences -d, --description transliterate descriptions -D, --delete delete found characters not replaced -S, --squash squash duplicate replaced characters -n, --no-replace squash/delete characters in searchlist -c, --complement complement searchlist as a character set --strict map ambiguous/invalid nongap chars in sequences --iupac map invalid nongap chars (to N/X by default) -N, -X, --ambig=<char> map ambig/invalid chars to <char> --degap delete gap characters '-' -j, --join=<string> use <string> to join data annotation
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 fastq format for input and output
SEARCHLIST AND REPLACELIST
These arguments are strings of characters, or character ranges with hyphens (like "A-Z" "0-9"), separated by the empty string. Characters are remapped in corresponding order. If SEARCHLIST is longer than REPLACELIST, the last character of REPLACELIST is repeated unless in "delete-mode," in which case unmatched characters are deleted. In "squash-mode" transliteration happens before squashing. With the "no-replace" option, only SEARCHLIST is provided, no transliteration occurs, and SEARCHLIST characters are directly squashed and deleted. For more information see documentation for tr/// in the perlop manpage.
INPUT AND OUTPUT
fastr 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 or more files or on STDIN. Output occurs to STDOUT. The FAST utility fasconvert can reformat other formats to and from multifasta.
OPTIONS
- -s --sequence
-
Transliterate sequences (identifiers by default).
- -d --description
-
Transliterate descriptions.
- -D --delete
-
Delete found but unreplaced characters.
- -S --squash
-
Squash duplicate replaced characters.
- -c --complement
-
Character complement SEARCHLIST. The last character of REPLACELIST replaces all characters not in SEARCHLIST.
- -n --no-replace
-
Delete or squash characters in SEARCHLIST.
- --strict
-
Transliterate illegal sequence characters to "N" (DNA or RNA) or "X" (protein). Takes precedence over --iupac. Other options disallowed in combination except --ambig and --fastq. For DNA, equivalent to:
fastr -sc ACTGactg\- N
- --iupac
-
Transliterate illegal sequence characters (including IUPAC ambiguities) to "N" (DNA or RNA) or "X" (protein). Other options disallowed in combination except --ambig and --fastq. For DNA, equivalent to:
fastr -sc ACTGactgMRWSYKVHDBXNmrwsykvhdbxn\- N
- --degap
-
Delete gap characters "-" from each sequence. May only be combined with no other option except the --fastq option. Equivalent to:
fastr -snD -- -
- -N <char>, -X <char>, --ambig=<char>
-
Use <char> to replace illegal characters instead of "N" or "X" with --strict or --iupac
- -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
Change all bars "|" to hashes ("#") in IDs:
fastr '|' '#' t/data/P450.fas
Change all square brackets to parens in description:
fastr -d '[]' '()' t/data/P450.fas
Lower-case all sequence data:
fastr -s 'A-Z' 'a-z' t/data/P450.fas
Delete all bars "|" in GenBank IDs:
fastr -D '|' '' t/data/P450.fas
fastr -nD '|' t/data/P450.fas
Delete all non-strict characters from a DNA sequence:
fastr -nscD 'ACGT' t/data/P450.fas
Control and check the function of --strict:
fastr --strict t/data/ArdellEtAl03_ncbi_popset_32329588.fas | fascomp -t
cat t/data/ArdellEtAl03_ncbi_popset_32329588.fas | fascomp -t
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..