Lesson 16 of 16 · 12 min
A tiny workflow & where to go next
You have learned to read sequences, count them, and think about codons - now let's snap those pieces together into one tiny pipeline. A pipeline is just a series of steps run in order, where the output of one step becomes the input to the next. We will download a real gene from a public database and analyse it, exactly the way a working bioinformatician would.
Our mini-pipeline
Our pipeline has four steps, each one a skill from an earlier lesson: download a sequence by its accession (its unique NCBI ID), count how many records and letters it has, compute the GC content (the percentage of bases that are G or C), and translate its reading frame into a protein. An open reading frame, or ORF, is a stretch of DNA that starts at a start codon and is read three letters (one codon) at a time until a stop codon. Each codon spells one amino acid, and a chain of amino acids is a protein.
# make a project folder and move into it
mkdir actb-mini && cd actb-mini
# efetch downloads a sequence from NCBI by its accession (unique ID).
# NM_001101.5 is the human beta-actin (ACTB) gene; fasta_cds_na gives the coding DNA.
efetch -db nuccore -id NM_001101.5 -format fasta_cds_na > actb_cds.fasta
# in a FASTA file, every record starts with a ">" header line, so this counts the records
grep -c "^>" actb_cds.fasta1
# workflow.py - analyse the downloaded sequence
from Bio import SeqIO # Biopython: a free toolkit for biology
from Bio.SeqUtils import gc_fraction
# read every record from the FASTA file into a list
records = list(SeqIO.parse("actb_cds.fasta", "fasta"))
seq = records[0].seq # the DNA letters of the first record
print("Number of records:", len(records))
print("Sequence length:", len(seq), "bp")
# GC content = fraction of letters that are G or C, shown as a percentage
print(f"GC content: {gc_fraction(seq) * 100:.2f}%")
# translate() reads the DNA three letters (a codon) at a time into amino acids;
# to_stop=True stops at the first stop codon, giving the finished protein
protein = seq.translate(to_stop=True)
print("Protein length:", len(protein), "aa")
print("First 30 amino acids:", protein[:30])Number of records: 1
Sequence length: 1128 bp
GC content: 60.55%
Protein length: 375 aa
First 30 amino acids: MDDDIAALVVDNGSGMCKAGFAGDDAPRAV
Right now these commands live in your terminal history and will vanish. To make the work reproducible - meaning future-you, or a colleague, can rerun it and get the same answer - save the download command in download.sh and the analysis in workflow.py, record the exact tool versions, and write a short README. A README is a plain-text file that explains what the project does and how to run it.
# ACTB mini-pipeline
Download the human beta-actin (ACTB) coding sequence and report its
length, GC content, and translated protein.
## Tools (versions I used)
- Entrez Direct (efetch) 22.4
- Python 3.12
- Biopython 1.84
## How to run
bash download.sh # writes actb_cds.fasta
python workflow.py # prints records, length, GC%, protein
## Expected output
Number of records: 1
Sequence length: 1128 bp
GC content: 60.55%
Protein length: 375 aa
First 30 amino acids: MDDDIAALVVDNGSGMCKAGFAGDDAPRAVTry it yourself: run the whole pipeline end to end. Make the folder, run the efetch command to create actb_cds.fasta, then run python workflow.py. It works if you see five lines printed, ending with First 30 amino acids: MDDDIAALVVDNGSGMCKAGFAGDDAPRAV. If your computer says efetch is not found, install Entrez Direct with conda (conda install -c bioconda entrez-direct) the way you installed tools in the setup lesson.
Where to go next
To go deeper, pick the path that excites you most: Linux for Bioinformatics builds real command-line depth, Python for Biologists turns these snippets into genuine programming, R for Bioinformatics adds statistics and plotting, and Genomics 101 opens up next-generation sequencing and whole genomes. When you want specialised skills, later tracks cover RNA-Seq, Phylogenetics, and Molecular Docking. You began not knowing what a nucleotide was, and you just downloaded a real gene, measured it, and translated it into a protein - so keep going, one small script at a time.