| 1 | package Finnigan::Reaction; | ||
| 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 | "precursor mz" => ['d<', 'Float64'], | ||
| 14 | "unknown double" => ['d<', 'Float64'], | ||
| 15 | "energy" => ['d<', 'Float64'], | ||
| 16 | "unknown long[1]" => ['V', 'UInt32'], | ||
| 17 | "unknown long[2]" => ['V', 'UInt32'], | ||
| 18 | ]; | ||
| 19 | |||
| 20 | 23 | ▶ | sub decode { |
|
Subroutine
decode: called CC=1 SCAR=0.0
Pod
documented
| |||
| 21 | 23 | my ($class, $stream) = @_; | |
| 22 | |||
| 23 | 23 | my $self = Finnigan::Decoder->read($stream, $fields); | |
| 24 | |||
| 25 | 23 | return bless $self, $class; | |
| 26 | } | ||
| 27 | |||
| 28 | 5 | ▶ | sub precursor { |
|
Subroutine
precursor: called CC=1 SCAR=0.0
Pod
documented
| |||
| 29 | 5 | shift->{data}->{"precursor mz"}->{value}; | |
| 30 | } | ||
| 31 | |||
| 32 | 4 | ▶ | sub energy { |
|
Subroutine
energy: called CC=1 SCAR=0.0
Pod
documented
| |||
| 33 | 4 | shift->{data}->{"energy"}->{value}; | |
| 34 | } | ||
| 35 | |||
| 36 | 3 | ▶ | sub stringify { |
|
Subroutine
stringify: called CC=1 SCAR=0.0
Pod
documented
| |||
| 37 | 3 | my $self = shift; | |
| 38 | 3 | my $precursor = sprintf("%.2f", $self->precursor); | |
| 39 | 3 | my $energy = sprintf("%.2f", $self->energy); | |
| 40 | 3 | return "$precursor\@$Finnigan::activationMethod$energy"; | |
| 41 | } | ||
| 42 | |||
| 43 | 2 | 1; | |
| 44 | __END__ | ||