-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenomic_agg.pl
More file actions
718 lines (621 loc) · 17.7 KB
/
genomic_agg.pl
File metadata and controls
718 lines (621 loc) · 17.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
#!/usr/local/bin/perl
#use warnings;
#use strict; this has been blocked to allow the script to create files 'on the fly'
#The following script does several tasks:
#1. It calculates the average measure of Morisita's Index of aggregation for Pyrimidines within coding and noncoding regions,
#and for Purines within coding and noncoding regions.
#2. It creates 100 randomized versions of each genome and performs the above operations.
#3. It creates files to hold every estimate of aggregation from real genomes, and 100 measurements of average aggregation from randomized genomes.
#4. It creates a plain text document of the genome in binary code representing coding and noncoding regions.
#The glob utility uses a specific path to access a folder containing subfolders of two genome files. One file is a genomic features file (.gb) conforming to the
#NCBI microbial genome database format, the other file is the .fasta file corresponding to the feature file.
#The script reads the fasta file and recodes it in binary form for purines (A,G) and pyrimidines (C,T). The script then reads the genome features file (.gb) and
#creates a plain text document (ending in _crs) to hold a binary representation of coding and noncoding regions. It then reads both binary files and separates
#the binary sequence file (purines and pyrimidines) into two arrays. One represents purines or pyrimidines within coding regions. The other represents
#purines or pyrimidines in noncoding regions.
#A window (containing number of quadrats and number of bases within quadrats) is then moved along the arrays using while loops. Morisita's I is calculated for each window.
#Since each array (coding and noncoding) will contain thousands of windows, thousands of measurements of Morisita's I are averaged.
#The script then creates 100 randomizations per genome and performs the above operations (lines 22-23) on each.
#Upon completion, each species folder will contain 11 files: a features file (.gb), a .fasta file, a binary coding/noncoding sequence file (_crs),
#and 8 files holding measurements of Morosita's I.
# The following abbreviations denote files the script will create:
#C_pur: purines within coding regions
#C_pyr: pyrimidines within coding regions
#NC_pur: purines within noncoding regions
#NC_pyr: pyrimidines within noncoding regions
#RC_pur: purines within randomized coding regions
#RC_pyr: pyrimidines within randomized coding regions
#RN_pur: purines within randomized noncoding regions
#RN_pyr: pyrimidines within randomized noncoding regions
## FEATURE FILES, FASTA FILES, AND FILE FOLDERS MUST HAVE IDENTICAL NAMES!
## FILE PATHS WILL LIKELY NEED TO BE SPECIFIED FOR YOUR FILE SYSTEM ON THESE LINES:
# 55, 58, 65, 88, 94, 95, 216, 217, 399, 400, 403, 537, 538
#
#
#
#
#
use List::Util 'shuffle'; #a utility to randomize coding and noncoding regions
my$name;
my$quads = 10; #Determines the size of the window (e.g. $quads = 10, $bases = 10 represents a window of 10 quadrats and 10 bases per quadrat).
my$bases = 10; #The maximum occupancy of a quadrat is $bases.
my($Cavg,$NCavg,$countC,$countN,$simcount,$codreg,$nonreg,$countR,$Ni,$end,$Ci);
my@miniN = ();my@miniC = ();my@mIC = ();my@mIN = ();my@aQS = 10;
my@files = glob("/home/kenlocey/bioinfo/genomes/NOT_DONE/*"); #This file path should be rescripted to the user's system.
foreach (@files){
if (/\/home\/kenlocey\/bioinfo\/genomes\/NOT_DONE\/(\S+)/){ #This file path should be rescripted to the user's system
$name = $1;
}
my$name_crs = $name . "_crs";
print " $name\n";
open (FILE, "NOT_DONE/$name/$name.fasta") or die; #This file path should be rescripted to the user's system
my$file = <FILE>;
open (AGG, ">agg") or die;
while ($file = <FILE>) {
chomp($file);
$file =~ s/(<br>)//g; # binary coding assignment
$file =~ s/c/1/ig;
$file =~ s/t/1/ig;
$file =~ s/a/0/ig;
$file =~ s/g/0/ig;
print AGG $file;
}
close(FILE);
close(AGG);
#print "A "; ##prints to screen to indicate progress (tends to 'choke' here on genomes exceeding 13mbp)
open(IN, "agg");
my$seq = <IN>;
my@seq2 = split(//,$seq); #split is the utility called to 'split' the binary sequence file into coding and noncoding arrays
my$seqsize = @seq2;
#print "seqsize: $seqsize\n";
open(IN2, "NOT_DONE/$name/$name_crs") or die;
my$cod = <IN2>;
my@code = split(//,$cod); #splits the binary file of coding and noncoding seqs into coding and noncoding arrays
my$codesize = @code;
#print "B\n"; ##prints to screen to indicate progress
open(OUTN, ">NOT_DONE/$name/N_pyr");
open(OUTC, ">NOT_DONE/$name/C_pyr");
my$count=0;my$counts=0;my$C=0;my$SS=0;my$avg=0;my$mtotalC=0;my$N=0;my$nW=0;my$qtotal=0;my$wtotal=0;my$pos=0;my$count1=0;my$count2=0;my$mI=0;my$mtotalN=0;my$mavgN=0;my$mavgC=0;my$mTN=0;my$mTC=0;my$mavgRC=0;my$mavgRN=0;my$mtotalRN=0;my$mtotalRC=0;
#######################################################################
####################################################################### FOR PYRIMIDINES #########################################################################
$end = $bases-1;
@miniN = ();
@miniC = ();
while($C < $codesize) {
if ($code[$C] == 0) {
push(@miniN,$seq2[$C]);
}
else {
push(@miniC,$seq2[$C]);
}
$C++;
}
$C = 0;
$Ni = @miniN;
$N = @miniN;
#print "Noncoding: $N ; ";
$nW = ($N-($N%100))/100;
while ($count1 < $nW) {
while ($count2 < 10){
#print "$mini[$pos]\n";
while ($pos <= $end) {
if ($miniN[$pos] == 1) {
$qtotal++;
$aQS[$count2] = $qtotal;
$wtotal++;
#print "$wtotal\n";
}
$pos++;
}
$end = $end + 10;
$count2++;
$qtotal = 0;
}
#print "total 1's: $wtotal\n";
$avg = $wtotal/10;
#print "average: $avg\n";
$count = 0;
while ($count < 10) {
$SS = $SS + (($aQS[($count2 - $count -1)] - $avg)**2);
$count++;
}
$count = 0;
$mI = ($wtotal/($wtotal-1))*(1/$avg)*((($SS/($quads-1))/$avg) + $avg - 1);
print OUTN "$mI\n";
$mtotalN = $mtotalN + $mI;
$count1++;
$wtotal=0;$count2=0;$SS=0;
}## END OF WINDOW LOOP
@miniN = ();
$mavgN = $mtotalN/$nW;
$count1=0;$pos=0;$mI=0;$mtotalN=0;$nW=0;$N=0;$count=0;$avg=0;
$end = 9;
$Ci = @miniC;
$N = @miniC;
$nW = ($N-($N%100))/100;
while ($count1 < $nW) {
while ($count2 < 10){
while ($pos <= $end) {
if ($miniC[$pos] == 1) {
$qtotal++;
$aQS[$count2] = $qtotal;
$wtotal++;
}
$pos++;
}
$end = $end + 10;
$count2++;
$qtotal = 0;
}
#print "total 11's: $wtotal\n";
$avg = $wtotal/10;
$count = 0;
while ($count < 10) {
$SS = $SS + (($aQS[($count2 - $count -1)] - $avg)**2);
$count++;
}
$count = 0;
if($wtotal == 1) {
print "@mini\n$avg\n";
}
$mI = ($wtotal/($wtotal-1))*(1/$avg)*((($SS/($quads-1))/$avg) + $avg - 1);
print OUTC "$mI\n";
$mtotalC = $mtotalC + $mI;
$count1++;
$wtotal=0;$count2=0;$SS=0;$mI=0;
}## END OF WINDOW LOOP
@miniC= ();
$mavgC = $mtotalC/$nW;
$end = 9;
$mtotalN=0;$mtotalC=0;
close(OUTN);
close(OUTC);
################################################################################### For Random Pyrimidines
#########################################################################################################################################################################################
#print "Random Pyrimidines\n"; ##prints to screen to indicate progress
open(OUT4C, ">NOT_DONE/$name/RC_pyr");
open(OUT4N, ">NOT_DONE/$name/RN_pyr");
$count=0;$C=0;$avg=0;$N=0;$nW=0;$qtotal=0;$pos=0;$count1=0;$mI=0;$simcount=0;
while($simcount < 100){
print "$name PYR $simcount\n";
#print "count1: $count1\n";
$codreg=0;$nonreg=0;$countR=0;
my@AoA = ();
my@mini2=();
while($countR < $codesize) {
if($code[$countR] == 1){
while(($code[$countR] == 1) && ($countR < $codesize)){
push(@mini2,$seq2[$countR]);
$countR++;
}
@shuf = shuffle(@mini2);
push (@AoA, @shuf);
@mini2 = ();
$codreg++;
}
else{
while(($code[$countR] == 0) && ($countR < $codesize)){
push(@mini2,$seq2[$countR]);
$countR++;
}
@shuf = shuffle(@mini2);
push (@AoA, @shuf);
@mini2 = ();
$nonreg++;
}
}
$AoAsize = @AoA;
@mini2 =();
$countR = 0;
#print "AoAsize: $AoAsize\n";
#$N = @miniN;
#print "miniN: $N\n";
$C = 0;
while($C < $codesize) {
if ($code[$C] == 0) {
push(@miniN,$AoA[$C]);
}
else {
push(@miniC,$AoA[$C]);
}
$C++;#print "N: $N\n";
}
$C = 0;
@AoA = ();
#print "$simcount\n";
$N = @miniN;
#print "miniN: $N\n";
$nW = ($N-($N%100))/100;
# print "number of windows: $nW\n";
while ($count1 < $nW) {
while ($count2 < 10){
#print "$mini[$pos]\n";
while ($pos <= $end) {
if ($miniN[$pos] == 1) {
$qtotal++;
$aQS[$count2] = $qtotal;
$wtotal++;
#print "$wtotal\n";
}
$pos++;
}
$end = $end + 10;
$count2++;
$qtotal = 0;
}
#print "total 1's: $wtotal\n";
$avg = $wtotal/10;
#print "average: $avg\n";
$count = 0;
while ($count < 10) {
$SS = $SS + (($aQS[($count2 - $count -1)] - $avg)**2);
$count++;
}
$count = 0;
$mI = ($wtotal/($wtotal-1))*(1/$avg)*((($SS/($quads-1))/$avg) + $avg - 1);
$mtotalRN = $mtotalRN + $mI;
$count1++;
$mI=0;$wtotal=0;$count2=0;$SS=0;
}## END OF WINDOW LOOP
#print "windows: $nW\n";
$mavgRN = $mtotalRN/$nW;
@miniN= ();
push (@mIN,$mavgRN);
print OUT4N "$mavgRN\n";
$mTN = $mTN + $mavgRN;
$mavgRN=0;$mtotalRN=0;$count1=0;$pos=0;$nW=0;$N=0;$avg=0;
$end = 9;
$N = @miniC;
#print "$N\n";
$nW = ($N-($N%100))/100;
#print "number of windows: $nW\n";
while ($count1 < $nW) {
while ($count2 < 10){
while ($pos <= $end) {
if ($miniC[$pos] == 1) {
$qtotal++;
$aQS[$count2] = $qtotal;
$wtotal++;
}
$pos++;
}
$end = $end + 10;
$count2++;
$qtotal = 0;
}
#print "total 11's: $wtotal\n";
$avg = $wtotal/10;
$count = 0;
while ($count < 10) {
$SS = $SS + (($aQS[($count2 - $count -1)] - $avg)**2);
$count++;
}
$count = 0;
#if($wtotal == 1) {
#print "@miniC\n$avg\n";
#}
$mI = ($wtotal/($wtotal-1))*(1/$avg)*((($SS/($quads-1))/$avg) + $avg - 1);
$mtotalRC = $mtotalRC + $mI;
$count1++;
$mI=0;$wtotal=0;$count2=0;$SS=0;
}## END OF WINDOW LOOP
@miniC= ();
$mavgRC = $mtotalRC/$nW;
print OUT4C "$mavgRC\n";
push (@mIC,$mavgRC);
$mTC = $mTC + $mavgRC;
$mavgRC=0;$mtotalRC=0;$C=0;$avg=0;$N=0;$nW=0;$qtotal=0;$pos=0;$count1=0;
$end = 9;
$simcount++;
}
$Cavg = $mTC/$simcount;
$NCavg = $mTN/$simcount;
$Ccount=0;$Ccounts=0;
foreach(@mIC){
if ($mavgC > $_){
$Ccount++;
}
if ($mavgC < $_){
$Ccounts++;
}
}
$Ncount=0;$Ncounts=0;
foreach(@mIN){
if ($mavgN > $_){
$Ncount++;
}
if ($mavgN < $_){
$Ncounts++;
}
}
open (REPORT, ">>report2_2-OCT-2010") or die;
print REPORT " $name\nQ$quads,B$bases Seq:$seqsize Cod:$codesize C: $Ci N: $Ni\n\nPYR: mI Coding: $mavgC; mI Noncoding: $mavgN\nRand PYR: C: $Cavg, B$Ccount,S$Ccounts N: $NCavg, B$Ncount,S$Ncounts\n";
close(REPORT);
close(OUT4C);
close(OUT4N);
close(IN);
@mIC = ();
@mIN = ();
$mavgN=0;$mavgC=0;
########################################################################## For Purines
###################################################################################################################################
open(OUT2C, ">NOT_DONE/$name/C_pur");
open(OUT2N, ">NOT_DONE/$name/N_pur");
open (FILEE, "NOT_DONE/$name/$name.fasta") or die;
my$filee = <FILEE>;
open (AGG, ">agg") or die;
while ($filee = <FILEE>) {
chomp($filee);
$filee =~ s/(<br>)//g; # substituting 0's for pyrimidines and 1's for purines
$filee =~ s/c/0/ig;
$filee =~ s/t/0/ig;
$filee =~ s/a/1/ig;
$filee =~ s/g/1/ig;
print AGG $filee;
}
close(FILEE);
close(AGG);
open(IN3, "agg");
my$seqq = <IN3>;
my@seq3 = split(//,$seqq);
my$seqsize = @seq3;
#print "$seqsize\n";
$wtotal=0;
my$end = $bases-1;
my@mini = ();
while($C < $codesize) {
if ($code[$C] == 0) {
push(@miniN,$seq3[$C]);
}
else{
push(@miniC,$seq3[$C]);
}
$C++;
}
$N = @miniN;
#print "$N\n";
$nW = ($N-($N%100))/100;
#print "windows: $nW\n";
#print "number of windows: $nW\n";
while ($count1 < $nW) {
while ($count2 < 10){
#print "$mini[$pos]\n";
while ($pos <= $end) {
if ($miniN[$pos] == 1) {
$qtotal++;
$aQS[$count2] = $qtotal;
$wtotal++;
#print "$wtotal\n";
}
$pos++;
}
$end = $end + 10;
$count2++;
$qtotal = 0;
}
#print "total 1's: $wtotal\n";
$avg = $wtotal/10;
#print "average: $avg\n";
$count = 0;
while ($count < 10) {
$SS = $SS + (($aQS[($count2 - $count -1)] - $avg)**2);
$count++;
}
$count = 0;
$mI = ($wtotal/($wtotal-1))*(1/$avg)*((($SS/($quads-1))/$avg) + $avg - 1);
print OUT2N "$mI\n";
$mtotalN = $mtotalN + $mI;
$count1++;
$wtotal=0;$count2=0;$SS=0;
}## END OF WINDOW LOOP
$mavgN = $mtotalN/$nW;
$end = 9;
$count1=0;$pos=0;$mI=0;$nW=0;$N=0;$count=0;$avg=0;$C=0;
@miniN= ();
$N = @miniC;
#print "$N\n";
$nW = ($N-($N%100))/100;
#print "number of windows: $nW\n";
while ($count1 < $nW) {
while ($count2 < 10){
while ($pos <= $end) {
if ($miniC[$pos] == 1) {
$qtotal++;
$aQS[$count2] = $qtotal;
$wtotal++;
}
$pos++;
}
$end = $end + 10;
$count2++;
$qtotal = 0;
}
#print "total 11's: $wtotal\n";
$avg = $wtotal/10;
$count = 0;
while ($count < 10) {
$SS = $SS + (($aQS[($count2 - $count -1)] - $avg)**2);
$count++;
}
$count = 0;
if($wtotal == 1) {
print "@mini\n$avg\n";
}
$mI = ($wtotal/($wtotal-1))*(1/$avg)*((($SS/($quads-1))/$avg) + $avg - 1);
print OUT2C "$mI\n";
$mtotalC = $mtotalC + $mI;
$count1++;
$wtotal=0;$count2=0;$SS=0;
}## END OF WINDOW LOOP
$mavgC = $mtotalC/$nW;
$end = 9;
@miniC = ();
$count1=0;$pos=0;$mI=0;$nW=0;$N=0;$count=0;$avg=0;$C=0;
close(OUT2C);
close(OUT2N);
##################################################################################### FOR RANDOM PURINES
################################################################################################################################################################
#print "\n$seqsize\n";
open(OUT3C, ">NOT_DONE/$name/RC_pur");
open(OUT3N, ">NOT_DONE/$name/RN_pur");
$simcount=0;$mTN=0;$mTC=0;$qtotal=0;
while($simcount < 100){
print "$name PUR $simcount\n";
$codreg=0;$nonreg=0;$countR=0;
@AoA = ();
@mini2=();
#$AoAsize = @AoA;
#print "AoAsize: $AoAsize\n";
#print "codesize: $codesize\n";
while($countR < $codesize) {
if($code[$countR] == 1){
while(($code[$countR] == 1) && ($countR < $codesize)){
push(@mini2,$seq3[$countR]);
$countR++;
}
@shuf = shuffle(@mini2);
push (@AoA, @shuf);
@mini2 = ();
$codreg++;
}
else{
while(($code[$countR] == 0) && ($countR < $codesize)){
push(@mini2,$seq3[$countR]);
$countR++;
}
@shuf = shuffle(@mini2);
push (@AoA, @shuf);
@mini2 = ();
$nonreg++;
}
}
$AoAsize = @AoA;
#print "AoAsize: $AoAsize\n";
while($C < $codesize) {
if ($code[$C] == 0) {
push(@miniN,$AoA[$C]);
}
elsif($code[$C] == 1) {
push(@miniC,$AoA[$C]);
}
$C++;
}
my$countR=0;
my@AoA = ();
my@mini2=();
print "$simcount\n";
$N = @miniN;
#print "@miniN\n";
#print "N: $N\n";
$nW = ($N-($N%100))/100;
while ($count1 < $nW) {
while ($count2 < 10){
while ($pos <= $end) {
if ($miniN[$pos] == 1) {
$qtotal++;
$aQS[$count2] = $qtotal;
$wtotal++;
}
$pos++;
}
$end = $end + 10;
$count2++;
$qtotal = 0;
}
#print "total 1's: $wtotal\n";
$avg = $wtotal/10;
#print "average: $avg\n";
$count = 0;
while ($count < 10) {
$SS = $SS + (($aQS[($count2 - $count -1)] - $avg)**2);
$count++;
}
$count = 0;
$mI = ($wtotal/($wtotal-1))*(1/$avg)*((($SS/($quads-1))/$avg) + $avg - 1);
$mtotalRN = $mtotalRN + $mI;
$count1++;
$wtotal=0;$count2=0;$SS=0;
}## END OF WINDOW LOOP
#print "windows: $nW\n";
$mavgRN = $mtotalRN/$nW;
push (@mIN,$mavgRN);
print OUT3N "$mavgRN\n";
$mTN = $mTN + $mavgRN;
$mtotalRN=0;$mavgRN=0;$count1=0;$pos=0;$mI=0;$nW=0;$N=0;$avg=0;
$end = 9;
@miniN= ();
$N = @miniC;
#print "$N\n";
$nW = ($N-($N%100))/100;
#print "number of windows: $nW\n";
while ($count1 < $nW) {
while ($count2 < 10){
while ($pos <= $end) {
if ($miniC[$pos] == 1) {
$qtotal++;
$aQS[$count2] = $qtotal;
$wtotal++;
}
$pos++;
}
$end = $end + 10;
$count2++;
$qtotal = 0;
}
#print "total 11's: $wtotal\n";
$avg = $wtotal/10;
$count = 0;
while ($count < 10) {
$SS = $SS + (($aQS[($count2 - $count -1)] - $avg)**2);
$count++;
}
$count = 0;
if($wtotal == 1) {
print "@mini\n$avg\n";
}
$mI = ($wtotal/($wtotal-1))*(1/$avg)*((($SS/($quads-1))/$avg) + $avg - 1);
$mtotalRC = $mtotalRC + $mI;
$count1++;
$wtotal=0;$count2=0;$SS=0;
}## END OF WINDOW LOOP
@miniC= ();
$mavgRC = $mtotalRC/$nW;
push (@mIC,$mavgRC);
print OUT3C "$mavgRC\n";
$mTC = $mTC + $mavgRC;
$end = 9;
$mavgRC=0;$mtotalRC=0;$C=0;$avg=0;$N=0;$nW=0;$pos=0;$count1=0;$mI=0;$qtotal=0;
$simcount++;
}
close(IN3);
close(IN2);
close(OUT3C);
close(OUT3N);
my$Cavg = $mTC/$simcount;
my$NCavg = $mTN/$simcount;
$Ccount=0;$Ccounts=0;
foreach(@mIC){
if ($mavgC > $_){
$Ccount++;
}
if ($mavgC < $_){
$Ccounts++;
}
}
$Ncount=0;$Ncounts=0;
foreach(@mIN){
if ($mavgN > $_){
$Ncount++;
}
if ($mavgN < $_){
$Ncounts++;
}
}
@mIN = ();
@mIC = ();
open (REPORT, ">>report2_2-OCT-2010") or die;
print REPORT "\nPUR: mI Coding: $mavgC; mI Noncoding: $mavgN\n";
print REPORT "R PUR: mI C: $Cavg, B$Ccount,S$Ccounts N: $NCavg, B$Ncount,S$Ncounts\n\n\n";
close(REPORT);
}
################################################################# The End ###############################