Tuesday, November 24, 2026

Data Visualization in Python: From Reading Graphs to Powerful Libraries



Data visualization is not about making plots look pretty.

It is about thinking with data.

In bioinformatics, data science, ML, or analytics, visualization helps you:

  • detect errors early

  • understand patterns

  • validate assumptions

  • communicate results clearly

This guide is Python‑specific, beginner‑friendly, and deep enough for advanced users. It covers popular libraries, ggplot‑like tools, and underrated but powerful visualization libraries that most learners never explore.


1. The Visualization Stack 

Before learning libraries, understand the layers:

Raw data → Plotting engine → Styling → Interactivity / Export

Most Python visualization tools build on top of each other, not in isolation.

Understanding this prevents confusion.


How to Read Any Graph (Before Touching Any Library)

Before learning how to plot, every learner must learn how to read a plot.

Most confusion in data visualization does not come from code — it comes from misunderstanding what a graph is trying to say.

Think of a graph as a story about data. Your job is to understand that story.


1. Always Identify the Question First

Before looking at colors or shapes, ask:

What question is this graph trying to answer?

Examples:

  • How does quality change across base positions?

  • How does expression differ between conditions?

  • Is there a relationship between X and Y?

If you can’t answer this, the plot has already failed.


2. Understand the X-Axis (What Is Changing?)

The X-axis usually represents:

  • time

  • position

  • categories

  • an independent variable

Ask yourself:

  • Is it continuous or categorical?

  • Does order matter?

  • Are values evenly spaced?

In bioinformatics examples:

  • base position in a read

  • gene names

  • sample groups


3. Understand the Y-Axis (What Is Being Measured?)

The Y-axis answers:

What quantity is being measured?

Examples:

  • expression level

  • quality score

  • coverage depth

  • probability

Always check:

  • units (counts, log scale, percentages)

  • range (is it truncated?)

A misleading Y-axis can completely change interpretation.


4. Check the Scale (Linear vs Log)

Many scientific plots use log scales.

Ask:

  • Is this log2, log10, or linear?

  • Are small differences amplified?

Example:

  • RNA-seq expression often uses log scale

  • Quality scores are linear

Misreading scale = wrong conclusion.


5. Look for Grouping and Color Meaning

Colors, shapes, and line styles are not decoration.

They usually encode:

  • conditions

  • samples

  • categories

Always find the legend and ask:

  • What does each color represent?

  • Are groups comparable?


6. Identify the Type of Plot

Different plots answer different questions:

  • Line plot → trends

  • Scatter plot → relationships

  • Box/violin plot → distributions

  • Histogram → frequency

  • Heatmap → patterns across many variables

If the plot type doesn’t match the question, the plot is wrong.


7. Watch Out for Common Traps

  • Over-plotting (too many points)

  • Missing labels

  • No units

  • Cherry-picked ranges

  • Decorative colors hiding meaning

A good plot should be understandable without the code.


Key Takeaway Before Plotting 

A plot is successful only if a reader can explain it in one sentence. Once you understand how to read graphs, learning matplotlib and other libraries becomes much easier.



2. Matplotlib — The Foundation of Everything

What Matplotlib Actually Is (Conceptually)

Matplotlib is a low-level plotting library. This means it does not try to guess what kind of plot you want or how it should look. Instead, it gives you the building blocks to construct a plot step by step.

Think of matplotlib like drawing on graph paper:

  • You decide where the axes go

  • You decide labels, ticks, titles

  • You decide colors, line styles, markers

This is why it feels verbose — but also why it is powerful.


Why Almost Every Library Depends on Matplotlib

Many popular libraries (pandas plotting, seaborn, scanpy plots) use matplotlib under the hood. When something goes wrong in a plot, knowing matplotlib helps you debug and customize it.

If you skip matplotlib entirely:

  • You struggle with customization later

  • You don’t understand figure/axis errors

  • You depend too much on defaults


How Matplotlib Thinks (Very Important)

Matplotlib has two core objects:

  • Figure → the entire canvas

  • Axes → the actual plot area

Understanding this clears most confusion.

fig, ax = plt.subplots()
ax.plot([1,2,3], [4,5,6])
ax.set_xlabel("X")
ax.set_ylabel("Y")

When Matplotlib Is the Right Choice

Use matplotlib when:

  • You need publication-quality figures

  • You want full control

  • You are making scientific plots

  • You are saving figures for papers


Where Matplotlib Feels Weak

  • Styling takes time

  • Code feels long

  • Not interactive by default

This is why higher-level libraries exist.


3. Seaborn — Statistical Visualization Made Easy

What Seaborn Really Is

Seaborn is a high‑level wrapper around matplotlib.

It focuses on statistics and distributions, not raw plotting mechanics.


When to Use Seaborn

  • Exploring datasets

  • Comparing groups

  • Visualizing distributions

  • Quick EDA (Exploratory Data Analysis)


Common Seaborn Plots

import seaborn as sns

sns.histplot(data=df, x="expression", kde=True)

Popular plots:

  • histplot

  • boxplot

  • violinplot

  • scatterplot

  • heatmap


Why Beginners Love It

  • Looks good by default

  • Minimal code

  • Automatic legends and color handling


Limitations

  • Less control than matplotlib

  • Slower for very large datasets

  • Still static

Seaborn is analysis‑first, not presentation‑first.


4. ggplot‑Like Visualization in Python

Many learners come from R and love ggplot2.

Python has equivalents.


4.1 plotnine — True ggplot Grammar in Python

What It Is

plotnine implements the Grammar of Graphics almost exactly like ggplot2.


Example

from plotnine import *

(
ggplot(df, aes(x='condition', y='expression'))
+ geom_boxplot()
+ theme_minimal()
)

Why It’s Powerful

  • Declarative plotting

  • Clear separation of data and aesthetics

  • Excellent for complex layered plots


Who Should Use It

  • R → Python switchers

  • Publication‑quality figures

  • People who think in layers


Limitation

  • Slower

  • Smaller ecosystem


5. Pandas Built‑in Plotting (Underrated for Beginners)

Why It Exists

Pandas provides .plot() for quick visual checks.


Example

df['expression'].plot(kind='hist')

Best Use Case

  • Fast sanity checks

  • Teaching beginners

  • One‑liner plots

Under the hood, it uses matplotlib.


6. Interactive Visualization Libraries (Modern & Powerful)

Static plots are not always enough.

Interactive plots help when:

  • datasets are large

  • users explore patterns

  • dashboards are needed


6.1 Plotly — Industry Favorite

Why Plotly Is Popular

  • Interactive by default

  • Zoom, hover, pan

  • Works in notebooks & web apps


Example

import plotly.express as px

fig = px.scatter(df, x='gene', y='expression')
fig.show()

Use Cases

  • Dashboards

  • Reports

  • Stakeholder demos

  • ML experiments


Limitation

  • Heavier than matplotlib

  • Learning curve for customization


6.2 Bokeh — Interactive but Lightweight

What Makes Bokeh Different

  • Designed for web

  • Can stream data

  • Good for real‑time plots


Who Uses It

  • Engineers

  • Web‑based analytics

  • Real‑time dashboards


7. Underrated but Extremely Powerful Libraries

These are hidden gems.


7.1 Altair — Declarative & Elegant

Why Altair Is Special

Altair is based on Vega‑Lite.

You describe what you want, not how to draw it.


Example

import altair as alt

alt.Chart(df).mark_point().encode(
x='gene',
y='expression',
color='condition'
)

Strengths

  • Clean syntax

  • Automatic interactivity

  • Excellent for teaching visualization theory


Limitation

  • Dataset size limits


7.2 Holoviews — High‑Level Power

What It Does

Holoviews abstracts plotting completely.

You focus on data, not plotting commands.

Often used with:

  • Bokeh

  • Plotly


Why Experts Love It

  • Very little code

  • Highly expressive

  • Ideal for complex scientific visualizations


7.3 PyViz Ecosystem (Advanced)

Includes:

  • Holoviews

  • Datashader

  • Panel

Used for:

  • Huge datasets

  • Interactive dashboards

  • Scientific apps

This is advanced but extremely powerful.


8. Visualization for Scientific & Bioinformatics Data

Common Bioinformatics Plots

  • Per‑base quality plots (FASTQ)

  • Heatmaps (expression matrices)

  • PCA / UMAP

  • Coverage plots

  • Volcano plots


Typical Library Choices

TaskRecommended Library
QC plotsmatplotlib / seaborn
Heatmapsseaborn
PCA / UMAPmatplotlib + sklearn
Dashboardsplotly
Big datadatashader

9. How to Choose the Right Library (Critical Skill)

Ask three questions:

  1. Static or interactive?

  2. Exploration or presentation?

  3. Small or large dataset?


Quick Decision Guide

  • Learning fundamentals → matplotlib

  • Statistical exploration → seaborn

  • R‑like grammar → plotnine

  • Dashboards → plotly

  • Clean declarative plots → altair

  • Massive data → datashader


10. Final Advice for Learners

Do NOT try to learn all libraries at once.

Recommended order:

  1. matplotlib

  2. seaborn

  3. plotly

  4. one underrated library (Altair or Holoviews)

Once you master one plotting mindset, switching libraries becomes easy.


Final Takeaway

Visualization is a thinking skill, not just a coding skill.

Python gives you multiple tools — each with a purpose.

Good analysts choose the right library, not the most popular one.

That choice separates beginners from professionals.

Working with FASTA & FASTQ in Python



This guide is written for absolute beginners, yet structured deeply enough for intermediate and advanced learners who want a rock-solid conceptual and practical understanding of FASTA and FASTQ files. By the end, you won’t just use these formats — you’ll understand what’s happening under the hood.


1. Why FASTA and FASTQ Matter

Every bioinformatics workflow begins with sequence data.

Before alignment, assembly, variant calling, or expression analysis, your data almost always lives in one of two formats:

  • FASTA → sequence only

  • FASTQ → sequence + quality

If you misunderstand these formats:

  • You misinterpret results

  • You filter incorrectly

  • You trust bad data

So let’s slow down and build intuition properly.


2. FASTA Format — The Simplest Sequence Container

What FASTA Really Is

FASTA is a plain-text format designed to store biological sequences in a human-readable way.

It answers only one question:

What is the sequence?

No probabilities. Just raw letters.


FASTA Structure

>sequence_id optional description
ACTGACTGACTGACTG
ACTGACTG

Rules (Important for Beginners)

  • The first line starts with >

  • Everything after > is metadata (ID + description)

  • The sequence can be:

    • DNA (A, T, G, C, N)

    • RNA (A, U, G, C)

    • Protein (20 amino acids)

  • Sequences can span multiple lines

Computers ignore line breaks — humans benefit from them.


Where FASTA Is Used (Real World Examples)

FASTA files are typically inputs, not raw outputs:

  • Reference genomes (hg38, GRCh38)

  • Transcriptomes (cDNA, mRNA)

  • Protein databases (UniProt)

  • Genome assemblies

  • Contigs and scaffolds

FASTA answers: “What should this look like?”


3. FASTQ Format — FASTA Plus Confidence

Why FASTQ Exists

Sequencing machines do not read bases perfectly.

For every base they output, they also estimate:

How confident am I that this base is correct?

FASTQ stores both the sequence and this confidence.


FASTQ Structure (Four-Line Rule)

@sequence_id
ACTGACTGAC
+
IIIIHHHFFF

What Each Line Means

  1. @ Header (read ID)

  2. Nucleotide sequence

  3. + Separator (may repeat header)

  4. Quality string (ASCII characters)

Critical rule:

The sequence line and quality line must be the same length.


Where FASTQ Is Used

FASTQ files represent raw experimental data:

  • Illumina reads

  • Oxford Nanopore reads

  • PacBio reads

  • QC, trimming, filtering

FASTQ answers: “How confident should I be in this base?”


4. Quality Scores — Phred Scores Made Intuitive

What Is a Phred Score?

A Phred score (Q) measures the probability that a base is wrong.

Formula:

Q = -10 × log10(P_error)

You don’t need to calculate this — just understand what it means.


Common Phred Scores (Memorize This)

PhredError ProbabilityMeaning
Q1010%Very poor
Q201%Acceptable
Q300.1%High quality
Q400.01%Excellent

Most pipelines aim for Q30 or higher.


Why FASTQ Uses ASCII Characters

Storing numbers for every base would be inefficient.

So FASTQ uses a trick:

ASCII_character = Phred_score + 33

Example:

  • Phred 30 → 30 + 33 = 63 → ?

This is why quality lines look like random symbols.


5. Reading FASTA Manually

Before libraries, learn the logic.

sequences = {}
current_id = None

with open("input.fasta") as f:
for line in f:
line = line.strip()
if line.startswith(">"):
current_id = line[1:]
sequences[current_id] = ""
else:
sequences[current_id] += line

What This Teaches

  • Files are read line by line

  • Headers control context

  • Sequences may be multi-line

  • Dictionaries mirror FASTA structure

This removes fear of bioinformatics files.


6. FASTA with Biopython — The Professional Way

Once logic is clear, use tools.

from Bio import SeqIO

for record in SeqIO.parse("input.fasta", "fasta"):
print(record.id)
print(len(record.seq))

What Biopython Gives You

  • SeqRecord objects

  • Clean parsing

  • Automatic handling of multi-line sequences

  • Easy writing and filtering

This is how real scripts are written.


7. Parsing FASTQ — Sequence Meets Quality

from Bio import SeqIO

for record in SeqIO.parse("reads.fastq", "fastq"):
seq = str(record.seq)
qualities = record.letter_annotations["phred_quality"]

What You Can Access

  • Full sequence

  • Per-base quality list

  • Mean read quality

  • Read length

Biopython decodes ASCII automatically.


8. ASCII to Quality — Seeing Behind the Curtain

Manual decoding logic:

phred = ord(char) - 33

Why this matters:

  • Debugging corrupted FASTQ

  • Understanding QC tools

  • Interview-level knowledge

Experts know why, not just how.


9. Quality-Based Filtering (Core NGS Skill)

Per-Read Filtering

Remove reads with:

  • Mean quality < Q20

  • Length below threshold

if sum(qualities) / len(qualities) >= 20:
keep = True

Why This Is Crucial

  • Low-quality reads misalign

  • Increase false variants

  • Waste computation

QC is always step one.


10. Trimming Low-Quality Ends

Sequencing quality drops at the 3′ end.

Basic trimming logic:

while qualities and qualities[-1] < 20:
qualities.pop()

This is the core idea behind:

  • Trimmomatic

  • fastp

  • Cutadapt

Tools are just optimized versions of this logic.


11. Mini-Project: Build a “Nano-FastQC” Tool (Step-by-Step)

Your script will behave like a tiny version of FastQC:

INPUT
Raw FASTQ file

PROCESS
1. Read sequences
2. Read quality scores
3. Calculate statistics
4. Visualize quality
5. Remove bad reads

OUTPUT
Clean FASTQ file
Quality plot

So the pipeline looks like:

FASTQ → QC analysis → filtering → cleaned FASTQ

Step 0: Requirements 

Python libraries needed

pip install biopython matplotlib

Why?

  • Biopython → read FASTQ safely (no manual parsing errors)

  • matplotlib → quality plots like FastQC


Step 1: Read a FASTQ File

Why this step matters

FASTQ files are large, structured, and easy to break if read incorrectly.
Biopython handles this safely.

Code

from Bio import SeqIO fastq_file = "reads.fastq" records = list(SeqIO.parse(fastq_file, "fastq")) print("Total reads:", len(records))

What learners should understand

  • Each read becomes a SeqRecord object

  • records is a list of reads

  • This is memory-safe for small/medium FASTQ (perfect for learning)


Step 2: Extract Sequence and Quality Scores

What’s inside one FASTQ read?

Each read contains:

  • DNA sequence

  • Per-base Phred quality scores

Code

record = records[0] sequence = str(record.seq) qualities = record.letter_annotations["phred_quality"] print(sequence) print(qualities)

Explain clearly

  • sequence → "ACTG..."

  • qualities → [38, 37, 36, 35, ...]

  • Each number maps to one base

This one-to-one mapping is critical.


Step 3: Compute Per-Read Average Quality

Why this matters

Low-quality reads:

  • Align poorly

  • Increase false positives

  • Waste computation

So we calculate mean quality per read.

Code

def mean_quality(qualities): return sum(qualities) / len(qualities)

Usage:

avg_q = mean_quality(qualities) print("Average quality:", avg_q)

Teaching note

Tell learners:

“This single number decides whether a read lives or dies.”


Step 4: Compute Per-Base Quality (Across All Reads)

Why this matters

FastQC plots:

  • X-axis → base position

  • Y-axis → average quality at that position

We’ll recreate that logic.


Step 4.1: Prepare storage

max_length = max(len(r.seq) for r in records) base_qualities = [[] for _ in range(max_length)]

What this creates:

base_qualities[0] → qualities of base 1 from all reads base_qualities[1] → qualities of base 2 from all reads ...

Step 4.2: Fill base-wise qualities

for record in records: quals = record.letter_annotations["phred_quality"] for i, q in enumerate(quals): base_qualities[i].append(q)

Step 4.3: Average per base

avg_base_quality = [ sum(qs) / len(qs) if qs else 0 for qs in base_qualities ]

Now you have FastQC-style data.


Step 5: Plot Base Quality Distribution

Why plotting is important

Humans understand patterns visually, not from tables.

Typical Illumina pattern:

  • High quality at start

  • Drop at 3′ end


Code (Simple & Clean)

import matplotlib.pyplot as plt plt.figure() plt.plot(avg_base_quality) plt.xlabel("Base position") plt.ylabel("Average Phred Quality") plt.title("Per-base Quality Distribution") plt.show()

Teaching insight

  • Falling curve → trimming needed

  • Flat high curve → excellent run

  • Sudden drops → sequencing issue


Step 6: Filter Low-Quality Reads

Define your rule (important!)

We choose:

  • Mean quality ≥ Q20

why?? Because:

  • Q20 = 1% error

  • Industry minimum standard


Code

filtered_records = [] for record in records: qualities = record.letter_annotations["phred_quality"] if mean_quality(qualities) >= 20: filtered_records.append(record) print("Reads after filtering:", len(filtered_records))

Filtering is:

  • NOT deleting randomly

  • A data-quality decision


Step 7: Trim Low-Quality Ends

Why trimming is separate from filtering

  • Filtering removes entire reads

  • Trimming fixes partially bad reads


Basic trimming logic (3′ end)

def trim_read(record, threshold=20): seq = str(record.seq) quals = record.letter_annotations["phred_quality"] while quals and quals[-1] < threshold: quals.pop() seq = seq[:-1] record.seq = record.seq.__class__(seq) record.letter_annotations["phred_quality"] = quals return record

Use it:

trimmed_records = [trim_read(r) for r in filtered_records]

Step 8: Write Clean FASTQ Output

Why this step is crucial

QC without output = useless.
Pipelines expect clean FASTQ.


Code

from Bio import SeqIO SeqIO.write(trimmed_records, "clean_reads.fastq", "fastq")

Now learners have:

  • Input FASTQ

  • Output FASTQ

  • Quality plot


Final Result: What you Built

They now have a tool that can:

✅ Read FASTQ
✅ Understand quality scores
✅ Reproduce FastQC logic
✅ Visualize sequencing quality
✅ Filter poor reads
✅ Output clean data


Why This Is a STRONG Portfolio Project

You can confidently say:

“I understand FASTQ internally — not just how to run tools.”

This project proves:

  • Python skills

  • NGS understanding

  • QC logic

  • Pipeline thinking


Skills Gained

  • FASTQ parsing mastery

  • Quality interpretation

  • Visualization thinking

  • Pipeline logic

  • Portfolio-ready project

This bridges theory → real bioinformatics work.


Final Takeaway

FASTA and FASTQ are not “just file formats”.

They represent:

  • Biological truth

  • Experimental uncertainty

  • Data quality

Once you understand them deeply, every downstream tool makes sense.

This foundation separates users from bioinformaticians.



💬 Join the Conversation:

What was the most interesting or surprising thing you learned from this Nano-FastQC mini-project?

If you were to improve this tool, what feature would you add next and why?



If this post helped you understand FASTQ better,
drop a 👍 or comment “QC makes sense now” — it helps others find this tutorial too.

Nextflow and Snakemake for Complete Beginners: What They Are, Why They Matter, and How to Start From Zero

If you're a biology student, a researcher, or someone switching into bioinformatics, you've probably seen words like pipeline, Nextflow, Snakemake, conda and workflow everywhere and nobody explains them from scratch, so they feel scary.

This blog fixes that. By the end, you'll know:

  • what a pipeline is and why bioinformatics needs workflow managers
  • what Nextflow and Snakemake are
  • what Java, Python, conda and mamba are, and why they come up
  • how to install everything
  • how to practice with a tiny project
  • where these tools are used in real life
  • how to keep learning after this

No prior knowledge needed. Let's go.


Part 1: The Basics

What is a pipeline?

In bioinformatics, you rarely do just one thing to your data. You do many steps, one after another.

For example, in an RNA-seq analysis:

  1. Check quality of raw reads (FastQC)
  2. Trim bad parts (Trimmomatic or fastp)
  3. Align reads to a genome (STAR or HISAT2)
  4. Count reads per gene (featureCounts)
  5. Combine results across samples and compare conditions

The output of step 1 goes into step 2, step 2 goes into step 3, and so on. This chain of steps is called a pipeline (or workflow).

Think of it like cooking. A recipe has steps: wash rice, boil water, cook rice, add salt. A pipeline is a recipe for your data.

Why not just run commands one by one?

You can, and when you're learning, you should. But in real projects:

  • You might have 50 or 500 samples. Typing commands 500 times is not practical.
  • A step fails at sample 37. Do you restart everything?
  • Your colleague asks "how did you get this result?" and you can't remember which tool version or settings you used.
  • You move from your laptop to a university server (HPC) or cloud, and everything breaks.

A simple bash script helps, but it still doesn't solve most of this.

What is a workflow manager?

A workflow manager is software that runs your pipeline for you, and does it smartly. It:

  • runs steps in the correct order
  • runs independent samples in parallel (at the same time)
  • resumes from where it failed instead of starting over
  • keeps your analysis reproducible (same input gives same output, on any computer)
  • works on your laptop, HPC clusters and cloud with little change

Nextflow and Snakemake are the two most popular workflow managers in bioinformatics.


What is Nextflow?

Nextflow is a workflow manager built for data-heavy pipelines. You write your pipeline as processes (steps) connected by channels (the pipes that carry data between steps). It's based on a language called Groovy, which runs on Java. You don't need to learn Java itself, but you do need Java installed.

Nextflow is very popular in genomics and has a huge community project called nf-core, which provides ready-made, well-tested pipelines (RNA-seq, variant calling, single-cell and more). Many labs and companies use it.

What is Snakemake?

Snakemake is a workflow manager written in Python. You write your pipeline in a file called a Snakefile, using rules. Each rule says: "to make this output, take this input and run this command."

Snakemake works backwards. You say what final files you want, and it figures out which rules to run. If you know a little Python, Snakemake feels natural, because the Snakefile is an extension of Python syntax.

What is the role of these tools in bioinformatics?

Workflow managers sit in the middle of your analysis. They don't analyze data themselves. They coordinate the tools that do.

Your raw data
↓
[ Workflow manager: Nextflow / Snakemake ]
↓ runs, in order and in parallel:
FastQC → fastp → aligner → counting → MultiQC
↓
Final results

Their role is to make your analysis automated, scalable and reproducible. Reproducibility matters a lot in science. If someone else can't repeat your analysis, it's hard to trust it.


Part 2: The Supporting Cast (Java, Python, conda, mamba)

Beginners get confused because installing Nextflow or Snakemake involves other things. Here's what each one is.

What is Java and why does Nextflow need it?

Java is a programming language and runtime. Nextflow is built on top of it, so Java has to be installed on your computer for Nextflow to run. Think of Java as the engine, and Nextflow as the car built on it.

  • You do not need to write Java code.
  • You only need the Java runtime installed, in a version that Nextflow supports (a recent version like 17 or higher; check the Nextflow docs for the current requirement).

What is Python and why does Snakemake need it?

Python is a popular programming language, very common in bioinformatics. Snakemake is written in Python, and a Snakefile uses Python-like syntax. Having Python available is required, and knowing basic Python helps a lot when your Snakefiles get more advanced.

You don't need to be a Python expert to start. Variables, lists and basic loops are enough for a first pipeline.

What is conda?

Bioinformatics tools are installed in complicated ways. Each tool needs specific versions of other software (called dependencies), and these often conflict with each other.

Conda is a package and environment manager that solves this. It lets you:

  • install software with one command
  • create separate environments, like isolated boxes, where each project has its own tool versions

For example, one environment can have an old version of a tool for Project A and a new version for Project B, without them fighting.

Most people install conda through Miniconda or Miniforge, which are lightweight installers.

What is Bioconda?

Bioconda is a "channel" (think: a software store) for conda that contains thousands of bioinformatics tools: samtools, bwa, fastqc, and Snakemake itself. This is why you'll see -c bioconda in install commands.

What is mamba?

Mamba is a faster replacement for conda. It does the same job, but resolves and installs packages much more quickly. The commands are almost identical, so wherever you see conda install, you can usually write mamba install instead. If you install Miniforge, you typically get mamba along with conda.

How do they all fit together?

ToolWhat it isRole in your workflow
Linux/terminalThe command-line interfaceWhere you run everything
JavaRuntime/engineNeeded to run Nextflow
PythonProgramming languageNeeded for Snakemake
conda / mambaPackage and environment managerInstalls tools and keeps versions organized
BiocondaSoftware repository for biology toolsSource of bioinformatics tools
Nextflow / SnakemakeWorkflow managersRun your multi-step pipeline automatically

Part 3: Before You Start (Prerequisites)

1. Basic Linux

Workflow managers are used from the terminal. Get comfortable with:

  • pwd, ls, cd: see where you are, list files, move around
  • mkdir, cp, mv, rm: make, copy, move, delete
  • cat, head, less: look inside files
  • nano or vim: edit files

Even a few days of Linux practice is enough to start.

2. If you use Windows

Install WSL (Windows Subsystem for Linux), which gives you a real Linux terminal inside Windows. Most bioinformatics tools work best on Linux or macOS, so it's worth setting up.

3. A text editor

VS Code is a great choice, and it works with WSL too.

4. Basic Python (recommended for Snakemake)

Just the fundamentals to begin with.


Part 4: Installation, Step by Step

Step 1: Install Miniforge (conda + mamba)

Go to the Miniforge GitHub page, download the installer for your system, and follow the instructions. After installing, close and reopen your terminal and check:

bash
conda --version
mamba --version

Step 2: Create a practice folder

bash
mkdir workflow_practice
cd workflow_practice
mkdir data

Step 3: Create tiny test data

No real data needed. We'll make two small fake FASTQ files:

bash
printf "@read1\nACGTACGT\n+\nIIIIIIII\n@read2\nTTGGCCAA\n+\nIIIIIIII\n" > data/sample1.fastq
printf "@read1\nGGGGCCCC\n+\nIIIIIIII\n@read2\nAAAATTTT\n+\nIIIIIIII\n@read3\nCGCGCGCG\n+\nIIIIIIII\n" > data/sample2.fastq

Sample 1 has 2 reads and sample 2 has 3 reads. Our goal is a pipeline that counts reads per sample. Small, but the idea is the same as in big pipelines.

Step 4: Install Snakemake

bash
mamba create -c conda-forge -c bioconda -n snakemake snakemake
conda activate snakemake
snakemake --version

What this does:

  • create -n snakemake makes a new environment named "snakemake"
  • -c conda-forge -c bioconda tells it where to download from
  • conda activate snakemake enters that environment

Any time you open a new terminal, run conda activate snakemake again before using it.

Step 5: Install Nextflow

Option A (using conda/mamba, which also takes care of Java in the same environment):

bash
mamba create -c conda-forge -c bioconda -n nextflow nextflow
conda activate nextflow
nextflow -version

Option B (official installer): first check Java with java -version. If missing, install a supported version, then:

bash
curl -s https://get.nextflow.io | bash
chmod +x nextflow
mv nextflow ~/bin/

Make sure ~/bin is in your PATH. If anything differs on your system, the official Nextflow installation docs have the latest instructions.


Part 5: Your First Snakemake Pipeline

Activate the environment and make sure you're in workflow_practice:

bash
conda activate snakemake

The idea

Snakemake thinks backwards: "I want these final files. What rules do I need to run to get them?"

Write the Snakefile

Create a file named exactly Snakefile (capital S, no extension):

python
SAMPLES = ["sample1", "sample2"]

rule all:
input:
expand("results/{sample}.count.txt", sample=SAMPLES)
rule count_reads:
input:
"data/{sample}.fastq"
output:
"results/{sample}.count.txt"
shell:
"echo $(( $(wc -l < {input}) / 4 )) > {output}"

Understand it line by line

  • SAMPLES = [...] is a normal Python list of sample names
  • rule all lists the final files we want. It's the "goal" of the pipeline
  • expand(...) builds the list of output files for each sample
  • rule count_reads is the actual step
  • {sample} is a wildcard, a placeholder Snakemake fills in for each sample
  • A FASTQ read takes 4 lines, so lines divided by 4 gives the read count

Run it

Always do a dry run first (shows what would happen, without running):

bash
snakemake -n

Then the real run:

bash
snakemake --cores 2
cat results/*.count.txt

You should see 2 and 3.

See the smart behavior

Run snakemake --cores 2 again. It says nothing needs to be done, because outputs already exist. Edit data/sample1.fastq and run again, and only sample1 re-runs.


Part 6: Your First Nextflow Pipeline

Activate the environment:

bash
conda activate nextflow

Test the install

bash
nextflow run hello

If it prints "Hello world!" style output, Nextflow works.

The 3 core concepts

  1. Process: one step (command, inputs, outputs)
  2. Channel: the pipe that carries data between steps
  3. Workflow: where you connect processes together

Write the pipeline

Create main.nf:

groovy
params.reads = "data/*.fastq"

process COUNT_READS {
publishDir "results_nf", mode: 'copy'
input:
path fastq
output:
path "${fastq.simpleName}.count.txt"
script:
"""
echo \$(( \$(wc -l < ${fastq}) / 4 )) > ${fastq.simpleName}.count.txt
"""
}
workflow {
reads_ch = Channel.fromPath(params.reads)
COUNT_READS(reads_ch)
}

Understand it

  • params.reads is a parameter: where input files are
  • Channel.fromPath collects all matching files and sends them into the process
  • COUNT_READS runs once per file, in parallel
  • publishDir copies final outputs to a clean results folder
  • Inside the script block, \$ is used so the shell (not Nextflow) handles the $ signs

Run it

bash
nextflow run main.nf
cat results_nf/*.count.txt

The magic flag: -resume

bash
nextflow run main.nf -resume

Finished tasks show as cached and are skipped. Nextflow stores all intermediate work in a work/ folder with hash-named subfolders. Don't be scared by those, and don't delete work/ if you want resume to work.


Part 7: Nextflow vs Snakemake

NextflowSnakemake
Based onGroovy (runs on Java)Python
Thinking styleData flows through channelsRules produce output files (backwards)
Feels easier ifYou like dataflow/pipeline thinkingYou already know Python
Ready-made pipelinesnf-core (very large collection)Snakemake workflow catalog
Resume-resume flagAutomatic, based on files
PreviewNot a direct equivalentsnakemake -n dry run
Runs onLaptop, HPC, cloudLaptop, HPC, cloud

Neither is "better". Both are widely used. Which one you need often depends on your lab, your company or your job description, so learning both makes you more flexible.


Part 8: Where Are These Used? (Applications)

Workflow managers are used wherever data analysis has many steps and many samples:

  • RNA-seq analysis: QC, alignment, counting, differential expression
  • Variant calling (DNA-seq / exome / genome): finding mutations
  • Single-cell analysis: processing large single-cell datasets
  • Metagenomics: identifying microbes in samples
  • ChIP-seq / ATAC-seq: regulatory genomics
  • Genome assembly and annotation
  • Clinical and diagnostic genomics: where reproducibility and traceability matter
  • Pharma and biotech pipelines: standardized, repeatable analysis at scale
  • Research labs: sharing pipelines along with a publication so others can reproduce the work

If you look at bioinformatics job descriptions, you'll often see "experience with Nextflow or Snakemake" listed, especially for roles involving NGS data.


Part 9: How to Start Practicing (Roadmap)

Week 1: Linux basics. Navigation, files, editing, pipes.

Week 2: Conda/mamba. Create environments, install tools like samtools or fastqc, export an environment.

Week 3: Run tools manually. Run FastQC and one more tool on a small sample by hand. Understand inputs and outputs.

Week 4: Your first workflow. Rebuild the tiny pipeline from this post in one tool (Snakemake if you know Python, Nextflow otherwise), then in the other.

Week 5+: Grow it.

  • Replace the read counting with a real tool (FastQC, fastp)
  • Add a second and third step
  • Add a config file for parameters
  • Try containers (Docker or Singularity) later, so that tools come packaged

Then: Run a community pipeline (nf-core) on a small test dataset, just to see how a professional pipeline is structured.

Good practice project ideas

  1. Count reads in several FASTQ files (what we did)
  2. FastQC on multiple samples, then combine with MultiQC
  3. Trim reads and then run QC again
  4. A mini RNA-seq pipeline on a small public dataset

Free resources

  • Official Nextflow documentation and training material
  • nf-core website (tutorials and pipelines)
  • Official Snakemake documentation and tutorial
  • Official Miniforge/conda documentation

Part 10: Common Beginner Mistakes

  • Skipping Linux. If the terminal feels strange, workflow tools will feel 10x harder.
  • Forgetting to activate the environment. "Command not found" often just means you didn't run conda activate.
  • Wrong Snakefile name. It must be Snakefile unless you point to another name.
  • Mixing tabs and spaces in Snakemake. Use consistent 4-space indentation.
  • Deleting Nextflow's work/ folder and then wondering why -resume doesn't work.
  • Starting with a giant pipeline. Start tiny, then grow.
  • Installing everything in one environment. Make a separate environment per project or tool set.
  • Copy-pasting without understanding. Change something on purpose, break it, and fix it. That's how it sticks.

Final Thoughts

Nextflow and Snakemake look intimidating, but they're just tools to organize and automate the steps you already do manually. Once you understand the ideas (steps, inputs, outputs, environments), the syntax becomes easy to pick up.

You don't need to learn everything at once. Install the tools, run the tiny pipeline from this post, and then improve it one step at a time. That's how every bioinformatician started.


Conclusion

Nextflow and Snakemake can look scary at first, but they're just tools that automate the same steps you'd otherwise run by hand, again and again. Once you understand the basic ideas (inputs, outputs, steps, environments), the syntax becomes much easier to pick up.

Here's what we covered:

  • A pipeline is a chain of analysis steps, and a workflow manager runs it for you in an automated, reproducible and scalable way.
  • Nextflow (built on Java) and Snakemake (built on Python) are the two most popular workflow managers in bioinformatics.
  • Conda and mamba keep your tools and versions organized, and Bioconda is where most bioinformatics tools live.
  • You can practice with tiny fake files, and you don't need big datasets or a server to begin.

Don't try to learn everything in one go. Pick one tool, run the small pipeline from this post, then change something on purpose, break it, and fix it. That is how you really learn. Start small, stay consistent, and grow one step at a time.

If you're a student or career switcher, remember that nobody starts as an expert. Every bioinformatician once stared at their first error message and had no idea what it meant. Keep going.

If you get stuck anywhere, drop a comment below and I'll help you out. And tell me: which one are you starting with, Nextflow or Snakemake?



For more beginner-friendly bioinformatics content, follow BI23 (Bioinformatics Made Easy) on YouTube and LinkedIn, and if you want personal guidance, you can book a 1:1 session with me on Topmate.

Happy learning! 🧬

Editor’s Picks and Reader Favorites

The 2026 Bioinformatics Roadmap: How to Build the Right Skills From Day One

  If the universe flipped a switch and I woke up at level-zero in bioinformatics — no skills, no projects, no confidence — I wouldn’t touch ...