Bio-Trace-ABIF
view release on metacpan or search on metacpan
lib/Bio/Trace/ABIF.pm view on Meta::CPAN
($self->{'_B1Pt2'}) = map { ($_ < $SHORT_MID) ? $_ : $_ - $SHORT_MAX }
$self->get_data_item('B1Pt', 2, 'n');
}
return $self->{'_B1Pt2'};
}
=head2 peak1_location_orig()
Usage : $pl = peak1_location_orig();
Returns : The peak 1 location (orig);
undef if the data item is not in the file.
ABIF Tag : B1Pt1
ABIF Type : short
File Type : ab1
This data item is from SeqScape(R) v2.5 and Sequencing Analysis v5.2 Software.
=cut
sub peak1_location_orig {
my $self = shift;
unless (defined $self->{'_B1Pt1'}) {
($self->{'_B1Pt1'}) = map { ($_ < $SHORT_MID) ? $_ : $_ - $SHORT_MAX }
$self->get_data_item('B1Pt', 1, 'n');
}
return $self->{'_B1Pt1'};
}
=head2 peak_area_ratio()
Usage : $par = $abif->peak_area_ratio();
Returns : The peak area ratio;
undef if the data item is not in the file.
ABIF Tag : phAR1
ABIF Type : float
File Type : ab1
Returns the peak area ratio (equivalent to TRACE_PEAK_AREA_RATIO in phd1 file).
This data item is from SeqScape(R) v2.5 and Sequencing Analysis v5.2 Software.
=cut
sub peak_area_ratio {
my $self = shift;
unless (defined $self->{'_phAR1'}) {
my $r = undef;
($r) = $self->get_data_item('phAR', 1, 'B32');
if (defined $r) {
$self->{'_phAR1'} = $self->_ieee2decimal($r);
}
}
return $self->{'_phAR1'};
}
=head2 peaks()
Usage : @pks = $abif->peaks(1);
Returns : An array of peak hashes. Each peak hash contains the following attributes:
'position', 'height', 'beginPos', 'endPos', 'beginHI', 'endHI',
'area', 'volume', 'fragSize', 'isEdited', 'label';
() if the data item is not in the file.
ABIF Tag : PEAK
ABIF Type : user-defined structure
File Type : fsa
Returns the data associated with PEAK data structures.
=cut
sub peaks {
my ($self, $n) = @_;
my $k = '_PEAK' . $n;
my ($position, $height, $beginPos, $endPos, $beginHI, $endHI, $area, $volume, $fragSize, $isEdited, $label);
my $s = undef;
my @raw_data;
my @peak_array;
my $i;
unless (defined $self->{$k}) {
@raw_data = $self->get_data_item('PEAK', $n, '(NnNNnnNNB32nZ64)*');
for ($i = 0; $i < @raw_data; $i += 11) {
($position, $height, $beginPos, $endPos, $beginHI, $endHI, $area, $volume, $s, $isEdited, $label) = @raw_data[$i .. $i+10];
$fragSize = $self->_ieee2decimal($s) if (defined $s);
my $peak = {};
$peak->{position} = $position;
$peak->{height} = $height;
$peak->{beginPos} = $beginPos;
$peak->{endPos} = $endPos;
$peak->{beginHI} = $beginHI;
$peak->{endHI} = $endHI;
$peak->{area} = $area;
$peak->{volume} = $volume;
$peak->{fragSize} = $fragSize;
$peak->{isEdited} = $isEdited;
$peak->{label} = $label;
push @peak_array, $peak;
}
$self->{$k} = (@peak_array) ? [ @peak_array ] : [ ];
}
return @{$self->{$k}};
}
=head2 pixel_bin_size()
Usage : $n = $abif->pixel_bin_size();
Returns : The pixel bin size;
undef if the data item is not in the file.
ABIF Tag : PXLB1
ABIF Type : long
File Type : ab1, fsa
=cut
sub pixel_bin_size {
my $self = shift;
unless (defined $self->{'_PXLB1'}) {
($self->{'_PXLB1'}) = map { ($_ < $LONG_MID) ? $_ : $_ - $LONG_MAX }
$self->get_data_item('PXLB', 1, 'N');
}
return $self->{'_PXLB1'};
}
=head2 pixels_lane()
Usage : $n = $abif->pixels_lane();
Returns : The pixels averaged per lane;
undef if the data item is not in the file.
ABIF Tag : NAVG1
ABIF Type : short
File Type : ab1, fsa
=cut
sub pixels_lane {
my $self = shift;
unless (defined $self->{'_NAVG1'}) {
($self->{'_NAVG1'}) = map { ($_ < $SHORT_MID) ? $_ : $_ - $SHORT_MAX }
$self->get_data_item('NAVG', 1, 'n');
}
return $self->{'_NAVG1'};
}
=head2 plate_type()
Usage : $s = $abif->plate_type();
Returns : The plate type;
undef if the data item is not in the file.
ABIF Tag : PTYP1
ABIF Type : cString
File Type : ab1, fsa
Returns the plate type. Allowed values are 96-Well, 384-Well;
( run in 0.904 second using v1.01-cache-2.11-cpan-364913b4093 )