Finnigan::Peaks -- a decoder for PeaksList, the list of peak centroids
use Finnigan; my $peaks = Finnigan::Peaks->decode(\*INPUT); say $peaks->addr; say $peaks->size; $peaks->list;
This decoder reads the stream of floating-point numbers into a list of Finnigan::Peak objects, each containing an (M/z, abundance) pair.
It is a simple but full-featured decoder for the PeakList structure, part of ScanDataPacket. The data it generates contain the seek addresses, sizes and types of all decoded elements, no matter how small. That makes it very handy in the exploration of the file format and in writing new code, but it is not very efficient in production work.
In performance-sensitive applications, the more lightweight Finnigan::Scan module should be used, which includes Finnigan::Scan::CentroidList and other related submodules. It can be used as a drop-in replacement for the full-featured modules, but it does not store the seek addresses and object types, greatly reducing the overhead.
The constructor method
Get the number of peaks in the list
Get the list of Finnigan::Peak objects
Same as peaks. I find the dereference expressions easier to read when the reference name is singular:
$scan->peaks->). However, I prefer the plural form when there is no dereferencing:
$peaks = $scan->peaks;q
Get the reference to an array containing the pairs of abundance? values of each centroided peak. This method avoids the expense of calling the Finnigan::Peak accessors.
Print the entire peak list to STDOUT
Gene Selkov, <firstname.lastname@example.org>
Copyright (C) 2010 by Gene Selkov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.