Sanger to fastq
Sometimes we find ourselves with some Sanger data that we would like to use to prototype an NGS workflow. Here’s a script to turn a list of ab1 files into a single fastq file suitable for that.
from Bio import SeqIO
# list of ab1 files
files = ["1.ab1", "2.ab1"]
records = []
for file in files:
record = next(SeqIO.parse(file, "abi"))
SeqIO.write(records, "all_out.fastq", "fastq")