Genomics file types
and the example dataset

Week 4 – Lecture A

Jelmer Poelstra

2026-09-14


Genomics file types

Overview

DNA and protein (amino acid) sequences, as well as sequence annotations, are mostly stored in plain-text formats. Some of the most common types, which you’ll work with in this course, are:

FASTA

  • Simple sequence files, where each entry contains a header and a sequence.

  • Versatile: may contain a few short sequences, genome assemblies, proteomes, etc.

FASTQ

  • The standard format for HTS reads.

  • Differs from FASTA, e.g., by including a quality score for each nucleotide.

GTF/GFF

  • A (genome) annotation format.

  • A table with coordinates of, e.g., genes and exons.


Another common pair is SAM/BAM, e.g. produced when aligning reads to a genome.

FASTA files

FASTA files contain one or more DNA or amino acid sequences,
with no limits on the number of sequences or the sequence lengths.

The following example FASTA file contains two entries:

>unique_sequence_ID Optional description
ATTCATTAAAGCAGTTTATTGGCTTAATGTACATCAGTGAAATCATAAATGCTAAAAA
>unique_sequence_ID2
ATTCATTAAAGCAGTTTATTGGCTTAATGTACATCAGTGAAATCATAAATGCTAAATG

Each entry contains a header and the sequence itself, where:

  • Header lines start with a “>” and provide identifying information (metadata) for the sequence.
  • The sequence is often spread across multiple lines (with a fixed line width, e.g. 60 characters).

FASTA files most commonly have a .fa or .fasta file extension. Also used are extensions that make explicit whether the file contains nucleotide (.fna) or amino acid sequences (.faa).

FASTQ files

FASTQ is the standard format for HTS reads. Each read forms one FASTQ entry and is represented by four lines, which contain, respectively:

  1. A header that starts with @ and uniquely identifies the read
  2. The sequence itself
  3. A plus sign, +
  4. One-character quality scores for each base (hence the “Q” in FASTQ, for “quality”)

An annotated screenshot of two reads in a FASTQ file.

FASTQ quality scores

The quality scores represent an estimate of the error probability of the base call.

Specifically, they correspond to a numeric “Phred” quality score (\(Q\)), which is a function of the estimated probability that a base call is erroneous (\(P\)):

\[ Q = -10 \log_{10}(P) \]

Some specific probabilities and their rough qualitative interpretation for Illumina data:

Phred score Error probability Rough interpretation ASCII character
10 1 in 10 terrible
20 1 in 100 bad/mediocre
30 1 in 1,000 good
40 1 in 10,000 excellent

FASTQ quality scores

Single-character representation

The numeric Phred quality score is represented in FASTQ files not by the number itself, but by a corresponding “ASCII character”.

This allows for a single-character representation of each possible score — therefore, each quality score character can correspond to (and line up with) a base character in the read.


Phred score Error probability Rough interpretation ASCII character
10 1 in 10 terrible +
20 1 in 100 bad/mediocre 5
30 1 in 1,000 good ?
40 1 in 10,000 excellent I

FASTQ quality scores

Single-character representation

The numeric Phred quality score is represented in FASTQ files not by the number itself, but by a corresponding “ASCII character”.

This allows for a single-character representation of each possible score — therefore, each quality score character can correspond to (and line up with) a base character in the read.


An annotated screenshot of two reads in a FASTQ file.

Exercise 1

What do quality scores mean in practice?

In a 100-bp read, how many errors do you expect if:

  1. Every base has a quality score of 30
  2. Every base has a quality score of 20

    Click for the answers
  1. \(100 \times 1/1{,}000 = 0.1\) errors: about 1 error per 10 reads.
  2. \(100 \times 1/100 = 1\) error: about 1 error per read, so 10 times as many. Every 10-point drop in the score means 10 times as many errors.

Even at Q30, a file with 500,000 such reads contains around 50,000 incorrect bases — one reason why we check read quality and trim reads before analysis.


FASTQ

Rather than putting all reads into a single FASTQ file, separate files are typically used for:

  • Each read direction (for paired-end data)

    Read direction File name identifier
    Forward _R1
    Reverse _R2
  • Each sample
    Reads are normally “demultiplexed” into separate files for each sample.

Therefore, paired-end FASTQ files for 2 samples usually look something like this:

sample1_R1.fastq
sample1_R2.fastq
sample2_R1.fastq
sample2_R2.fastq

FASTQ files most commonly have a .fastq extension, and sometimes .fq.

They are usually compressed, which adds a .gz extension (e.g. .fastq.gz).

Exercise 2

Counting reads

Say that file sample1_R1.fastq has 2,000,000 lines.

  1. How many reads does this file contain?
  2. How many lines do you expect sample1_R2.fastq to have?
  3. Could you count the sequences in a FASTA file the same way?

    Click for the answers
  1. 500,000 reads, since each read takes up 4 lines. (That’s the number of reads per file in our practice dataset!)
  2. Also 2,000,000 lines. Each forward read has a reverse partner from the same DNA fragment, so R1 and R2 files have the same number of reads.
  3. No. A FASTA sequence can be spread across any number of lines. You would need to count the header lines (those starting with >) instead.

GTF/GFF files

Genome annotations go in the highly similar, tabular GTF (.gtf) and GFF (.gff) formats, with:

  • One row for each annotated “genomic feature” (gene, exon, etc.)
  • Columns with information like the genomic coordinates of the features

After a metadata header, the tabular part looks like this (column names added for clarity):

seqname      source  feature     start   end     score   strand  frame   attributes
NC_068937.1  Gnomon  gene        2046    110808  .       +       .       gene_id "LOC120427725"; transcript_id ""; db_xref "GeneID:120427725"; description "homeotic protein deformed"; gbkey "Gene"; gene "LOC120427725"; gene_biotype "protein_coding";
NC_068937.1  Gnomon  transcript  2046    110808  .       +       .       gene_id "LOC120427725"; transcript_id "XM_052707445.1"; db_xref "GeneID:120427725"; gbkey "mRNA"; gene "LOC120427725"; model_evidence "Supporting evidence includes similarity to: 25 Proteins"; product "homeotic protein deformed, transcript variant X3"; transcript_biotype "mRNA";
NC_068937.1  Gnomon  exon        2046    2531    .       +       .       gene_id "LOC120427725"; transcript_id "XM_052707445.1"; db_xref "GeneID:120427725"; gene "LOC120427725"; model_evidence "Supporting evidence includes similarity to: 25 Proteins"; product "homeotic protein deformed, transcript variant X3"; transcript_biotype "mRNA"; exon_number "1";
NC_068937.1  Gnomon  exon        52113   52136   .       +       .       gene_id "LOC120427725"; transcript_id "XM_052707445.1"; db_xref "GeneID:120427725"; gene "LOC120427725"; model_evidence "Supporting evidence includes similarity to: 25 Proteins"; product "homeotic protein deformed, transcript variant X3"; transcript_biotype "mRNA"; exon_number "2";

Details for a few columns:

  • seqname — Name of the chromosome, scaffold, or contig
  • source — Name of the program that generated this feature, or the data source (e.g. database)
  • attributes — A semicolon-separated list of key-value pairs with additional information

The course’s main example dataset

Garrigós et al. 2025

Throughout the course, we will use an example/practice dataset from Garrigós et al. (2025):

A screenshot of the paper's front matter.

Experimental design

This paper uses RNA-Seq data to study gene expression in Culex pipiens mosquitoes infected with avian malaria-causing Plasmodium protozoans — specifically, it compares mosquitoes according to:

  • Infection status: control vs. Plasmodium cathemerium vs. P. relictum
  • Time post-infection: 24 hours (hpi) vs. 10 days vs. 21 days (dpi)

The following numbers of biological replicates were used for each treatment combination:

Control P. cathemerium P. relictum
24 hpi 3 3 4
10 dpi 4 4 4
21 dpi 4 4 3

The dataset’s files

To keep things manageable while practicing, I have subset the data to omit the 21 dpi samples and only keep 500,000 reads per FASTQ file.


All in all, the set of files, available through GitHub, consists of:

  • Reads — 44 paired-end, ~75-bp Illumina FASTQ files for 22 samples
  • Reference genome annotation — Culex pipiens GTF file
  • Metadata (sample data) — A table with e.g. treatment info for each sample
  • README — A Markdown file describing the dataset

We’ll download the reference genome assembly FASTA file separately.


Next slide: steps to obtain a count table from raw reads

A diagram of RNA-Seq analysis steps.

Questions?



Click here to go to the next lecture, Working with files in the Unix shell I

Bonus slide: RNA-Seq analysis steps

A diagram showing the steps in an RNA-Seq analysis pipeline.

References

Garrigós, Marta, Guillem Ylla, Josué Martínez-de la Puente, Jordi Figuerola, and María José Ruiz-López. 2025. “Two Avian Plasmodium Species Trigger Different Transcriptional Responses on Their Vector Culex pipiens.” Molecular Ecology 34 (15): e17240. https://doi.org/10.1111/mec.17240.