Category

Sequence Analysis


Usage

faFilter [options] in.fa out.fa


Manual

This tool is part of UCSC Genome Browser's utilities.

Required arguments

  • in.fa: Input FASTA file
  • out.fa: Output FASTA file

Options

  • -name wildCard: Only pass records where the name matches the wildcard pattern. Example: -name ABC* selects records with names starting with "ABC".
  • -namePatList filename: A list of regular expressions, one per line, that will be applied to the FASTA names. Similar to -name. Example: -namePatList patterns.txt
  • -v: Invert the match, select non-matching records.
  • -minSize N: Only pass sequences that are at least N characters in size.
  • -maxSize N: Only pass sequences that are at most N characters in size.
  • -maxN N: Only pass sequences with fewer than N occurrences of the character 'N'.
  • -uniq: Removes duplicate sequence IDs, keeping the first occurrence. You can make -uniq ignore case with -i.
  • -i: Make -uniq ignore case when considering sequence IDs. For example, it will treat "ABC" and "abc" as duplicates.

All specified conditions must pass to retain a sequence. If no conditions are specified, all records will be retained.

Examples

Extract sequences for certain chromosomes / contigs

In the following example, we will use faFilter to get the sequence for chromosome 1 from the human reference genome, and save the sequence to a file called chr1.fa:

$ faFilter -name=chr1 ~/refs/sequences/human/GRCh38_no_alt_analysis_set_GCA_000001405.15.fasta chr1.fa

$ head chr1.fa
>chr1
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

File formats this tool works with
FASTA

Share your experience or ask a question