Reference Code backup Executable files
Filter fasta records, selecting ones that match the specified conditions
faFilter [options] in.fa out.fa
This tool is part of UCSC Genome Browser's utilities.
-name ABC*
selects records with names starting with "ABC".-namePatList patterns.txt
All specified conditions must pass to retain a sequence. If no conditions are specified, all records will be retained.
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