The aim of this project is to learn the basic workflow of analyzing Illumina sequencing data from raw reads to aligned reads and basic downstream analysis.
The focus is on bacterial whole-genome DNA sequencing (not RNA-seq initially), using a small bacterial genome such as E. coli as a practice dataset.
The main concepts to understand are:
- What raw sequencing reads look like
- How paired-end sequencing works
- How FASTQ files store reads and quality scores
- How reference genomes are stored in FASTA format
- How reads are aligned to a reference genome
- How SAM/BAM files represent alignments
- How to calculate genome coverage from BAM files
- How sequencing data can later be used for variant analysis
Reference genome
(FASTA)
|
|
+----------------+
|
v
Raw sequencing reads --> Alignment
(FASTQ R1/R2) (Bowtie2)
|
v
SAM file
|
v
BAM file + index
|
+-----------+-----------+
| |
v v
Coverage Variants
Contains reference sequences.
Example:
>chromosome
ATGCGATCGATCG...
Used for:
- bacterial genomes
- assembled sequences
- reference databases
Contains raw sequencing reads.
Each read has:
- Identifier
- Sequence
- Separator
- Quality scores
Example:
@read001
ATGCGATCG
+
FFFFFFFF
Paired-end sequencing produces:
sample_R1.fastq
sample_R2.fastq
where R1 and R2 are the two reads originating from the same DNA fragment.
Alignment formats.
They store information such as:
- read name
- genomic position
- strand
- mapping quality
- paired-end information
BAM is the compressed binary version of SAM.
The main tools used in this tutorial:
-
fasterq-dumpConverts NCBI SRA datasets into FASTQ files. -
bowtie2Aligns FASTQ reads against a reference genome. -
samtoolsConverts, sorts, indexes, and analyzes BAM files.
Create a dedicated conda environment:
conda create -n sequencing-practice -c bioconda \
sra-tools bowtie2 samtoolsActivate:
conda activate sequencing-practiceExample dataset:
- Organism: Escherichia coli K-12
- Data type: Illumina paired-end whole-genome sequencing
- Source: NCBI Sequence Read Archive (SRA)
Required files:
reference.fasta
sample_R1.fastq.gz
sample_R2.fastq.gz
datasets download genome accession GCF_000005845.2 --include genome,gff3
- Download sequencing reads from SRA.
We use this dataset: https://www.ncbi.nlm.nih.gov/sra?linkname=bioproject_sra_all&from_uid=203751.
- Convert SRA data to FASTQ:
fasterq-dump ACCESSION --split-files- Build a genome index:
bowtie2-build reference.fasta genome_indexThe genome index is a somewhat technical idea to go through the reference efficiently.
- Align reads:
bowtie2 \
-x genome_index \
-1 sample_R1.fastq \
-2 sample_R2.fastq \
-S alignment.sam- Convert and process alignments:
samtools view -b alignment.sam > alignment.bam
samtools sort alignment.bam -o alignment.sorted.bam
samtools index alignment.sorted.bam- Generate coverage:
samtools depth alignment.sorted.bam > coverage.txt- FASTQ = what the sequencer observed.
- FASTA = what the reference genome is.
- SAM/BAM = where the observed reads map on the reference.
- Coverage = how many reads support each genomic position.
- Annotation files (GFF/GTF) are separate and are used later to interpret genomic positions as genes or other features.
The goal is to understand the complete path:
sequencing machine
↓
FASTQ reads
↓
alignment
↓
BAM file
↓
genome-level interpretation