abi2fastq is a small utility to convert Sanger sequencing reads in .abi (applied biosystems) format to FASTQ
Using pip
, you can grab the latest version of abi2fastq
from the Python
Package Index.
pip install abi2fastq
To install this code, clone this github repository and use pip
to install
git clone https://github.com/olgabot/abi2fastq.git
cd abi2fastq
conda env create --file environment.yml
source activate abi2fastq-env
Here is the help output for abi2fastq
:
$ abi2fastq --help
Usage: abi2fastq [OPTIONS] FILENAME
Convert Sanger sequencing format (.ab1) to FASTQ, writes to stdout
Trimming is performed using the Mott algorithm -
http://www.phrap.org/phredphrap/phred.html
Options:
--verbose Show progress messages
--no-trim Don't trim nucleotides with error probability
>0.05 for 20 or more nucleotides in a row
--min-trim-length INTEGER Minimum length of "bad" sequencing scores in a
segment
--max-error-prob FLOAT Bases with error rates higher than this are
likely to be trimmed
--help Show this message and exit.
Here is an example conversion using an .ab1
file included with this
repository. Notice that is written to standard out.
$ abi2fastq abi2fastq/test/data/ZN-1_ZNif1__2017-06-07_B01.ab1
@ZN-1_ZNif1_
ATGCGAAAAACTTTCTGATCAGTTCCTGTTGATTCCCAAGGTATGCATATGGTAGCCGGGCACGACGCCAATGATGCTGTCATAAGCAATAGCGTTGCGCAAGCGCGATTTTCAGGGCTTCTGATCGTGAAAACAGTTCTCGATCATATTCTGCAAAAGACAGAACGCGGCGTCCGATTGCATCCTCTCGCACGGACGGCTAAGGTGAAAAATGAGGTCAACTCTTTCAAGGCCGCACTGAGCTCTCTGGCAAAACACGGGGAATATGCCCCATTCGCGAGACTGCTTAATTTGTCTGGAGTCAACAATCTGGAGCATGGGCTTTTTCCGCAACTTAGTGCGATTGCCCTGGGGGTAGCTACAGCACACGGTAGCACTTTGGCCGGCGTTAACGTCGGTGAGCAATATCAACAACTGCGAGAAGCAGCGACGGAGGCAGAGAAACAACTGCAACAGTATGCCGAGTCTAGGGAACTGGATCACCTCGGTCTGGATGACCAGGAAAAGAAAATTCTCATGAACTTTCATCAAAAGAAGAACGAGATATCATTTCAGCAGACTAATGCGATGGTCACTCTTCGG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