Example script demonstrating the use of BioPython to compare genomic sequences at a given gene location.
biopythongenomicsbioinformaticssequence-analysispythonsnpyeast
Abstraction: BioPython script comparing sample sequences to reference genome for SNP detection
Key points:
- Uses
BioPython SeqIO.index()to load reference (SGD S288C R64-1-1 FASTA) and sample FASTQ files for per-gene comparison - Handles Crick strand genes by applying
reverse_complement()when start > end coordinates - Detects SNPs by comparing reference and sample base-by-base; reports location, 10-base context, and total count
- If fewer than 5 SNPs found, prints detailed positional report; always reports count and fraction differing
- Gene coordinates hardcoded as dict: HIS3=(chr15, 721946, 722608), BRR1=(chr16, 672471, 673496)
- Chromosome IDs sorted alphabetically from SGD reference and mapped to numeric order
Connections: Biopython · Github · Bioinformatics · Sequence Analysis · Snp Analysis