blib/lib/MS/Reader/MzIdentML/SequenceItem.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/MS/Reader/MzIdentML/ProteinAmbiguityGroup.pm ↑ Summary blib/lib/MS/Reader/MzIdentML/SpectrumIdentificationResult.pm »
1 package MS::Reader::MzIdentML::SequenceItem;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use parent qw/MS::Reader::XML::Record::CV/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 sub _pre_load {
10  
11 my ($self) = @_;
12  
13 # Lookup tables to quickly check elements
14 $self->{_make_named_array} = {
15 cvParam => 'accession',
16 userParam => 'name',
17 };
18  
19 $self->{_make_anon_array} = { map {$_ => 1} qw/
20 Modification
21 SubstitutionModification
22 / };
23  
24 }
25  
26 # Here we need to set the toplevel in the _post_load() function, since the
27 # class is not known until now.
28 sub _post_load {
29  
30 my ($self) = @_;
31  
32 for (qw/DBSequence Peptide PeptideEvidence/) {
33 if (defined $self->{$_}) {
34 bless $self => "MS::Reader::MzIdentML::$_";
35 $self->{_toplevel} = $_;
36 $self->SUPER::_post_load();
37 return;
38 }
39 }
40 die "Unexpected root element, unable to assign class\n";
41  
42 }
43  
44 sub id { return $_[0]->{id} }
45  
46 1;
47  
48 __END__
« blib/lib/MS/Reader/MzIdentML/ProteinAmbiguityGroup.pm ↑ Summary blib/lib/MS/Reader/MzIdentML/SpectrumIdentificationResult.pm »