Microarray/File/Data/Quantarray.pm

filter: Statementstmt 5.6% 16 / 284 Branchbran 0.0% 0 / 66 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 3.3% 3 / 91 Podpod 0.0% 0 / 1 totaltotal 4.1% 19 / 462 CC 39 SCAR 33.2
CC
39
Cov
4%
set_header_info
182.0
set_header_data
56.0
slide_barcode
42.0
CRAP 27.8
« Microarray/Analysis/CGH.pm ↑ Summary Microarray/File.pm »
1 package Microarray::File::Data::Quantarray;
2  
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 our $VERSION = '2.20';
7  
8 0 ▶sub auto_data_file {
Subroutine auto_data_file: not called CC=1 SCAR=6.9
Pod undocumented
9 0 'quantarray_file','scanarray';
10 }
11  
12 { package quantarray_file;
13  
14 1 require Microarray::File::Data;
15  
16 1 our @ISA = qw( data_file );
17  
18 # setter for { _spot_data }, { _data_fields } and { _header_info }
19 0 ▶ sub sort_data {
Subroutine sort_data: not called CC=4 SCAR=30.0
20 0 my $self = shift;
21 0 my $aaData = shift;
22 0 $self->set_header_info($aaData);
23 0 $self->set_data_fields(shift @$aaData);
24 0 my $aEnd_Line;
25 0 ▶ while ($aEnd_Line = pop (@$aaData)){
Branch: 1 branch
BranchTrueFalseTotal
if ($aEnd_Line = pop @$aaData) 0 0 0
26 0 ▶ next unless ($$aEnd_Line[0]); # deal with blank lines
Branch: 1 branch
BranchTrueFalseTotal
unless $aEnd_Line->[0] 0 0 0
27 0 ▶ last if ($$aEnd_Line[0] =~ /^END DATA/);
Branch: 1 branch
BranchTrueFalseTotal
if $aEnd_Line->[0] =~ /^END DATA/ 0 0 0
28 }
29 0 $self->{ _spot_data } = $aaData; # all the numbers
30 0 $self->{ _spot_count } = scalar @$aaData;
31 }
32 # information about the scan
33 0 ▶ sub set_header_info {
Subroutine set_header_info: not called CC=13 SCAR=52.0
34 0 my $self = shift;
35 0 my $aaData = shift;
36 0 my $hHeader_Info = { };
37 0 my $header = 'end';
38 0 ▶ while (my $aLine = shift @$aaData) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $aLine = shift @$aaData) 0 0 0
39 0 ▶ next unless $$aLine[0];
Branch: 1 branch
BranchTrueFalseTotal
unless $aLine->[0] 0 0 0
40 0 ▶ if ($$aLine[0] =~ /^BEGIN DATA/) {
Branch: 5 branches
BranchTrueFalseTotal
if ($aLine->[0] =~ /^BEGIN DATA/) { } 0 0 0
elsif ($aLine->[0] =~ /^BEGIN/) { } 0 0 0
elsif ($aLine->[0] =~ /^END/) { } 0 0 0
elsif ($header eq 'end') { } 0 0 0
elsif ($header =~ /IMAGE INFO/) { } 0 0 0
41 0 last;
42 } elsif ($$aLine[0] =~ /^BEGIN/) {
43 0 $header = $$aLine[0];
44 0 next;
45 } elsif ($$aLine[0] =~ /^END/) {
46 0 $header = 'end';
47 0 next;
48 } elsif ($header eq 'end') {
49 0 next;
50 } elsif ($header =~ /IMAGE INFO/){
51 0 ▶ next if ($$aLine[0] eq 'ImageID'); # header line
Branch: 1 branch
BranchTrueFalseTotal
if $aLine->[0] eq "ImageID" 0 0 0
52
53 0 my $ch = $$aLine[1];
54 0 $hHeader_Info->{ 'num channels' }++;
55 0 $hHeader_Info->{ "$ch Fluor" } = $$aLine[3];
56 0 $hHeader_Info->{ "$ch Image" } = $$aLine[2];
57 0 ▶ next unless ($ch eq 'CH1');
Branch: 1 branch
BranchTrueFalseTotal
unless $ch eq "CH1" 0 0 0
58 0 $hHeader_Info->{ 'pixel size' } = $$aLine[6];
59 0 $hHeader_Info->{ 'barcode' } = $$aLine[4];
60 } else {
61 0 ▶ if (@$aLine == 2){
Branch: 2 branches
BranchTrueFalseTotal
if (@$aLine == 2) { } 0 0 0
elsif (@$aLine > 2) { } 0 0 0
62 0 $hHeader_Info->{ $$aLine[0] } = $$aLine[1];
63 } elsif (@$aLine > 2){
64 0 ▶ for (my $i=1; $i<@$aLine; $i++){
Branch: 1 branch
BranchTrueFalseTotal
if ($i < @$aLine) 0 0 0
65 0 $hHeader_Info->{ 'CH'.$i.' '.$$aLine[0] } = $$aLine[$i];
66 }
67 }
68 }
69 }
70 0 $self->{ _header_info } = $hHeader_Info;
71 }
72 0 ▶ sub delimiter {
Subroutine delimiter: not called CC=1 SCAR=6.9
73 0 return ",";
74 }
75 0 ▶ sub pixel_size {
Subroutine pixel_size: not called CC=1 SCAR=6.9
76 0 my $self = shift;
77 0 $self->get_header_info('pixel size');
78 }
79 0 ▶ sub set_pixel_size {
Subroutine set_pixel_size: not called CC=1 SCAR=6.9
80 0 my $self = shift;
81 0 my $hHeader_Info = $self->{ _header_info };
82 0 $hHeader_Info->{ 'pixel size' } = shift;
83 }
84 0 ▶ sub channel1_name {
Subroutine channel1_name: not called CC=1 SCAR=6.9
85 0 my $self = shift;
86 0 $self->get_header_info('CH1 Fluor');
87 }
88 0 ▶ sub channel2_name {
Subroutine channel2_name: not called CC=1 SCAR=6.9
89 0 my $self = shift;
90 0 $self->get_header_info('CH2 Fluor');
91 }
92 0 ▶ sub channel_name {
Subroutine channel_name: not called CC=1 SCAR=6.9
93 0 my $self = shift;
94 0 my $ch = shift;
95 0 $self->get_header_info("CH$ch Fluor");
96 }
97 0 ▶ sub set_channel_name {
Subroutine set_channel_name: not called CC=1 SCAR=6.9
98 0 my $self = shift;
99 0 my $ch = shift;
100 0 my $hHeader_Info = $self->{ _header_info };
101 0 $hHeader_Info->{ "CH$ch Fluor" } = shift;
102 }
103 0 ▶ sub channel_id {
Subroutine channel_id: not called CC=1 SCAR=6.9
104 0 my $self = shift;
105 0 my $ch = shift;
106 0 "CH$ch";
107 }
108 0 ▶ sub num_channels {
Subroutine num_channels: not called CC=1 SCAR=6.9
109 0 my $self = shift;
110 0 $self->get_header_info('num channels');
111 }
112 0 ▶ sub slide_barcode {
Subroutine slide_barcode: not called CC=2 SCAR=17.9
113 0 my $self = shift;
114 0 ▶ if ($self->get_header_info('barcode')){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->get_header_info('barcode')) { } 0 0 0
115 0 return $self->get_header_info('barcode');
116 } else {
117 0 warn "Microarray::File::Data::Quantarray WARNING: \n".
118 "Data file '".$self->file_name."'\n".
119 "Could not find a barcode in the header information - guessing its the first part of the file name\n";
120 0 $self->guess_barcode; # from data_file
121 }
122 }
123 0 ▶ sub gal_file {
Subroutine gal_file: not called CC=1 SCAR=6.9
124 0 my $self = shift;
125 0 $self->get_header_info('GalFile');
126 }
127 0 ▶ sub analysis_software {
Subroutine analysis_software: not called CC=1 SCAR=6.9
128 0 'ScanArray Express v3';
129 }
130 0 ▶ sub scanner {
Subroutine scanner: not called CC=1 SCAR=6.9
131 0 my $self = shift;
132 0 $self->get_header_info('Scanner');
133 }
134 0 ▶ sub user_comment {
Subroutine user_comment: not called CC=1 SCAR=6.9
135 0 my $self = shift;
136 0 $self->get_header_info('User comments');
137 }
138 0 ▶ sub channel1_image_file {
Subroutine channel1_image_file: not called CC=1 SCAR=6.9
139 0 my $self = shift;
140 0 $self->get_header_info('CH1 Image');
141 }
142 0 ▶ sub channel2_image_file {
Subroutine channel2_image_file: not called CC=1 SCAR=6.9
143 0 my $self = shift;
144 0 $self->get_header_info('CH2 Image');
145 }
146 0 ▶ sub channel1_pmt {
Subroutine channel1_pmt: not called CC=1 SCAR=6.9
147 0 my $self = shift;
148 0 $self->get_header_info('CH1 PMT Voltages');
149 }
150 0 ▶ sub channel2_pmt {
Subroutine channel2_pmt: not called CC=1 SCAR=6.9
151 0 my $self = shift;
152 0 $self->get_header_info('CH2 PMT Voltages');
153 }
154 0 ▶ sub channel_pmt {
Subroutine channel_pmt: not called CC=1 SCAR=6.9
155 0 my $self = shift;
156 0 my $ch = shift;
157 0 $self->get_header_info("CH$ch PMT Voltages");
158 }
159 0 ▶ sub channel1_laser {
Subroutine channel1_laser: not called CC=1 SCAR=6.9
160 0 my $self = shift;
161 0 $self->get_header_info('CH1 Laser Powers');
162 }
163 0 ▶ sub channel2_laser {
Subroutine channel2_laser: not called CC=1 SCAR=6.9
164 0 my $self = shift;
165 0 $self->get_header_info('CH2 Laser Powers');
166 }
167 0 ▶ sub channel_laser {
Subroutine channel_laser: not called CC=1 SCAR=6.9
168 0 my $self = shift;
169 0 my $ch = shift;
170 0 $self->get_header_info("CH$ch Laser Powers");
171 }
172 0 ▶ sub array_columns {
Subroutine array_columns: not called CC=1 SCAR=6.9
173 0 my $self = shift;
174 0 $self->get_header_info('Array Columns');
175 }
176 0 ▶ sub array_rows {
Subroutine array_rows: not called CC=1 SCAR=6.9
177 0 my $self = shift;
178 0 $self->get_header_info('Array Rows');
179 }
180 0 ▶ sub spot_columns {
Subroutine spot_columns: not called CC=1 SCAR=6.9
181 0 my $self = shift;
182 0 $self->get_header_info('Spot Columns');
183 }
184 0 ▶ sub spot_rows {
Subroutine spot_rows: not called CC=1 SCAR=6.9
185 0 my $self = shift;
186 0 $self->get_header_info('Spot Rows');
187 }
188 ### data file fields ###
189 ### NOTE: shifting in the array index, NOT the spot index ###
190 0 ▶ sub spot_index {
Subroutine spot_index: not called CC=1 SCAR=6.9
191 0 my $self = shift;
192 0 $self->return_data(shift,$self->get_column_id('Index'));
193 }
194 0 ▶ sub block_row {
Subroutine block_row: not called CC=1 SCAR=6.9
195 0 my $self = shift;
196 0 $self->return_data(shift,$self->get_column_id('Array Row'));
197 }
198 0 ▶ sub block_col {
Subroutine block_col: not called CC=1 SCAR=6.9
199 0 my $self = shift;
200 0 $self->return_data(shift,$self->get_column_id('Array Column'));
201 }
202 0 ▶ sub spot_row {
Subroutine spot_row: not called CC=1 SCAR=6.9
203 0 my $self = shift;
204 0 $self->return_data(shift,$self->get_column_id('Spot Row'));
205 }
206 0 ▶ sub spot_col {
Subroutine spot_col: not called CC=1 SCAR=6.9
207 0 my $self = shift;
208 0 $self->return_data(shift,$self->get_column_id('Spot Column'));
209 }
210 0 ▶ sub x_pos {
Subroutine x_pos: not called CC=1 SCAR=6.9
211 0 my $self = shift;
212 0 $self->return_data(shift,$self->get_column_id('X'));
213 }
214 0 ▶ sub y_pos {
Subroutine y_pos: not called CC=1 SCAR=6.9
215 0 my $self = shift;
216 0 $self->return_data(shift,$self->get_column_id('Y'));
217 }
218 0 ▶ sub spot_diameter {
Subroutine spot_diameter: not called CC=1 SCAR=6.9
219 0 my $self = shift;
220 0 $self->return_data(shift,$self->get_column_id('Diameter'));
221 }
222 0 ▶ sub feature_id {
Subroutine feature_id: not called CC=1 SCAR=6.9
223 0 my $self = shift;
224 0 $self->return_data(shift,$self->get_column_id('Name'));
225 }
226 0 ▶ sub synonym_id {
Subroutine synonym_id: not called CC=1 SCAR=6.9
227 0 my $self = shift;
228 0 $self->return_data(shift,$self->get_column_id('ID'));
229 }
230 0 ▶ sub spot_pixels {
Subroutine spot_pixels: not called CC=1 SCAR=6.9
231 0 my $self = shift;
232 0 $self->return_data(shift,$self->get_column_id('F Pixels'));
233 }
234 0 ▶ sub bg_pixels {
Subroutine bg_pixels: not called CC=1 SCAR=6.9
235 0 my $self = shift;
236 0 $self->return_data(shift,$self->get_column_id('B Pixels'));
237 }
238 0 ▶ sub footprint {
Subroutine footprint: not called CC=1 SCAR=6.9
239 0 my $self = shift;
240 0 $self->return_data(shift,$self->get_column_id('Footprint'));
241 }
242 0 ▶ sub flag_id {
Subroutine flag_id: not called CC=1 SCAR=6.9
243 0 my $self = shift;
244 0 $self->return_data(shift,$self->get_column_id('Flags'));
245 }
246 0 ▶ sub ch1_mean_f {
Subroutine ch1_mean_f: not called CC=1 SCAR=6.9
247 0 my $self = shift;
248 0 $self->return_data(shift,$self->get_column_id('Ch1 Mean'));
249 }
250 0 ▶ sub ch1_median_f {
Subroutine ch1_median_f: not called CC=1 SCAR=6.9
251 0 my $self = shift;
252 0 $self->return_data(shift,$self->get_column_id('Ch1 Median'));
253 }
254 0 ▶ sub ch1_sd_f {
Subroutine ch1_sd_f: not called CC=1 SCAR=6.9
255 0 my $self = shift;
256 0 $self->return_data(shift,$self->get_column_id('Ch1 SD'));
257 }
258 0 ▶ sub ch1_mean_b {
Subroutine ch1_mean_b: not called CC=1 SCAR=6.9
259 0 my $self = shift;
260 0 $self->return_data(shift,$self->get_column_id('Ch1 B Mean'));
261 }
262 0 ▶ sub ch1_median_b {
Subroutine ch1_median_b: not called CC=1 SCAR=6.9
263 0 my $self = shift;
264 0 $self->return_data(shift,$self->get_column_id('Ch1 B Median'));
265 }
266 0 ▶ sub ch1_sd_b {
Subroutine ch1_sd_b: not called CC=1 SCAR=6.9
267 0 my $self = shift;
268 0 $self->return_data(shift,$self->get_column_id('Ch1 B SD'));
269 }
270 0 ▶ sub ch1_b1sd {
Subroutine ch1_b1sd: not called CC=1 SCAR=6.9
271 0 my $self = shift;
272 0 $self->return_data(shift,$self->get_column_id('Ch1 % > B + 1 SD'));
273 }
274 0 ▶ sub channel1_quality {
Subroutine channel1_quality: not called CC=1 SCAR=6.9
275 0 my $self = shift;
276 0 $self->return_data(shift,$self->get_column_id('Ch1 % > B + 2 SD'));
277 }
278 0 ▶ sub channel1_sat {
Subroutine channel1_sat: not called CC=1 SCAR=6.9
279 0 my $self = shift;
280 0 $self->return_data(shift,$self->get_column_id('Ch1 F % Sat.'));
281 }
282 0 ▶ sub ch2_mean_f {
Subroutine ch2_mean_f: not called CC=1 SCAR=6.9
283 0 my $self = shift;
284 0 $self->return_data(shift,$self->get_column_id('Ch2 Mean'));
285 }
286 0 ▶ sub ch2_median_f {
Subroutine ch2_median_f: not called CC=1 SCAR=6.9
287 0 my $self = shift;
288 0 $self->return_data(shift,$self->get_column_id('Ch2 Median'));
289 }
290 0 ▶ sub ch2_sd_f {
Subroutine ch2_sd_f: not called CC=1 SCAR=6.9
291 0 my $self = shift;
292 0 $self->return_data(shift,$self->get_column_id('Ch2 SD'));
293 }
294 0 ▶ sub ch2_mean_b {
Subroutine ch2_mean_b: not called CC=1 SCAR=6.9
295 0 my $self = shift;
296 0 $self->return_data(shift,$self->get_column_id('Ch2 B Mean'));
297 }
298 0 ▶ sub ch2_median_b {
Subroutine ch2_median_b: not called CC=1 SCAR=6.9
299 0 my $self = shift;
300 0 $self->return_data(shift,$self->get_column_id('Ch2 B Median'));
301 }
302 0 ▶ sub ch2_sd_b {
Subroutine ch2_sd_b: not called CC=1 SCAR=6.9
303 0 my $self = shift;
304 0 $self->return_data(shift,$self->get_column_id('Ch2 B SD'));
305 }
306 0 ▶ sub ch2_b1sd {
Subroutine ch2_b1sd: not called CC=1 SCAR=6.9
307 0 my $self = shift;
308 0 $self->return_data(shift,$self->get_column_id('Ch2 % > B + 1 SD'));
309 }
310 0 ▶ sub channel2_quality {
Subroutine channel2_quality: not called CC=1 SCAR=6.9
311 0 my $self = shift;
312 0 $self->return_data(shift,$self->get_column_id('Ch2 % > B + 2 SD'));
313 }
314 0 ▶ sub channel2_sat {
Subroutine channel2_sat: not called CC=1 SCAR=6.9
315 0 my $self = shift;
316 0 $self->return_data(shift,$self->get_column_id('Ch2 F % Sat.'));
317 }
318  
319 ###Êquantarray calculates SNR as (median signal/background SD) ###
320 0 ▶ sub channel1_snr {
Subroutine channel1_snr: not called CC=4 SCAR=30.0
321 0 my $self = shift;
322 0 my $index = shift;
323 0 my $median = $self->ch1_median_f($index);
324 0 my $sd = $self->ch1_sd_b($index);
325 0 ▶ if ($median && $sd) {
Branch: 2 branches
BranchTrueFalseTotal
if ($median and $sd) { } 0 0 0
elsif ($median) { } 0 0 0
Condition0%0/3
$median and $sd
!ll&&!rl&&r
000
MC/DC0%0/2
$median and $sd
$median $sd
Truth table0%0/3
A and B
A= $medianB= $sd
ABresult
0X0
100
111
326 0 return $median / $sd;
327 } elsif ($median) {
328 0 return $median;
329 } else {
330 0 return 0;
331 }
332 }
333 0 ▶ sub channel2_snr {
Subroutine channel2_snr: not called CC=4 SCAR=30.0
334 0 my $self = shift;
335 0 my $index = shift;
336 0 my $median = $self->ch2_median_f($index);
337 0 my $sd = $self->ch2_sd_b($index);
338 0 ▶ if ($median && $sd) {
Branch: 2 branches
BranchTrueFalseTotal
if ($median and $sd) { } 0 0 0
elsif ($median) { } 0 0 0
Condition0%0/3
$median and $sd
!ll&&!rl&&r
000
MC/DC0%0/2
$median and $sd
$median $sd
Truth table0%0/3
A and B
A= $medianB= $sd
ABresult
0X0
100
111
339 0 return $median / $sd;
340 } elsif ($median) {
341 0 return $median;
342 } else {
343 0 return 0;
344 }
345 }
346 0 ▶ sub bad_flags {
Subroutine bad_flags: not called CC=1 SCAR=6.9
347 0 { '1'=>'1', '2'=>'1', '4'=>'1' };
348 }
349 }
350  
351 1 { package quantarray_image;
352  
353 1 require Microarray::File::Image;
354  
355 1 our @ISA = qw( microarray_image_file );
356
357 0 ▶ sub set_header_data {
Subroutine set_header_data: not called CC=7 SCAR=40.3
358 0 my $self = shift;
359 0 my $hInfo = $self->get_header_info;
360 0 ▶ KEY:while (my ($key,$value) = each %$hInfo){
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$hInfo) 0 0 0
361 0 ▶ next unless ($value);
Branch: 1 branch
BranchTrueFalseTotal
unless $value 0 0 0
362 0 my $value = $hInfo->{ $key };
363 0 ▶ if (ref $value){
Branch: 2 branches
BranchTrueFalseTotal
if (ref $value) { } 0 0 0
elsif ($key eq 'ImageDescription') { } 0 0 0
364 0 next KEY;
365 } elsif ($key eq 'ImageDescription'){
366 0 my @aInfo = split(/#/,$value);
367 0 for my $info (@aInfo){
368 0 my @aItem = split(/=/,$info);
369 0 ▶ if (@aItem == 2){
Branch: 1 branch
BranchTrueFalseTotal
if (@aItem == 2) 0 0 0
370 0 $self->{ $aItem[0] } = $aItem[1];
371 }
372 }
373 } else {
374 0 $self->{ $key } = $value;
375 }
376 }
377 }
378 0 ▶ sub protocol_name {
Subroutine protocol_name: not called CC=1 SCAR=6.9
379 0 my $self = shift;
380 0 $self->{ ProtocolName };
381 }
382 0 ▶ sub protocol_description {
Subroutine protocol_description: not called CC=1 SCAR=6.9
383 0 my $self = shift;
384 0 $self->{ ProtocolDesc };
385 }
386 0 ▶ sub protocol_id {
Subroutine protocol_id: not called CC=1 SCAR=6.9
387 0 my $self = shift;
388 0 $self->{ ProtocolID };
389 }
390 0 ▶ sub image_user_name {
Subroutine image_user_name: not called CC=1 SCAR=6.9
391 0 my $self = shift;
392 0 $self->{ Artist };
393 }
394 0 ▶ sub scan_speed {
Subroutine scan_speed: not called CC=2 SCAR=17.9
395 0 my $self = shift;
396 0 ▶ if ($self->{ FullSpeed } == 0){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'FullSpeed'} == 0) { } 0 0 0
397 0 return 50;
398 } else {
399 0 return 100;
400 }
401 }
402
403 0 ▶ sub image_datetime {
Subroutine image_datetime: not called CC=1 SCAR=6.9
404 0 my $self = shift;
405 0 my ($date,$time) = split(/\s/,$self->{ FileModifyDate });
406 0 $date =~ s/:/-/g;
407 0 return "$date $time";
408 }
409 0 ▶ sub image_scanner {
Subroutine image_scanner: not called CC=1 SCAR=6.9
410 0 my $self = shift;
411 0 my $scanner = $self->{ Model };
412 0 $scanner =~ s/\t/ /g;
413 0 $scanner;
414 }
415 0 ▶ sub collection_software {
Subroutine collection_software: not called CC=1 SCAR=6.9
416 0 my $self = shift;
417 0 $self->{ Software };
418 }
419 0 ▶ sub slide_barcode {
Subroutine slide_barcode: not called CC=6 SCAR=37.4
420 0 my $self = shift;
421 0 ▶ if($self->image_lbarcode && $self->image_ubarcode){
Branch: 3 branches
BranchTrueFalseTotal
if ($self->image_lbarcode and $self->image_ubarcode) { } 0 0 0
elsif ($self->image_lbarcode) { } 0 0 0
elsif ($self->image_ubarcode) { } 0 0 0
Condition0%0/3
$self->image_lbarcode and $self->image_ubarcode
!ll&&!rl&&r
000
MC/DC0%0/2
$self->image_lbarcode and $self->image_ubarcode
$self->image_lbarcode $self->image_ubarcode
Truth table0%0/3
A and B
A= $self->image_lbarcodeB= $self->image_ubarcode
ABresult
0X0
100
111
422 0 ▶ if ($self->image_lbarcode eq $self->image_ubarcode){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->image_lbarcode eq $self->image_ubarcode) { } 0 0 0
423 0 return $self->image_ubarcode;
424 } else {
425 0 die "Microarray::File::Data::Quantarray ERROR: \n".
426 "Image file '".$self->file_name."'\n".
427 "Upper and lower barcodes are different\n";
428 }
429 } elsif ($self->image_lbarcode){
430 0 return $self->image_lbarcode;
431 } elsif ($self->image_ubarcode){
432 0 return $self->image_ubarcode;
433 } else {
434 0 warn "Microarray::File::Data::Quantarray WARNING: \n".
435 "Image file '".$self->file_name."'\n".
436 "Could not find a barcode in the image header - guessing its the first part of the file name\n";
437 0 return $self->guess_slide_barcode;
438 }
439 }
440 0 ▶ sub image_lbarcode {
Subroutine image_lbarcode: not called CC=1 SCAR=6.9
441 0 my $self = shift;
442 0 $self->{ LBarcode };
443 }
444 0 ▶ sub image_ubarcode {
Subroutine image_ubarcode: not called CC=1 SCAR=6.9
445 0 my $self = shift;
446 0 $self->{ UBarcode };
447 }
448 0 ▶ sub image_resolution {
Subroutine image_resolution: not called CC=1 SCAR=6.9
449 0 my $self = shift;
450 0 $self->{ Resolution };
451 }
452 0 ▶ sub fluor_name {
Subroutine fluor_name: not called CC=1 SCAR=6.9
453 0 my $self = shift;
454 0 $self->{ FluorName };
455 }
456 0 ▶ sub fluor_id {
Subroutine fluor_id: not called CC=1 SCAR=6.9
457 0 my $self = shift;
458 0 $self->{ FluorID };
459 }
460 0 ▶ sub fluor_description {
Subroutine fluor_description: not called CC=1 SCAR=6.9
461 0 my $self = shift;
462 0 $self->{ FluorDesc };
463 }
464 0 ▶ sub fluor_excitation {
Subroutine fluor_excitation: not called CC=1 SCAR=6.9
465 0 my $self = shift;
466 0 $self->{ Excitation };
467 }
468 0 ▶ sub fluor_emission {
Subroutine fluor_emission: not called CC=1 SCAR=6.9
469 0 my $self = shift;
470 0 $self->{ Emission };
471 }
472 0 ▶ sub laser_id {
Subroutine laser_id: not called CC=1 SCAR=6.9
473 0 my $self = shift;
474 0 $self->{ Laser };
475 }
476 0 ▶ sub filter_id {
Subroutine filter_id: not called CC=1 SCAR=6.9
477 0 my $self = shift;
478 0 $self->{ Filter };
479 }
480 0 ▶ sub user_comment {
Subroutine user_comment: not called CC=1 SCAR=6.9
481 0 my $self = shift;
482 0 $self->{ UserComment };
483 }
484 0 ▶ sub pmt_gain {
Subroutine pmt_gain: not called CC=1 SCAR=6.9
485 0 my $self = shift;
486 0 $self->{ PMTGain };
487 }
488 0 ▶ sub laser_power {
Subroutine laser_power: not called CC=1 SCAR=6.9
489 0 my $self = shift;
490 0 $self->{ LaserPower };
491 }
492 0 ▶ sub set_new_barcode {
Subroutine set_new_barcode: not called CC=5 SCAR=34.0
493 0 my $self = shift;
494 0 my $barcode = shift;
495 0 my $new_file = shift;
496  
497 0 my $exifTool = $self->get_exiftool_object;
498 0 my $value = $exifTool->GetValue('ImageDescription'); # the Quantarray header
499 0 my $newValue = $value;
500
501 0 ▶ if ($self->image_lbarcode || $self->image_ubarcode){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->image_lbarcode or $self->image_ubarcode) { } 0 0 0
Condition0%0/3
$self->image_lbarcode or $self->image_ubarcode
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->image_lbarcode or $self->image_ubarcode
$self->image_lbarcode $self->image_ubarcode
Truth table0%0/3
A or B
A= $self->image_lbarcodeB= $self->image_ubarcode
ABresult
1X1
011
000
502 0 ▶ if ($self->image_lbarcode){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->image_lbarcode) 0 0 0
503 0 $self->{ LBarcode } = $barcode;
504 0 $newValue =~ s/#LBarcode=.*#UBarcode/#LBarcode=$barcode#UBarcode/; # change the lower barcode
505 }
506 0 ▶ if ($self->image_ubarcode){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->image_ubarcode) 0 0 0
507 0 $self->{ UBarcode } = $barcode;
508 0 $newValue =~ s/#UBarcode=.*#Resolution/#UBarcode=$barcode#Resolution/; # change the upper barcode
509 }
510 } else {
511 0 $self->{ LBarcode } = $barcode;
512 0 $newValue =~ s/#LBarcode=.*#UBarcode/#LBarcode=$barcode#UBarcode/; # change the lower barcode
513 0 $self->{ UBarcode } = $barcode;
514 0 $newValue =~ s/#UBarcode=.*#Resolution/#UBarcode=$barcode#Resolution/; # change the upper barcode
515 }
516
517 0 $exifTool->SetNewValue('ImageDescription', $newValue); # set the header with the new value
518 0 my $success = $exifTool->WriteInfo($self->file_name, $new_file); # write the new header to the destination file
519 0 return $success; # 1=write success, 2=write success no changes, 0=write error
520 }
521 }
522  
523 1 1;
524  
525 __END__
« Microarray/Analysis/CGH.pm ↑ Summary Microarray/File.pm »