blib/lib/MS/Reader/PepXML.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/MzXML/Spectrum.pm ↑ Summary blib/lib/MS/Reader/PepXML/Result.pm »
1 package MS::Reader::PepXML;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use parent qw/MS::Reader::XML/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 use Carp;
9  
10 use MS::Reader::PepXML::Result;
11  
12 sub _post_load {
13  
14 my ($self) = @_;
15  
16 $self->{__curr_list} = 0;
17 $self->SUPER::_post_load();
18  
19 }
20  
21  
22 sub _pre_load {
23  
24 my ($self) = @_;
25  
26 # ---------------------------------------------------------------------------#
27 # These tables are the main configuration point between the parser and the
28 # specific document schema. For more information, see the documentation
29 # for the parent class MS::Reader::XML
30 # ---------------------------------------------------------------------------#
31  
32 $self->{_toplevel} = 'msms_pipeline_analysis';
33  
34 $self->{__record_classes} = {
35 spectrum_query => 'MS::Reader::PepXML::Result',
36 };
37  
38 $self->{_skip_inside} = { map {$_ => 1} qw/
39 spectrum_query
40 / };
41  
42 $self->{_make_index} = { map {$_ => 'spectrum'} qw/
43 spectrum_query
44 / };
45  
46 $self->{_make_named_array} = {
47 userParam => 'name',
48 };
49  
50 $self->{_make_named_hash} = {
51 parameter => 'name'
52 };
53  
54 $self->{_make_anon_array} = { map {$_ => 1} qw/
55 data_filter
56 msms_run_summary
57 specificity
58 search_summary
59 sequence_search_constraint
60 aminoacid_modification
61 terminal_modification
62 analysis_timestamp
63 inputfile
64 roc_error_data
65 mixture_model
66 distribution_point
67 mixturemodel_distribution
68 posmodel_distribution
69 negmodel_distribution
70 mixturemodel
71 point
72 roc_data_point
73 error_point
74 / };
75  
76 }
77  
78 sub fetch_result {
79  
80 my ($self, $idx, %args) = @_;
81 my $ref = $self->{msms_run_summary}->[
82 $self->{__curr_list}
83 ];
84 return $self->fetch_record( $ref, $idx, %args);
85  
86 }
87  
88 sub next_result {
89  
90 my ($self) = @_;
91 my $ref = $self->{msms_run_summary}->[
92 $self->{__curr_list}
93 ];
94 return $self->next_record( $ref );
95  
96 }
97  
98 sub n_lists {
99  
100 my ($self) = @_;
101 return scalar @{$self->{msms_run_summary}};
102  
103 }
104  
105 sub goto_list {
106  
107 my ($self, $idx) = @_;
108 $self->{__curr_list} = $idx;
109 my $ref = $self->{msms_run_summary}->[
110 $self->{__curr_list}
111 ];
112 $ref->{__pos} = 0;
113 return(1); # otherwise returns zero, causing tests to fail
114  
115 }
116  
117 sub result_count {
118  
119 my ($self) = @_;
120 my $ref = $self->{msms_run_summary}->[
121 $self->{__curr_list}
122 ];
123 return $self->record_count( $ref );
124  
125 }
126  
127 sub raw_file {
128  
129 my ($self, $idx) = @_;
130 return $self->{msms_run_summary}->[$idx]->{base_name}
131 . $self->{msms_run_summary}->[$idx]->{raw_data};
132  
133 }
134  
135 1;
136  
137  
138 __END__
« blib/lib/MS/Reader/MzXML/Spectrum.pm ↑ Summary blib/lib/MS/Reader/PepXML/Result.pm »