Header.pm

filter: Statementstmt 60.0% 27 / 45 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 42.1% 32 / 76 CC 13 SCAR 48.8
CC
13
Cov
39%
parse
182.0
BEGIN
1.0
BEGIN
1.0
CRAP 131.7
↑ Summary Scan.pm »
1 #
2 #===============================================================================
3 #
4 # FILE: Header.pm
5 #
6 # DESCRIPTION: Representativa class for MS2 file headers.
7 #
8 # FILES: ---
9 # BUGS: ---
10 # NOTES: ---
11 # AUTHOR: Felipe da Veiga Leprevost (Leprevost, F.V.), leprevost@cpan.org
12 # ORGANIZATION:
13 # VERSION: 1.0
14 # CREATED: 07-10-2014 10:53:06
15 # REVISION: ---
16 #===============================================================================
17  
18 package MS2::Header;
19  
20 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use v5.12;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 1 has 'CreationDate' => (
27 is => 'rw',
28 isa => 'Str',
29 );
30  
31 1 has 'Extractor' => (
32 is => 'rw',
33 isa => 'Str',
34 );
35  
36 1 has 'ExtractorVersion' => (
37 is => 'rw',
38 isa => 'Str',
39 );
40  
41 1 has 'Comments' => (
42 is => 'rw',
43 isa => 'Str',
44 );
45  
46 1 has 'ExtractorOptions' => (
47 is => 'rw',
48 isa => 'Str',
49 );
50  
51 1 has 'AcquisitionMethod' => (
52 is => 'rw',
53 isa => 'Str',
54 );
55  
56 1 has 'InstrumentType' => (
57 is => 'rw',
58 isa => 'Str',
59 );
60  
61 1 has 'ScanType' => (
62 is => 'rw',
63 isa => 'Str',
64 );
65  
66 1 has 'DataType' => (
67 is => 'rw',
68 isa => 'Str',
69 );
70  
71 1 has 'IsolationWindow' => (
72 is => 'rw',
73 isa => 'Any',
74 );
75  
76 1 has 'FirstScan' => (
77 is => 'rw',
78 isa => 'Str',
79 );
80  
81 1 has 'LastScan' => (
82 is => 'rw',
83 isa => 'Str',
84 );
85  
86  
87 0 ▶sub parse {
Subroutine parse: not called CC=13 SCAR=52.0
Pod undocumented
88 0 my $self = shift;
89 0 my $line = shift;
90  
91 0 my @linepart = split(/\t/, $line);
92  
93 0 chomp $linepart[1];
94  
95 0 ▶ if ( $linepart[1] eq 'CreationDate' ) {
Branch: 12 branches
BranchTrueFalseTotal
if ($linepart[1] eq 'CreationDate') { } 0 0 0
elsif ($linepart[1] eq 'Extractor') { } 0 0 0
elsif ($linepart[1] eq 'ExtractorVersion') { } 0 0 0
elsif ($linepart[1] eq 'Comments') { } 0 0 0
elsif ($linepart[1] eq 'ExtractorOptions') { } 0 0 0
elsif ($linepart[1] eq 'AcquisitionMethod') { } 0 0 0
elsif ($linepart[1] eq 'InstrumentType') { } 0 0 0
elsif ($linepart[1] eq 'ScanType') { } 0 0 0
elsif ($linepart[1] eq 'DataType') { } 0 0 0
elsif ($linepart[1] eq 'IsolationWindow') { } 0 0 0
elsif ($linepart[1] eq 'FirstScan') { } 0 0 0
elsif ($linepart[1] eq 'LastScan') { } 0 0 0
96  
97 0 $self->CreationDate($linepart[2]);
98  
99 } elsif ( $linepart[1] eq 'Extractor' ) {
100  
101 0 $self->Extractor($linepart[2]);
102  
103 } elsif ( $linepart[1] eq 'ExtractorVersion' ) {
104  
105 0 $self->ExtractorVersion($linepart[2]);
106  
107 } elsif ( $linepart[1] eq 'Comments' ) {
108  
109 0 $self->Comments($linepart[2]);
110  
111 } elsif ( $linepart[1] eq 'ExtractorOptions' ) {
112  
113 0 $self->ExtractorOptions($linepart[2]);
114  
115 } elsif ( $linepart[1] eq 'AcquisitionMethod' ) {
116  
117 0 $self->AcquisitionMethod($linepart[2]);
118  
119 } elsif ( $linepart[1] eq 'InstrumentType' ) {
120  
121 0 $self->InstrumentType($linepart[2]);
122  
123 } elsif ( $linepart[1] eq 'ScanType' ) {
124  
125 0 $self->ScanType($linepart[2]);
126  
127 } elsif ( $linepart[1] eq 'DataType' ) {
128  
129 0 $self->DataType($linepart[2]);
130  
131 } elsif ( $linepart[1] eq 'IsolationWindow' ) {
132  
133 0 $self->IsolationWindow($linepart[2]);
134  
135 } elsif ( $linepart[1] eq 'FirstScan' ) {
136  
137 0 $self->FirstScan($linepart[2]);
138  
139 } elsif ( $linepart[1] eq 'LastScan' ) {
140  
141 0 $self->LastScan($linepart[2]);
142  
143 } else {
144  
145 0 say "\nUnrecognized Tag: $linepart[1] ignored\n";
146 }
147  
148 }
149
150  
151 1 1;
↑ Summary Scan.pm »