#!/usr/bin/perl #Naga_betrapally_6_3_16 use strict; use warnings; use Cwd; use FileHandle; my $name; # Naming of variables, remembers the name of the file my $cwd = getcwd(); #Takes in the current directory of files my $opendir = "$cwd"; #Used to open the current directory and remembers the location opendir (DIR, $opendir) or die $!; #Open directory command my @directory = readdir DIR; #Grabbing all the fas files stored in the location my $scalar = scalar(@directory); #Counting the number of files and printing it in the next line #print "The number of sample files in this folder: $scalar \n"; # for (my $i=0; $i){ chomp $file; if ($file =~/^Name/){ $header = $file; } else{ $array_lines[$n] = $file; chop $array_lines[$n]; $n++; } } for(my $i=0;$i<@array_lines;$i++){ my @tmp = split(/\t/,($array_lines[$i])); #print $tmp[3]; push @average_array, $tmp[3]; my $scalar = scalar(@average_array); #print $scalar; } foreach (@average_array){ #print "$_\n"; my $tmp = $_; $tmp =~ s/,//; #print "$tmp\n"; $sum = $sum+$tmp; } #print "The sum of all the mapping is $sum\n"; $avarage = $sum/11; #print "THe average of the mapping is $avarage\n"; close (FILE); } #### Name Consensus length Total read count Average coverage Reference sequence Reference length NSP4-E1 mapping 750 227760 64,516.84 NSP4-E1 750 VP7-G3 mapping 1062 303758 63,062.33 VP7-G3 1062 Rotarix-VP6 mapping 1356 161491 26,020.50 Rotarix-VP6 1356 Rotarix-NSP1 mapping 1559 114394 16,077.21 Rotarix-NSP1 1568 NSP2-N1 mapping 1059 80424 16,178.61 NSP2-N1 1058 NSP5-H1 mapping 664 75269 23,943.71 NSP5-H1 663 VP1-R1 mapping 3302 69677 4,542.15 VP1-R1 3302 VP2-C1 mapping 2717 149312 11,987.00 VP2-C1 2717 VP3-M1 mapping 2591 31795 2,632.39 VP3-M1 2591 RotaTeq-WI79-4-VP4 mapping 2359 78305 7,223.08 RotaTeq-WI79-4-VP4 2359 NSP3-T1 mapping 1074 173210 34,910.87 NSP3-T1 1074