BMS5021 · Introduction to Bioinformatics
Command-Line, FASTQ & Sequence Pre-processing
Week 5 of Monash University BMS5021 opens Topic 2 and the hands-on half of the unit: the Unix command line, the sequence file formats (FASTA, FASTQ, SAM/BAM), Phred quality scores and the quality-control-and-trimming step that every RNA-seq analysis begins with. The Phred formula Q = -10 log10(P) is a genuine taught equation with a memorised accuracy table, and pre-processing is the first stage of the Topic 2 RNA-seq report - so this chapter is directly on the assessed pipeline.
What this chapter covers
- 01Bioinformatics runs mostly from the command line: Unix/Linux shell navigation, file management, scripts and loops
- 02FASTA format: '>' header line + sequence lines; FASTQ format: 4 lines per read (identifier, sequence, +, per-base quality)
- 03Alignment/annotation formats: SAM (text) / BAM (binary) / CRAM; GFF/GTF/BED/WIG; VCF stores variants
- 04Phred quality score: Q = -10 log10(P), so P = 10^(-Q/10); Q is the base-call quality, P the error probability
- 05Q-to-accuracy table: Q10 = 90%, Q20 = 99%, Q30 = 99.9% (the NGS benchmark), Q40 = 99.99%
- 06FastQC assesses per-base quality, duplication, adapter content; RNA-seq shows expected early-read composition bias
- 07Read trimming (Trimmomatic, Cutadapt, Trim Galore!): remove low-quality bases and adapters to raise mapping rate and cut false SNPs
- 08Paired-end trimming must keep read pairs in sync (the health-data/QC stage of the ULO2 data life cycle)
Phred quality score conversion (Week 5, has_math)
- +1Substitute into the Phred formula. Q = -10 log10(P) = -10 log10(0.001). Since log10(0.001) = -3, Q = -10 x (-3) = 30. So the base is Q30.
- +1State the accuracy. Q30 corresponds to an error probability of 1 in 1,000, i.e. 99.9% base-call accuracy. Q30 is called the NGS quality benchmark because it is the standard threshold for good next-generation-sequencing data (Q20 = 99%, Q40 = 99.99% by the same table).
- +1Compute the expected errors at Q20. Q20 means P = 10^(-20/10) = 10^(-2) = 0.01, i.e. a 1-in-100 error rate. Over 200 bases the expected number of miscalls is 200 x 0.01 = 2 bases.
Key terms
- FASTQ format
- The standard raw-read format: four lines per read - (1) an @identifier, (2) the sequence, (3) a '+', and (4) per-base quality characters (ASCII-encoded Phred scores).
- Phred quality score (Q)
- A base-call quality measure defined by Q = -10 log10(P), where P is the probability the base is wrong. Higher Q = lower error; the inverse is P = 10^(-Q/10).
- Q30 benchmark
- Q30 = an error probability of 1 in 1,000 = 99.9% base-call accuracy, the standard quality threshold for good next-generation-sequencing data.
- FastQC
- A quality-control tool that summarises a FASTQ file's per-base quality, sequence duplication, adapter content and base composition; in RNA-seq some early-read composition bias and duplication is normal (random hexamer priming).
- Read trimming
- Removing low-quality bases (typically below ~Q20) and adapter sequences with tools such as Trimmomatic or Cutadapt, which increases the mapping rate and reduces false-positive SNPs; paired-end reads must be kept in sync.
- SAM / BAM
- Sequence Alignment/Map formats holding reads aligned to a reference: SAM is human-readable text, BAM is the compressed binary equivalent used for storage and fast access.
Command-Line, FASTQ & Sequence Pre-processing FAQ
How does this chapter feed the assessment?
Week 5 is the first stage of the Topic 2 RNA-seq data-analysis report (35%). Your report begins with quality control (FastQC) and read trimming before any alignment, and you will use the command line and understand FASTQ/Phred to do it. A clean, justified QC-and-trimming step is exactly what markers reward at the start of the pipeline. Confirm submission details on Moodle.
Do I need to be good at the command line already?
No - the unit teaches Unix/bash from basics in the workshop (navigation, file management, simple scripts and loops), because most bioinformatics tools run from the command line. The best preparation is to do the pre-workshop material and then practise the actual commands in the workshop environment rather than only reading about them. Being comfortable at the shell makes the Topic 2 pipeline much smoother.
Why trim reads before aligning?
Because low-quality bases at read ends and leftover adapter sequence reduce how well reads map and inflate false-positive variant calls. Trimming (e.g. with Trimmomatic or Cutadapt) removes them, which raises the overall mapping rate and cleans up downstream results. For paired-end data you must trim both mates together so the pairs stay in sync.
Can AI help me with Phred scores and FASTQ?
Yes. Sia can convert between Q and error probability step by step, explain what each of the four FASTQ lines means, and talk through why a FastQC report looks the way it does for RNA-seq. It explains the method and checks your reasoning; it does not run your graded analysis for you, and Monash University academic-integrity rules apply.
Exam move
Because Week 5 is where the hands-on Topic 2 pipeline starts, split your effort between the maths and the tooling. Memorise the Phred table (Q10/20/30/40 = 1-in-10/100/1000/10000) and practise converting Q to P and back with the formula Q = -10 log10(P) until it is instant. Separately, get real command-line reps: in the workshop environment, run FastQC on a FASTQ file, read the report, and trim with Trimmomatic or Cutadapt, keeping paired-end reads in sync. Know the four FASTQ lines and the SAM/BAM distinction cold. Ask Sia to drill Q conversions and to explain any QC plot you don't understand. Confirm the report's submission rules and any permitted tools on Moodle.
Working through Command-Line, FASTQ & Sequence Pre-processing in BMS5021? Sia is AskSia’s AI Biology tutor — ask any BMS5021 Command-Line, FASTQ & Sequence Pre-processing question and get a clear, step-by-step explanation grounded in how BMS5021 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.