Skip to content

Getting Started

github-actions[bot] edited this page Oct 15, 2026 · 2 revisions

Getting Started

You can learn the whole workflow with one tiny file. In about five minutes, you will validate it, build an index, extract a region, transform it, and inspect its statistics.

1. Create a FASTA

Save this as example.fa:

>chr1 chromosome one
ACGTACGTACGT
>rna
AUGCRY
>protein
MPEPTIDE

z-fasta uses the identifier before the first space or tab. The indexed names are chr1, rna, and protein.

2. Validate it

z-fasta validate example.fa

Expected output:

OK example.fa: no findings
complete: examined 64 bytes, 6 lines, 3 records, 26 symbols; protein alphabet chosen from 26 symbols

Validation does not require an index.

3. Build the default index

z-fasta index example.fa

Expected stderr:

wrote example.fa.zfi (3 sequences)

You now have example.fa.zfi, the sidecar GET and stats will use.

4. Extract a complete record

z-fasta get example.fa chr1
>chr1
ACGTACGTACGT

5. Extract a region

z-fasta get example.fa chr1:3-8
>chr1:3-8
GTACGT

Positional coordinates are 1-based inclusive. The third through eighth symbols produce six output symbols.

6. Apply a transform

z-fasta get example.fa chr1:3-8 --rc --annotate-rc
>chr1:3-8 (reverse complement)
ACGTAC

Complement-based transforms classify up to 256 requested bases and reject protein records.

7. Print statistics

z-fasta stats example.fa

The report brings file details, length summaries, Nx statistics, auN, and complete nucleotide or protein composition together in one place.

Why this mixed file is classified as protein

Stats classifies the complete indexed symbol population. A sample is nucleotide only when case-insensitive IUPAC nucleotide bytes are strictly more than 90 percent of all symbols. The protein record pushes this small combined file below that threshold.

What to read next

Clone this wiki locally