Scan.pm

filter: Statementstmt 48.3% 29 / 60 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 0.0% 0 / 1 totaltotal 36.5% 34 / 93 CC 13 SCAR 47.8
CC
13
Cov
35%
parse
182.0
__ANON__
2.0
__ANON__
2.0
CRAP 118.8
« Header.pm ↑ Summary Parser.pm »
1 #
2 #===============================================================================
3 #
4 # FILE: Scan.pm
5 #
6 # DESCRIPTION:
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 11:45:49
15 # REVISION: ---
16 #===============================================================================
17 package MS2::Scan;
18  
19 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use v5.12;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 1 has 'FirstScan' => (
26 is => 'rw',
27 isa => 'Str',
28 );
29  
30 1 has 'SecondScan' => (
31 is => 'rw',
32 isa => 'Str',
33 );
34  
35 1 has 'PrecursorMZ' => (
36 is => 'rw',
37 isa => 'Str',
38 );
39  
40 1 has 'RetTime' => (
41 is => 'rw',
42 isa => 'Str',
43 );
44  
45 1 has 'PrecursorInt' => (
46 is => 'rw',
47 isa => 'Str',
48 );
49  
50 1 has 'IonInjectionTime' => (
51 is => 'rw',
52 isa => 'Str',
53 );
54  
55 1 has 'ActivationType' => (
56 is => 'rw',
57 isa => 'Str',
58 );
59  
60 1 has 'PrecursorFile' => (
61 is => 'rw',
62 isa => 'Str',
63 );
64  
65 1 has 'PrecursorScan' => (
66 is => 'rw',
67 isa => 'Str',
68 );
69  
70 1 has 'InstrumentType' => (
71 is => 'rw',
72 isa => 'Str',
73 );
74  
75 1 has 'Charge' => (
76 is => 'rw',
77 isa => 'Str',
78 );
79  
80 1 has 'Mass' => (
81 is => 'rw',
82 isa => 'Str',
83 );
84  
85 has 'DataMZ' => (
86 is => 'rw',
87 isa => 'ArrayRef',
88 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
89 1 );
90  
91 has 'DataIntensity' => (
92 is => 'rw',
93 isa => 'ArrayRef',
94 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
95 1 );
96  
97 0 ▶sub parse {
Subroutine parse: not called CC=13 SCAR=52.0
Pod undocumented
98 0 my $self = shift;
99 0 my $line = shift;
100  
101 0 my @linepart = split(/\t/, $line);
102  
103 0 ▶ chomp $linepart[1] if $linepart[1];
Branch: 1 branch
BranchTrueFalseTotal
if $linepart[1] 0 0 0
104  
105 0 ▶ if ( $linepart[0] eq 'S' ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($linepart[0] eq 'S') { } 0 0 0
elsif ($linepart[0] eq 'I') { } 0 0 0
elsif ($linepart[0] eq 'Z') { } 0 0 0
elsif ($linepart[0] =~ /^\d/u) { } 0 0 0
106
107 0 $self->FirstScan($linepart[1]);
108 0 $self->SecondScan($linepart[2]);
109 0 $self->PrecursorMZ($linepart[3]);
110  
111 } elsif ( $linepart[0] eq 'I' ) {
112  
113 0 ▶ if ( $linepart[1] eq 'RetTime' ) {
Branch: 7 branches
BranchTrueFalseTotal
if ($linepart[1] eq 'RetTime') { } 0 0 0
elsif ($linepart[1] eq 'PrecursorInt') { } 0 0 0
elsif ($linepart[1] eq 'IonInjectionTime') { } 0 0 0
elsif ($linepart[1] eq 'ActivationType') { } 0 0 0
elsif ($linepart[1] eq 'PrecursorFile') { } 0 0 0
elsif ($linepart[1] eq 'PrecursorScan') { } 0 0 0
elsif ($linepart[1] eq 'InstrumentType') { } 0 0 0
114  
115 0 $self->RetTime($linepart[2]);
116  
117 } elsif ( $linepart[1] eq 'PrecursorInt' ) {
118  
119 0 $self->PrecursorInt($linepart[2]);
120  
121 } elsif ( $linepart[1] eq 'IonInjectionTime' ) {
122  
123 0 $self->IonInjectionTime($linepart[2]);
124  
125 } elsif ( $linepart[1] eq 'ActivationType' ) {
126  
127 0 $self->ActivationType($linepart[2]);
128  
129 } elsif ( $linepart[1] eq 'PrecursorFile' ) {
130  
131 0 $self->PrecursorFile($linepart[2]);
132  
133 } elsif ( $linepart[1] eq 'PrecursorScan' ) {
134  
135 0 $self->PrecursorScan($linepart[2]);
136  
137 } elsif ( $linepart[1] eq 'InstrumentType' ) {
138  
139 0 $self->InstrumentType($linepart[2]);
140 }
141
142 } elsif ( $linepart[0] eq 'Z' ) {
143  
144 0 $self->Charge($linepart[1]);
145 0 $self->Mass($linepart[2]);
146  
147 } elsif ( $linepart[0] =~ m/^\d/ ) {
148  
149 0 my $dataMZ = $self->DataMZ;
150 0 my @dataMZ = @{$dataMZ};
151  
152 0 my $dataInt = $self->DataIntensity;
153 0 my @dataInt = @{$dataInt};
154  
155 0 my @datapart = split(/\s+/, $line);
156
157 0 push(@dataMZ, $datapart[0]);
158 0 push(@dataInt, $datapart[1]);
159  
160 0 $self->DataMZ(\@dataMZ);
161 0 $self->DataIntensity(\@dataInt);
162 }
163  
164 }
165  
166 1 1;
« Header.pm ↑ Summary Parser.pm »