Monash University · FACULTY OF BIOLOGY

BMS5021 · Introduction to Bioinformatics

- one subject, every graph, every model, every mark
Biology14 Chapters7-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 4 of 11 · BMS5021

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.

In this chapter

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)
Worked example · free

Phred quality score conversion (Week 5, has_math)

Q [3 marks]. A sequencer reports that a particular base call has an error probability P = 0.001. (a) Using the Phred formula Q = -10 log10(P), compute the Phred quality score Q. (b) State the accuracy this corresponds to and why Q30 is called the NGS quality benchmark. (c) In a 200 bp read where every base is Q20, how many miscalled bases would you expect on average? (3 marks)
  • +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.
(a) Q = -10 log10(0.001) = 30 (Q30). (b) Q30 = 1-in-1,000 error = 99.9% accuracy; it is the NGS quality benchmark, the standard threshold for good sequencing data. (c) Q20 = P = 0.01, so a 200 bp all-Q20 read has about 200 x 0.01 = 2 expected miscalled bases.
Sia tip — Learn the Q table as powers of ten - Q10/20/30/40 = 1-in-10/100/1000/10000 - so you can convert either way without a calculator. The formula and its inverse P = 10^(-Q/10) are both fair game; ask Sia to drill fresh Q-to-P conversions and to check your arithmetic.
Glossary

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.
FAQ

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.

Study strategy

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.

A+Everything unlocked
Unlocks this Bible + all 12 of your Monash University subjects - and 1,000+ Bibles across every Australian university.
Sia - your BMS5021 tutor, unlimited, worked the way the exam marks it
The full 7-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$25/ month
30-day money-back · cancel in one tap · how it works
BMS5021 · Introduction to Bioinformatics - independent study guide on the AskSia Library. More Monash University subjects · Microeconomics across all universities
Unlock the full BMS5021 Bible + 12 Monash University subjects解锁完整 BMS5021 Bible + Monash University 12 门科目
$25/mo