Skip to content
Home›INSIGHTS & RESOURCES›RNA-Seq Data Analysis Step by Step for Beginners (FastQC to DESeq2)
INSIGHTS & RESOURCES

RNA-Seq Data Analysis Step by Step for Beginners (FastQC to DESeq2)

1 December 2026Articles

RNA sequencing (RNA-seq) measures which genes are switched on in a sample and by how much. It is the most common type of sequencing analysis in biology, and it is the first real pipeline most bioinformatics students learn.

This guide walks through RNA-seq data analysis step by step, from raw reads to a list of differentially expressed genes. We use widely used free tools: FastQC, MultiQC, fastp, HISAT2, SAMtools, featureCounts and DESeq2. Each step has the command, what it does and what to check.

You need a Linux or macOS terminal (or WSL on Windows), Conda, and R. If the command line is new to you, start with our free Linux and Conda tutorials.

The pipeline at a glance

  1. Get the data (FASTQ files, reference genome, annotation)
  2. Quality control (FastQC, MultiQC)
  3. Trimming (fastp)
  4. Alignment to the genome (HISAT2)
  5. Sort and index alignments (SAMtools)
  6. Count reads per gene (featureCounts)
  7. Differential expression (DESeq2 in R)
  8. Interpret and visualise results

Step 0: Set up the environment

conda create -n rnaseq -c conda-forge -c bioconda \
  fastqc multiqc fastp hisat2 samtools subread sra-tools
conda activate rnaseq

The subread package provides featureCounts. Install DESeq2 in R with Bioconductor: BiocManager::install("DESeq2").

Step 1: Get the data

Public RNA-seq data is stored in NCBI’s Sequence Read Archive (SRA). Download runs with the SRA Toolkit (replace the accession with your own):

prefetch SRR000001
fasterq-dump --split-files SRR000001

You also need the reference genome (FASTA) and gene annotation (GTF) for your organism, from Ensembl or GENCODE. Use matching versions of both. Plan at least three biological replicates per condition; fewer makes the statistics unreliable.

Step 2: Quality control

mkdir -p qc
fastqc *.fastq -o qc/
multiqc qc/ -o qc/

Open the MultiQC report. Check per-base quality (should stay high, usually above Phred 28 for most of the read), adapter content, and overrepresented sequences. Some warnings, such as sequence duplication, are normal for RNA-seq because highly expressed genes produce many identical reads. Our FastQC and MultiQC tutorial explains each module.

Step 3: Trimming

fastp -i sample_1.fastq -I sample_2.fastq \
  -o sample_1.trim.fastq -O sample_2.trim.fastq \
  -h sample_fastp.html -w 4

fastp detects and removes adapters and low-quality bases automatically. Re-run FastQC on trimmed files if quality was poor. If your data is already clean, light trimming is enough.

Step 4: Align reads to the genome

hisat2-build genome.fa genome_index
hisat2 -p 8 -x genome_index \
  -1 sample_1.trim.fastq -2 sample_2.trim.fastq \
  2> sample.hisat2.log | samtools sort -@ 4 -o sample.sorted.bam -
samtools index sample.sorted.bam

HISAT2 is a splice-aware aligner, which matters because RNA reads cross exon junctions. Building the index for a human-sized genome needs a lot of memory; many labs download a pre-built index instead. Check the overall alignment rate in the log: for a good human or mouse sample it is usually high (often above 80–90%). A very low rate suggests the wrong reference, contamination or poor-quality reads.

Alternative: tools such as Salmon or kallisto skip full alignment and estimate transcript abundance directly. They are faster and widely used; their output can also go into DESeq2 (via tximport).

Step 5: Count reads per gene

featureCounts -p --countReadPairs -T 8 \
  -a annotation.gtf -o counts.txt *.sorted.bam

For paired-end data, -p --countReadPairs counts fragments rather than individual reads. Check counts.txt.summary: most reads should be “Assigned”. A large “Unassigned_NoFeatures” fraction can mean a mismatch between genome and annotation versions. If your library is strand-specific, set -s 1 or -s 2 to match the protocol.

Step 6: Differential expression with DESeq2

library(DESeq2)
counts <- read.table("counts.txt", header = TRUE, row.names = 1, skip = 1)
counts <- counts[, 6:ncol(counts)]        # keep only sample columns
coldata <- data.frame(row.names = colnames(counts),
  condition = factor(c("control","control","control",
                       "treated","treated","treated")))
dds <- DESeqDataSetFromMatrix(countData = counts,
                              colData = coldata, design = ~ condition)
dds <- dds[rowSums(counts(dds)) >= 10, ]   # remove very low counts
dds <- DESeq(dds)
res <- results(dds, contrast = c("condition", "treated", "control"))
res <- res[order(res$padj), ]
write.csv(as.data.frame(res), "deseq2_results.csv")

DESeq2 works on raw counts. Do not give it TPM or FPKM values; it does its own normalisation. Make sure the order of samples in coldata matches the columns of the count table.

Step 7: Check and visualise

vsd <- vst(dds)
plotPCA(vsd, intgroup = "condition")
plotMA(res, ylim = c(-5, 5))
  • PCA plot: replicates of the same condition should cluster together. An outlier sample may need investigation.
  • MA plot and volcano plot: show which genes change and by how much.
  • Significant genes: a common starting threshold is adjusted p-value (padj) < 0.05; many studies also require |log2 fold change| > 1.

Step 8: Interpret the results

A list of genes is not the final answer. Use functional enrichment (Gene Ontology, KEGG pathways) to understand what the changed genes do, with tools such as clusterProfiler in R. Relate results back to your biological question, and validate key genes (for example by qPCR) when possible.

Common beginner mistakes

  • Using genome and annotation files from different releases.
  • Running differential expression with only one or two replicates.
  • Giving normalised values (TPM/FPKM) to DESeq2 instead of raw counts.
  • Ignoring the PCA plot and missing a mislabelled or failed sample.
  • Setting the wrong strandedness in featureCounts.

Learn it properly

Running these commands once is the start. To become job-ready you need to handle real, messy datasets, choose parameters with reasons, and explain your results. Our RNA-Seq Data Analysis course covers the full workflow on real data in live and recorded formats. For background, read What is Transcriptomics? and types of RNA and their functions.

FAQs

What are the steps of RNA-seq data analysis?

Quality control, trimming, alignment (or pseudo-alignment), counting reads per gene, normalisation and differential expression, followed by visualisation and functional interpretation.

Which tool is best for RNA-seq alignment?

HISAT2 and STAR are the most common splice-aware aligners. Salmon and kallisto are popular faster alternatives that estimate transcript abundance without full alignment.

How many replicates do I need for RNA-seq?

At least three biological replicates per condition is the usual minimum; more gives better statistical power.

Can I do RNA-seq analysis on a laptop?

Small datasets and non-human organisms, yes. Human genome indexing and large projects usually need a server, HPC or cloud machine with more memory.

Why does DESeq2 need raw counts?

Its statistical model is built for count data and includes its own normalisation, so pre-normalised values give wrong results.

Key takeaways

  • RNA-seq analysis follows QC → trimming → alignment → counting → DESeq2.
  • Always check MultiQC, alignment rates and featureCounts summaries.
  • Use matching genome and annotation versions.
  • Give DESeq2 raw counts and at least three replicates per group.
  • Interpret gene lists with enrichment analysis and biology.

References

  • Love MI, Huber W, Anders S. Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome Biology. 2014;15:550.
  • Kim D, Paggi JM, Park C, Bennett C, Salzberg SL. Graph-based genome alignment and genotyping with HISAT2 and HISAT-genotype. Nature Biotechnology. 2019;37:907–915.
  • Liao Y, Smyth GK, Shi W. featureCounts: an efficient general purpose program for assigning sequence reads to genomic features. Bioinformatics. 2014;30(7):923–930.
  • Chen S, Zhou Y, Chen Y, Gu J. fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics. 2018;34(17):i884–i890.