FASTX::Abi - Read Sanger trace file (chromatograms) in FASTQ format
version 0.01
use FASTX::Abi; my $filepath = '/path/to/trace.ab1'; my $trace_fastq = FASTX::Abi->new({ filename => "$filepath" }); # Print chromatogram as FASTQ (will print two sequences if there are ambiguities) print $trace_fastq->get_fastq();
FASTX::Abi - Read Sanger trace file (chromatograms) in FASTQ format. For traces called with hetero option, the ambiguities will be split into two sequences to allow usage from NGS tools that usually do not understand IUPAC ambiguities.
When creating a new object the only required argument is filename.
my $trace_fastq = FASTX::Abi->new({ filename => "$filepath", min_qual => 22, wnd => 16, bad_bases => 2, }); # Raw sequence and quality: print "Raw seq/qual: ", $trace_fastq->{raw_sequence}, ", ", $trace_fastq->{raw_quality}, "\n"; # Trimmed sequence and quality: print "Seq/qual: ", $trace_fastq->{sequence}, ", ", $trace_fastq->{quality}, "\n"; # If there are ambiguities (hetero bases, IUPAC): if ($trace_fastq->{diff} > 0 ) { print "Differences: ", join(',', @{ $trace_fastq->{diffs} }), "\n"; print "Seq 'A': ", $trace_fastq->{seq1}, "\n"; print "Seq 'B': ", $trace_fastq->{seq2}, "\n"; }
Input parameters:
Name of the trace file (AB1 format)
Trim low quality ends (true by default, highly recommended)
Minimum quality value for trimming
Window size for end trimming
Maximum number of bad bases per window
Return a string with the FASTQ formatted sequence (if no ambiguities) or two sequences (if at least one ambiguity is found). If no $sequence_name is provided, the header will be made from the AB1 filename.
Returns an object with trace information:
my $info = FASTX::Abi->get_trace_info(); print "Instrument: ", $info->{instrument}, "\n"; print "Version: ", $info->{version}, "\n"; print "Aberage peak distance: ", $info->{avg_peak_spacing}, "\n";
Internal routine (called by new()) to populate sequence and quality. See new()
This module is a wrapper around Bio::Trace::Abif
Andrea Telatin <andrea@telatin.com>
This software is Copyright (c) 2019 by Andrea Telatin.
This is free software, licensed under:
The MIT (X11) License
To install FASTX::Abi, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FASTX::Abi
CPAN shell
perl -MCPAN -e shell install FASTX::Abi
For more information on module installation, please visit the detailed CPAN module installation guide.