Free learning module · Python for bioinformatics
Learn Python with DNA sequences
Start with strings, numbers and loops; then write small functions to inspect sequences, translate a coding region and read a FASTA file.
Learning outcomes
- Store and inspect a DNA sequence as a string.
- Calculate GC percentage and reverse complement.
- Use conditions, loops and functions to make analysis repeatable.
- Transcribe DNA and translate a specified coding frame with the standard genetic code.
- Read multi-record FASTA and report useful summaries.
- Parse selected fixed-column PDB atom records, select chains/atoms and calculate a coordinate distance.
- Use a seeded LCG to create reproducible teaching mutations, while understanding its limits.
Get the practice files
- Synthetic example FASTA
- Complete practice functions
- Checks for the functions
- Run instructions and dataset notes
- Synthetic PDB practice structure
- PDB parsing practice code
- PDB code tests
Try each exercise before opening its answer. The supplied DNA is artificial and short. It is for checking code, not searching databases or making biological claims.