22
|
1 #!usr/bin/perl
|
|
2 package IonFiltration;
|
|
3
|
|
4 ### Perl modules
|
|
5 use strict;
|
|
6 use warnings;
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13 ########################################################################
|
|
14 ### Création of a hash containing all adduits and fragments possible ###
|
|
15 ########################################################################
|
|
16
|
|
17
|
|
18 sub MassCollecting{
|
|
19
|
|
20 my $mass_file = $_[0];
|
|
21 my %hmass;
|
|
22
|
|
23 open (F1, $mass_file);
|
|
24
|
|
25 while(my $line = <F1>){
|
|
26 chomp $line;
|
|
27 my @tline = split(/[\t;]/, $line);
|
|
28 if(defined($hmass{$tline[2]})){
|
|
29 print "Il existe déjà une même différence de masse : $tline[2] !\n";
|
|
30 }
|
|
31 $hmass{$tline[1]}{$tline[2]}=$tline[0];
|
|
32 }
|
|
33
|
|
34 close F1;
|
|
35 # my $count=0;
|
|
36 # foreach my $k (keys %hmass){
|
|
37 # $count++;
|
|
38 # }
|
|
39
|
|
40 return %hmass;
|
|
41
|
|
42
|
|
43 }
|
|
44
|
|
45
|
|
46
|
|
47
|
|
48
|
|
49
|
|
50
|
|
51 ########################################################
|
|
52 ### Creation of a sif table + correlation filtration ###
|
|
53 ########################################################
|
|
54
|
|
55
|
|
56 sub sifTableCreation{
|
|
57
|
|
58 my $file = $_[0];
|
|
59 my $output_sif = $_[1];
|
|
60 my $opt = $_[2];
|
|
61 my $rt_threshold = $_[3];
|
|
62 my $mass_threshold = $_[4];
|
|
63 my $correl_threshold = $_[5];
|
|
64 my $dataMatrix = $_[6];
|
|
65 my $output_tabular = $_[7];
|
|
66 my $combined_DMVM = $_[8];
|
|
67 my $repres_opt = $_[9];
|
|
68 my $intensity_threshold = $_[10];
|
|
69 my $intensity_pourc = $_[11];
|
|
70 my $refhmass = $_[12];
|
|
71
|
|
72
|
|
73
|
|
74
|
|
75 my %hheader_file;
|
|
76 my %hduplicate;
|
|
77
|
|
78 my %hcorrelgroup;
|
|
79 my $groupct=1;
|
|
80
|
|
81
|
|
82 my $linenb3=0;
|
|
83 my %hheader_line;
|
|
84 my %hrtmz;
|
|
85
|
|
86 open (F5, $combined_DMVM);
|
|
87 while(my $line = <F5>){
|
|
88 chomp $line;
|
|
89 my @tline = split(/\t/, $line);
|
|
90
|
|
91 if($linenb3 == 0){
|
|
92 for(my $i=0; $i<scalar(@tline);$i++){
|
|
93 my $a = $tline[$i];
|
|
94 $hheader_line{$a}=$i;
|
|
95 }
|
|
96 }
|
|
97 else{
|
|
98 if(defined($hheader_line{mzmed})){
|
|
99 my $b = $tline[$hheader_line{mzmed}];
|
|
100 $hrtmz{$tline[0]}{mz}=$b;
|
|
101 }
|
|
102 else{
|
|
103 my $b = $tline[$hheader_line{mz}];
|
|
104 $hrtmz{$tline[0]}{mz}=$b;
|
|
105 }
|
|
106 if(defined($hheader_line{rtmed})){
|
|
107 my $d = $tline[$hheader_line{rtmed}];
|
|
108 $hrtmz{$tline[0]}{rt}=$d;
|
|
109 }
|
|
110 else{
|
|
111 my $d = $tline[$hheader_line{rt}];
|
|
112 $hrtmz{$tline[0]}{rt}=$d;
|
|
113 }
|
|
114 }
|
|
115
|
|
116 $linenb3 ++;
|
|
117 }
|
|
118 close F5;
|
|
119
|
|
120
|
|
121 my $linenb=0;
|
|
122
|
|
123 open (F1, $file) or die "Impossible to open $file\n";
|
|
124 open(F2, ">$output_sif") or die "Impossible to open $output_sif\n";
|
|
125
|
|
126 while(my $line = <F1>){
|
|
127 chomp $line;
|
|
128 my @tline = split(/\t/, $line);
|
|
129
|
|
130
|
|
131 ###############################
|
|
132 ### Création of a sif table ###
|
|
133 ###############################
|
|
134
|
|
135 if($linenb == 0){
|
|
136 for(my $i=0; $i<scalar(@tline);$i++){
|
|
137 my $a = $tline[$i];
|
|
138 $hheader_file{$i}=$a;
|
|
139 }
|
|
140 }
|
|
141 else{
|
|
142 for(my $i=1; $i<scalar(@tline);$i++){
|
|
143 my $a=$tline[0];
|
|
144 my $b=$hheader_file{$i};
|
|
145 my $coef=$tline[$i];
|
|
146
|
|
147
|
|
148 if($a eq $b){
|
|
149 # print "This is a correlation between A ($a) and A ($b) !\n"
|
|
150 }
|
|
151 else{
|
|
152
|
|
153
|
|
154 #########################
|
|
155 ### Remove duplicates ###
|
|
156 #########################
|
|
157
|
|
158 my $y = $a."/".$b;
|
|
159 my $z = $b."/".$a;
|
|
160
|
|
161 if((!(defined($hduplicate{$y}))) && (!(defined($hduplicate{$z})))){
|
|
162
|
|
163 $hduplicate{$y}=1;
|
|
164
|
|
165 if($coef > $correl_threshold){
|
|
166
|
|
167 print F2 "$a\t$coef\t$b\n";
|
|
168
|
|
169 my $count=0;
|
|
170
|
|
171 ######################################################
|
|
172 ### Analytic correlation filtrering follow options ###
|
|
173 ######################################################
|
|
174
|
|
175
|
|
176
|
|
177 my $amass=$hrtmz{$a}{mz};
|
|
178 my $atemp=$hrtmz{$a}{rt};
|
|
179 my $bmass= $hrtmz{$b}{mz};
|
|
180 my $btemp=$hrtmz{$b}{rt};
|
|
181 my $diff = $amass-$bmass;
|
|
182 $diff = abs($diff);
|
|
183
|
|
184 ### Option 1: Don't take into acount mass information ###
|
|
185
|
|
186 if($opt == 1){
|
|
187 my $btplus = $btemp + $rt_threshold;
|
|
188 my $btmoins = $btemp - $rt_threshold;
|
|
189 if(($btmoins <= $atemp) && ($atemp <= $btplus)){
|
|
190 foreach my $k (keys %hcorrelgroup){
|
|
191
|
|
192 if((defined($hcorrelgroup{$k}{$a})) || (defined($hcorrelgroup{$k}{$b}))){
|
|
193 $hcorrelgroup{$k}{$a}=1;
|
|
194 $hcorrelgroup{$k}{$b}=1;
|
|
195 $count++;
|
|
196 last;
|
|
197 }
|
|
198 }
|
|
199 if($count == 0){
|
|
200 my $groupnb="group".$groupct;
|
|
201 $hcorrelgroup{$groupnb}{$a}=1;
|
|
202 $hcorrelgroup{$groupnb}{$b}=1;
|
|
203 $groupct ++;
|
|
204 }
|
|
205
|
|
206 }
|
|
207 }
|
|
208
|
|
209
|
|
210 ### Option 2: Check that all mass differences are include in a specific list taking into account RT information ###
|
|
211
|
|
212 elsif($opt == 2){
|
|
213
|
|
214 my $print = 0;
|
|
215 foreach my $s (keys %{$refhmass}){
|
|
216 foreach my $r (keys %{$refhmass->{$s}}){
|
|
217 my $rm = $r - $mass_threshold;
|
|
218 my $rp = $r + $mass_threshold;
|
|
219 if(($diff <= $rp) && ($diff >= $rm)){
|
|
220 if($print == 0){
|
|
221 my $btplus = $btemp + $rt_threshold;
|
|
222 my $btmoins = $btemp - $rt_threshold;
|
|
223
|
|
224 if(($btmoins <= $atemp) && ($atemp <= $btplus)){
|
|
225 # foreach my $s (keys %{%$refhmass{$r}}){
|
|
226 # print F2 "$line\t$hmass{$r}{$s} : $s ($r)\n";
|
|
227 foreach my $k (keys %hcorrelgroup){
|
|
228 if((defined($hcorrelgroup{$k}{$a})) || (defined($hcorrelgroup{$k}{$b}))){
|
|
229 $hcorrelgroup{$k}{$a}=1;
|
|
230 $hcorrelgroup{$k}{$b}=1;
|
|
231 # $hcorrelgroup{$k}{frag}.="#".$s;
|
|
232 $count++;
|
|
233 last;
|
|
234 }
|
|
235 }
|
|
236 if($count == 0){
|
|
237 my $groupnb="group".$groupct;
|
|
238 $hcorrelgroup{$groupnb}{$a}=1;
|
|
239 $hcorrelgroup{$groupnb}{$b}=1;
|
|
240 # $hcorrelgroup{$groupnb}{frag}.="#".$s;
|
|
241 $groupct ++;
|
|
242
|
|
243 }
|
|
244 $print = 1;
|
|
245 }
|
|
246
|
|
247 }
|
|
248 }
|
|
249 }
|
|
250 }
|
|
251 }
|
|
252
|
|
253
|
|
254 ### Option 3: Check that all mass differences are include in a specific list, ignoring RT information ###
|
|
255
|
|
256 elsif($opt == 3){
|
|
257
|
|
258 my $print = 0;
|
|
259 foreach my $s (keys %{$refhmass}){
|
|
260 foreach my $r (keys %{$refhmass->{$s}}){
|
|
261 my $rm = $r - $mass_threshold;
|
|
262 my $rp = $r + $mass_threshold;
|
|
263 if(($diff <= $rp) && ($diff >= $rm)){
|
|
264 if($print == 0){
|
|
265
|
|
266 # foreach my $s (keys %{%$refhmass{$r}}){
|
|
267 # print F2 "$line\t$hmass{$r}{$s} : $s ($r)\n";
|
|
268 foreach my $k (keys %hcorrelgroup){
|
|
269 if((defined($hcorrelgroup{$k}{$a})) || (defined($hcorrelgroup{$k}{$b}))){
|
|
270 $hcorrelgroup{$k}{$a}=1;
|
|
271 $hcorrelgroup{$k}{$b}=1;
|
|
272 # $hcorrelgroup{$k}{frag}.="#".$s;
|
|
273 $count++;
|
|
274 last;
|
|
275 }
|
|
276 }
|
|
277 if($count == 0){
|
|
278 my $groupnb="group".$groupct;
|
|
279 $hcorrelgroup{$groupnb}{$a}=1;
|
|
280 $hcorrelgroup{$groupnb}{$b}=1;
|
|
281 # $hcorrelgroup{$groupnb}{frag}.="#".$s;
|
|
282 $groupct ++;
|
|
283 }
|
|
284 $print = 1;
|
|
285 }
|
|
286 }
|
|
287 }
|
|
288 }
|
|
289 }
|
|
290 }
|
|
291
|
|
292
|
|
293 }
|
|
294 }
|
|
295 }
|
|
296 }
|
|
297 $linenb ++;
|
|
298 }
|
|
299 close F1;
|
|
300 close F2;
|
|
301
|
|
302
|
|
303
|
|
304
|
|
305 #############################################
|
|
306 ### Join groups that have been subdivided ###
|
|
307 #############################################
|
|
308
|
|
309 my @tdelete;
|
|
310
|
|
311 foreach my $k (keys %hcorrelgroup){
|
|
312 foreach my $i (keys %{$hcorrelgroup{$k}}){
|
|
313 foreach my $v (keys %hcorrelgroup){
|
|
314 my $count = 0;
|
|
315 if ($v ne $k){
|
|
316 foreach my $w (keys %{$hcorrelgroup{$v}}){
|
|
317 # if($w ne "frag"){
|
|
318 if($w eq $i){
|
|
319 $count = 1;
|
|
320 push(@tdelete, $v);
|
|
321 }
|
|
322 # }
|
|
323 }
|
|
324 }
|
|
325 if($count == 1){
|
|
326 foreach my $w (keys %{$hcorrelgroup{$v}}){
|
|
327 $hcorrelgroup{$k}{$w}=$hcorrelgroup{$v}{$w};
|
|
328 }
|
|
329 delete($hcorrelgroup{$v});
|
|
330 }
|
|
331 }
|
|
332 }
|
|
333 }
|
|
334
|
|
335 foreach my $t (@tdelete){
|
|
336 delete($hcorrelgroup{$t});
|
|
337 }
|
|
338
|
|
339
|
|
340 ### Do it twice to see if it fix the problem of unmerge groups
|
|
341
|
|
342 foreach my $k (keys %hcorrelgroup){
|
|
343 foreach my $i (keys %{$hcorrelgroup{$k}}){
|
|
344 foreach my $v (keys %hcorrelgroup){
|
|
345 my $count = 0;
|
|
346 if ($v ne $k){
|
|
347 foreach my $w (keys %{$hcorrelgroup{$v}}){
|
|
348 # if($w ne "frag"){
|
|
349 if($w eq $i){
|
|
350 $count = 1;
|
|
351 push(@tdelete, $v);
|
|
352 }
|
|
353 # }
|
|
354 }
|
|
355 }
|
|
356 if($count == 1){
|
|
357 foreach my $w (keys %{$hcorrelgroup{$v}}){
|
|
358 $hcorrelgroup{$k}{$w}=$hcorrelgroup{$v}{$w};
|
|
359 }
|
|
360 delete($hcorrelgroup{$v});
|
|
361 }
|
|
362 }
|
|
363 }
|
|
364 }
|
|
365
|
|
366 foreach my $t (@tdelete){
|
|
367 delete($hcorrelgroup{$t});
|
|
368 }
|
|
369
|
|
370
|
|
371
|
|
372 ##########################################
|
|
373 ### Addition of annotation information ###
|
|
374 ##########################################
|
|
375
|
|
376 foreach my $k (keys %hcorrelgroup){
|
|
377 foreach my $i (keys %{$hcorrelgroup{$k}}){
|
|
378 foreach my $j (keys %{$hcorrelgroup{$k}}){
|
|
379 my $count = 0;
|
|
380 if ($i ne $j){
|
|
381
|
|
382 my $a = $hrtmz{$i}{mz};
|
|
383 my $b = $hrtmz{$j}{mz};
|
|
384
|
|
385 my $diff = $a - $b;
|
|
386 my $sign;
|
|
387 if($diff>0){
|
|
388 $sign="+";
|
|
389 }
|
|
390 if($diff<0){
|
|
391 $sign="-";
|
|
392 }
|
|
393 $diff = abs($diff);
|
|
394
|
|
395 foreach my $z (keys %{$refhmass}){
|
|
396
|
|
397 foreach my $y (keys %{$refhmass->{$z}}){
|
|
398 my $ym = $y - $mass_threshold;
|
|
399 my $yp = $y + $mass_threshold;
|
|
400
|
|
401
|
|
402 if(($diff <= $yp) && ($diff >= $ym)){
|
|
403 my $diff_list = $diff - $y;
|
|
404 $diff_list = abs($diff_list);
|
|
405 $diff_list = sprintf ("%0.6f", $diff_list);
|
|
406
|
|
407 if($hcorrelgroup{$k}{$i} eq 1){
|
|
408 my $val = "#".$j."|".$sign."(".$z.")(".$diff_list.")|";
|
|
409 $hcorrelgroup{$k}{$i}=$val;
|
|
410 $count ++;
|
|
411 }
|
|
412 else{
|
|
413 if($count == 0){
|
|
414 my $val = "#".$j."|".$sign."(".$z.")(".$diff_list.")|";
|
|
415 $hcorrelgroup{$k}{$i}.=$val;
|
|
416 $count ++;
|
|
417 }
|
|
418 else{
|
|
419 my $val = $sign."(".$z.")(".$diff_list.")|";
|
|
420 $hcorrelgroup{$k}{$i}.=$val;
|
|
421 $count ++;
|
|
422 }
|
|
423 }
|
|
424 }
|
|
425 }
|
|
426 }
|
|
427 }
|
|
428 }
|
|
429 }
|
|
430 }
|
|
431
|
|
432
|
|
433
|
|
434 ####################################################
|
|
435 ### Choose the representative ion for each group ###
|
|
436 ####################################################
|
|
437
|
|
438 my %hgrouprepres;
|
|
439
|
|
440 open(F3, $dataMatrix);
|
|
441
|
|
442 while (my $line = <F3>){
|
|
443 chomp $line;
|
|
444
|
|
445 my @tline = split (/\t/, $line);
|
|
446
|
|
447
|
|
448
|
|
449 foreach my $k (keys %hcorrelgroup){
|
|
450 foreach my $i (keys %{$hcorrelgroup{$k}}){
|
|
451
|
|
452 if($tline[0] eq $i){
|
|
453 $hgrouprepres{$k}{$i}{mass}=$hrtmz{$tline[0]}{mz};
|
|
454
|
|
455 my $intensity;
|
|
456 my $nbsubjects=0;
|
|
457 for(my $y=1;$y<scalar(@tline);$y++){
|
|
458 $intensity += $tline[$y];
|
|
459 $nbsubjects ++;
|
|
460 }
|
|
461 my $meanintensity = $intensity/$nbsubjects;
|
|
462 $hgrouprepres{$k}{$i}{intensity}=$meanintensity;
|
|
463 $hgrouprepres{$k}{$i}{squaredmassint}=($hgrouprepres{$k}{$i}{mass}**2)/($hgrouprepres{$k}{$i}{intensity});
|
|
464 }
|
|
465 }
|
|
466 }
|
|
467 }
|
|
468 close F3;
|
|
469
|
|
470 foreach my $z (keys %hgrouprepres){
|
|
471 my $max_intensity = 0;
|
|
472 my $max_int_ion = "";
|
|
473 my $max_mass = 0;
|
|
474 my $max_mass_ion = "";
|
|
475 my $max_squared = 0;
|
|
476 my $max_squared_ion = "";
|
|
477 foreach my $w (keys %{$hgrouprepres{$z}}){
|
|
478 if($hgrouprepres{$z}{$w}{intensity} > $max_intensity){
|
|
479 $max_intensity = $hgrouprepres{$z}{$w}{intensity};
|
|
480 $max_int_ion = $w;
|
|
481
|
|
482 }
|
|
483 if($hgrouprepres{$z}{$w}{mass} > $max_mass){
|
|
484 $max_mass = $hgrouprepres{$z}{$w}{mass};
|
|
485 $max_mass_ion = $w;
|
|
486 }
|
|
487 if($hgrouprepres{$z}{$w}{squaredmassint} > $max_squared){
|
|
488 $max_squared = $hgrouprepres{$z}{$w}{squaredmassint};
|
|
489 $max_squared_ion = $w;
|
|
490 }
|
|
491 }
|
|
492
|
|
493 my $max_int_max_mass_ion="";
|
|
494
|
|
495 if($repres_opt eq "max_intensity_max_mass"){
|
|
496 my %hfirst;
|
|
497 my $first=0;
|
|
498 foreach my $w (reverse sort {$hgrouprepres{$z}{$a}{intensity} <=> $hgrouprepres{$z}{$b}{intensity} } keys %{$hgrouprepres{$z}}){
|
|
499 $first ++;
|
|
500 if ($first <= 3){
|
|
501 $hfirst{$w} = $hgrouprepres{$z}{$w}{intensity};
|
|
502 }
|
|
503 }
|
|
504
|
|
505 my $first_2 = 0;
|
|
506 my $intens_max = 0;
|
|
507 my $mass_max = 0;
|
|
508
|
|
509 foreach my $y (reverse sort {$hfirst{$a} <=> $hfirst{$b}} keys %hfirst){
|
|
510
|
|
511
|
|
512
|
|
513 $first_2 ++;
|
|
514 if($first_2 == 1){
|
|
515 $intens_max = $hfirst{$y};
|
|
516 if($intensity_threshold > $intens_max){
|
|
517 $intensity_threshold = 0;
|
|
518 }
|
|
519 $max_int_max_mass_ion = $y;
|
|
520 $mass_max = $hgrouprepres{$z}{$y}{mass};
|
|
521 }
|
|
522 if($hgrouprepres{$z}{$y}{mass} > $mass_max){
|
|
523 if($hfirst{$y}>$intensity_threshold){
|
|
524 my $a = $intens_max * $intensity_pourc;
|
|
525 if($hfirst{$y} > $a){
|
|
526 $max_int_max_mass_ion = $y;
|
|
527 $mass_max = $hgrouprepres{$z}{$y}{mass};
|
|
528 }
|
|
529 }
|
|
530 }
|
|
531
|
|
532 }
|
|
533 }
|
|
534
|
|
535
|
|
536 $hgrouprepres{$z}{max_int}=$max_int_ion;
|
|
537 $hgrouprepres{$z}{max_mass}=$max_mass_ion;
|
|
538 $hgrouprepres{$z}{max_squared}=$max_squared_ion;
|
|
539 $hgrouprepres{$z}{max_int_max_mass}=$max_int_max_mass_ion;
|
|
540
|
|
541 }
|
|
542
|
|
543
|
|
544 ######################
|
|
545 ### Print result ! ###
|
|
546 ######################
|
|
547
|
|
548 open(F4, ">$output_tabular");
|
|
549 open(F5, $combined_DMVM);
|
|
550
|
|
551 my $line_nb = 0;
|
|
552 my %hheader;
|
|
553 while (my $line = <F5>){
|
|
554 chomp $line;
|
|
555
|
|
556
|
|
557 my @tline = split (/\t/, $line);
|
|
558
|
|
559 if($line_nb == 0){
|
|
560 print F4 "$line\tACF_groups";
|
|
561 if($opt == 1){
|
|
562 if($repres_opt eq "intensity"){print F4 "\tintensity_repres\tACF_filter\n"}
|
|
563 if($repres_opt eq "mass"){print F4 "\tmass_repres\tACF_filter\n"}
|
|
564 if($repres_opt eq "mixt"){print F4 "\tmass2intens_repres\tACF_filter\n"}
|
|
565 if($repres_opt eq "max_intensity_max_mass"){print F4 "\tmax_intensity_max_mass_repres\tACF_filter\n"}
|
|
566
|
|
567 }
|
|
568 else{
|
|
569 if($repres_opt eq "intensity"){print F4 "\tintensity_repres\tisotopes_adducts_fragments_[#id|annotation(delta_annotation)]\tACF_filter\n"}
|
|
570 if($repres_opt eq "mass"){print F4 "\tmass_repres\tisotopes_adducts_fragments_[#id|annotation(delta_annotation)]\tACF_filter\n"}
|
|
571 if($repres_opt eq "mixt"){print F4 "\tmass2intens_repres\tisotopes_adducts_fragments_[#id|annotation(delta_annotation)]\tACF_filter\n"}
|
|
572 if($repres_opt eq "max_intensity_max_mass"){print F4 "\tmax_intensity_max_mass_repres\tisotopes_adducts_fragments_[#id|annotation(delta_annotation)]\tACF_filter\n"}
|
|
573 }
|
|
574
|
|
575
|
|
576 ### Creation of a header hash
|
|
577 for(my $i=0; $i<scalar(@tline);$i++){
|
|
578 my $a = $tline[$i];
|
|
579 $hheader{$a}=$i;
|
|
580 }
|
|
581 }
|
|
582
|
|
583 else{
|
|
584 my $find = 0;
|
|
585 foreach my $v (keys %hcorrelgroup){
|
|
586 if(defined($hgrouprepres{$v}{$tline[0]})){
|
|
587 print F4 "$line\t$v";
|
|
588
|
|
589
|
|
590 if($repres_opt eq "intensity"){print F4 "\t$hgrouprepres{$v}{max_int}\t"}
|
|
591 if($repres_opt eq "mass"){print F4 "\t$hgrouprepres{$v}{max_mass}\t"}
|
|
592 if($repres_opt eq "mixt"){print F4 "\t$hgrouprepres{$v}{max_squared}\t"}
|
|
593 if($repres_opt eq "max_intensity_max_mass"){print F4 "\t$hgrouprepres{$v}{max_int_max_mass}\t"}
|
|
594
|
|
595
|
|
596 if($opt != 1){
|
|
597 if(defined($hcorrelgroup{$v}{$tline[0]})){
|
|
598 print F4 "$hcorrelgroup{$v}{$tline[0]}\t";
|
|
599 }
|
|
600 else{
|
|
601 print F4 "\t";
|
|
602 }
|
|
603 }
|
|
604
|
|
605 if($repres_opt eq "intensity"){
|
|
606 if($tline[0] eq $hgrouprepres{$v}{max_int}){
|
|
607 print F4 "conserved\n";
|
|
608 }
|
|
609 else{
|
|
610 print F4 "deleted\n";
|
|
611 }
|
|
612 $find = 1;
|
|
613 }
|
|
614 if($repres_opt eq "mass"){
|
|
615 if($tline[0] eq $hgrouprepres{$v}{max_mass}){
|
|
616 print F4 "conserved\n";
|
|
617 }
|
|
618 else{
|
|
619 print F4 "deleted\n";
|
|
620 }
|
|
621 $find = 1;
|
|
622 }
|
|
623 if($repres_opt eq "mixt"){
|
|
624 if($tline[0] eq $hgrouprepres{$v}{max_squared}){
|
|
625 print F4 "conserved\n";
|
|
626 }
|
|
627 else{
|
|
628 print F4 "deleted\n";
|
|
629 }
|
|
630 $find = 1;
|
|
631 }
|
|
632 if($repres_opt eq "max_intensity_max_mass"){
|
|
633 if($tline[0] eq $hgrouprepres{$v}{max_int_max_mass}){
|
|
634 print F4 "conserved\n";
|
|
635 }
|
|
636 else{
|
|
637 print F4 "deleted\n";
|
|
638 }
|
|
639 $find = 1;
|
|
640 }
|
|
641 }
|
|
642 }
|
|
643 if($find == 0){
|
|
644 $groupct ++;
|
|
645 my $group = "group".$groupct;
|
|
646 if($opt != 1){
|
|
647 print F4 "$line\t$group\t-\t-\t-\n";
|
|
648 }
|
|
649 else{
|
|
650 print F4 "$line\t$group\t-\t-\n";
|
|
651 }
|
|
652 }
|
|
653
|
|
654
|
|
655 }
|
|
656
|
|
657 $line_nb ++;
|
|
658 }
|
|
659
|
|
660
|
|
661 return ($output_sif, $output_tabular);
|
|
662 }
|
|
663
|
|
664
|
|
665
|
|
666
|
|
667
|
|
668 1; |