Module 8

Validating sequences

Checking that a sequence contains only valid bases.

Is this a valid sequence?

A valid DNA sequence contains only A, T, G, and C. You can check this by verifying that the length equals the count of valid bases.

Python
seq = "ATGCGTA"
valid = seq.count("A") + seq.count("T") + seq.count("G") + seq.count("C")
print(valid == len(seq))
True
Your task

Validate a sequence

  • Check if ATGCGTA contains only valid bases.
Biology connection

Validating sequences is one of the first steps in any bioinformatics analysis. Garbage in, garbage out.