| 1 | package Finnigan::Peak; | ||
| 2 | |||
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use warnings FATAL => qw( all ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | our $VERSION = 0.0206; | |
| 6 | |||
| 7 | 2 | ▶ | use Finnigan; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 2 | ▶ | use base 'Finnigan::Decoder'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 2 | ▶ | use overload ('""' => 'stringify'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 2 | my $fields = [ | |
| 13 | "mz" => ['f<', 'Float32'], | ||
| 14 | "abundance" => ['f<', 'Float32'], | ||
| 15 | ]; | ||
| 16 | |||
| 17 | 580 | ▶ | sub decode { |
|
Subroutine
decode: called CC=1 SCAR=0.0
Pod
documented
| |||
| 18 | 580 | return bless Finnigan::Decoder->read($_[1], $fields), $_[0]; | |
| 19 | } | ||
| 20 | |||
| 21 | 2 | ▶ | sub mz { |
|
Subroutine
mz: called CC=1 SCAR=0.0
Pod
documented
| |||
| 22 | 2 | $_[0]->{data}->{"mz"}->{value}; | |
| 23 | } | ||
| 24 | |||
| 25 | 2 | ▶ | sub abundance { |
|
Subroutine
abundance: called CC=1 SCAR=0.0
Pod
documented
| |||
| 26 | 2 | $_[0]->{data}->{"abundance"}->{value}; | |
| 27 | } | ||
| 28 | |||
| 29 | 0 | ▶ | sub stringify { |
|
Subroutine
stringify: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 30 | 0 | my $self = shift; | |
| 31 | 0 | my $mz = $self->{data}->{mz}->{value}; | |
| 32 | 0 | my $abundance = $self->{data}->{abundance}->{value}; | |
| 33 | 0 | return "$mz\t$abundance"; | |
| 34 | } | ||
| 35 | |||
| 36 | 2 | 1; | |
| 37 | __END__ | ||