AB1 to FASTQ
3
0
Entering edit mode
3.6 years ago
DanielC ▴ 140

Dear All,

Could you please share on how to convert AB1 files to FASTQ file format standalone? Thanks much.

FASTQ AB1 CONVERSION • 6.2k views
1
Entering edit mode

While it would be possible to do that by generating fasta from AB1 and then adding fake Q scores to make fake fastq, the question is why you would want to do this.

1
Entering edit mode
3.3 years ago
Chronos ▴ 600

If you wish to batch-convert hundreds of AB1 files, and you are comfortable with command line and compiling tools, then you can use TraceTuner, see this thread on seqanswers on how to add .fastq support to it.

Another command-line solution would be to use seqret from the EMBOSS suite: seqret -sformat abi -osformat fastq -auto -stdout -sequence input.ab1 > output.fastq"

Otherwise, graphical molecular biology programs usually handle AB1 with ease, and will allow conversion.

1
Entering edit mode
3.3 years ago
trausch ★ 1.6k

Tracy can also convert to Fasta or Fastq:

tracy basecall -o out.fastq -f fastq input.ab1

1
Entering edit mode
23 months ago
renaegeier ▴ 10

I realize this is late, but I found an additional way to do this using Biopython, which you have to install prior to the following:

$python3$from Bio import SeqIO
$record = SeqIO.parse("file.ab1", "abi")$count = SeqIO.write(record, "file.fastq", "fastq")

0
Entering edit mode

Out of curiosity what Q score (fake) does biopython assign to these reads?

0
Entering edit mode

You can extract the quality scores in BioPython:

seqHandle = SeqIO.parse("file.ab1", "abi")

for seq in seqHandle:
seqName = seq.id
seqStr = str(seq.seq)
seqQual = seq.letter_annotations["phred_quality"]


You probably also want to do some additional trimming, and I would definitely encourage you to go back and look at the original trace (if you think there might be a mutation).

However, this means that you would write each desired sequence manually. For simplicity, you could output a trimmed FASTA file. However, with the information above, you could still create a FASTQ file:

https://en.wikipedia.org/wiki/FASTQ_format#Format

0
Entering edit mode

The quality score was actually defined for Sanger reads before Illumina reads. However, Illumina has also changed the quality offset over time.

This may also be a bit like the quality score distribution looking noticeably different for Illumina versus PacBio CCS reads. So, you may need to use your own judgement about what quality scores correspond to nucleotides that should be trimmed.