File Coverage

blib/lib/Finnigan/SampleInfo.pm
Criterion Covered Total %
statement 27 31 87.1
branch n/a
condition n/a
subroutine 14 18 77.7
pod 13 13 100.0
total 54 62 87.1


line stmt bran cond sub pod time code
1             package Finnigan::SampleInfo;
2              
3 2     2   13 use strict;
  2         3  
  2         80  
4 2     2   11 use warnings FATAL => qw( all );
  2         3  
  2         124  
5             our $VERSION = 0.0206;
6              
7 2     2   11 use Carp;
  2         3  
  2         162  
8 2     2   11 use Finnigan;
  2         3  
  2         62  
9 2     2   10 use base 'Finnigan::Decoder';
  2         4  
  2         2262  
10              
11              
12             sub decode {
13 1     1 1 10 my ($class, $stream) = @_;
14              
15 1         41 my $fields = [
16             "unknown long[1]" => ['V', 'UInt32'], # 0
17             "unknown long[2]" => ['V', 'UInt32'], # 2
18             "first scan number" => ['V', 'UInt32'], # 4
19             "last scan number" => ['V', 'UInt32'], # 6
20             "inst log length" => ['V', 'UInt32'], # 8
21             "unknown long[3]" => ['V', 'UInt32'], # 10
22             "unknown long[4]" => ['V', 'UInt32'], # 12
23             "scan index addr" => ['V', 'UInt32'], # 14 * unused in 64-bit versions
24             "data addr" => ['V', 'UInt32'], # 16 *
25             "inst log addr" => ['V', 'UInt32'], # 18 *
26             "error log addr" => ['V', 'UInt32'], # 20 *
27             "unknown long[5]" => ['V', 'UInt32'],
28             "max ion current" => ['d<', 'Float64'],
29             "low mz" => ['d<', 'Float64'],
30             "high mz" => ['d<', 'Float64'],
31             "start time" => ['d<', 'Float64'],
32             "end time" => ['d<', 'Float64'],
33             "unknown area" => ['C56', 'RawBytes'],
34             "tag[1]" => ['U0C88', 'UTF16LE'],
35             "tag[2]" => ['U0C40', 'UTF16LE'],
36             "tag[3]" => ['U0C320', 'UTF16LE'],
37             ];
38              
39 1         7 my $self = Finnigan::Decoder->read($stream, $fields);
40              
41 1         10 return bless $self, $class;
42             }
43              
44             sub first_scan {
45 1     1 1 11 shift->{data}->{"first scan number"}->{value};
46             }
47              
48             sub last_scan {
49 1     1 1 555 shift->{data}->{"last scan number"}->{value};
50             }
51              
52             sub inst_log_length {
53 1     1 1 463 shift->{data}->{"inst log length"}->{value};
54             }
55              
56             sub max_ion_current {
57 1     1 1 567 shift->{data}->{"max ion current"}->{value};
58             }
59              
60             sub low_mz {
61 1     1 1 497 shift->{data}->{"low mz"}->{value};
62             }
63              
64             sub high_mz {
65 1     1 1 464 shift->{data}->{"high mz"}->{value};
66             }
67              
68             sub start_time {
69 1     1 1 433 shift->{data}->{"start time"}->{value};
70             }
71              
72             sub end_time {
73 1     1 1 434 shift->{data}->{"end time"}->{value};
74             }
75              
76             sub scan_index_addr {
77 0     0 1   croak "direct access to SampleInfo->scan_index_addr breaks version compatbility. Use RunHeader->scan_index_addr instead."
78             }
79              
80             sub data_addr {
81 0     0 1   croak "direct access to SampleInfo->data_addr breaks version compatbility. Use RunHeader->data_addr instead."
82             }
83              
84             sub inst_log_addr {
85 0     0 1   croak "direct access to SampleInfo->inst_log_addr breaks version compatbility. Use RunHeader->inst_log_addr instead."
86             }
87              
88             sub error_log_addr {
89 0     0 1   croak "direct access to SampleInfo->error_log_addr breaks version compatbility. Use RunHeader->error_log_addr instead."
90             }
91              
92             1;
93             __END__