I have written this program to calculate GC and AT contents in a given sequence but am unable to ignore the case sensitiveness.
I would appreciate your help.
print"Enter the fasta file name \n";
$a=<>;
chomp($a);
unless(open(FH,$a)){
print"Error";
}
@a=<FH>;
close FH;
$a=join('',@a);
$a=~s /\s//g;
$n=length($a);
print "$n";
$a1=0;
$t=0;
$g=0;
$c=0;
$a1=($a=~tr/A//ig);
$t=($a=~tr/T//ig);
$g=($a=~tr/G//ig);
$c=($a=~tr/C//ig);
#$e=$n-($a+$t+$g+$c);
print "The counts are\n";
print"A:$a1 \n";
print"T:$t \n";
print"G:$g \n";
print"C:$c \n";
#print"E:$e \n";
$op = (($a1+$t)/$n)*100;
$op1 = (($g+$c)/$n)*100;
print " GC%= $op\n";
print " AT% = $op1";
this looks as if it works
then also error is coming as bareword found where operatoe is expected at ~tr/T... lines