`open(FILE,"C:/Users/hp/Desktop/UNIQ.fasta");
$i = 0;
while($line = <FILE>)
{ chomp $line;
if($line =~/(\>gi\|\d{1,})/)
{
if($i >= 1)
{
$hash{$def[$i]} = $list[$i];
}
$i++;
$def[$i] = $line;
}
else
{
$list[$i] .= $line;
}
}
open(FILE,">C:/Users/hp/Desktop/Amino_acid_count_data.txt");
print
FILE "DEFINITION\tLENGTH\tG_RATIO\tE_RATIO\tD_RATIO\tA_RATIO\tV_RATIO\
+tR_RATIO\
tS_RATIO\tK_RATIO\tN_RATIO\tT_RATIO\tM_RATIO\tI_RATIO\tQ_RATIO\tH_RATI
+O\tP_RATI
O\tL_RATIO\tW_RATIO\tC_RATIO\tY_RATIO\tF_RATIO\tMiss_RATIO\n";
$o = 0;
foreach $k (keys %hash) {
$o++;
#print "$k => $hash{$k}\n";
Passref($k,$hash{$k},$o);
}
###########################sub boundary################
sub Passref
{
my($define,$seq,$count) = @_;
chomp ($define);
print $define,"\n";
print $seq,"\n";
print $count,"\n";
$len = length ($seq);
#print "\n$len\n";
$count_G = ( $seq =~ tr/G//);
#print "$count_G\n";
$count_E = ( $seq =~ tr/E//);
$count_D = ( $seq =~ tr/D//);
$count_A = ( $seq =~ tr/A//);
$count_V = ( $seq =~ tr/V//);
$count_R = ( $seq =~ tr/R//);
$count_S = ( $seq =~ tr/S//);
$count_K = ( $seq =~ tr/K//);
$count_N = ( $seq =~ tr/N//);
$count_T = ( $seq =~ tr/T//);
$count_M = ( $seq =~ tr/M//);
$count_I = ( $seq =~ tr/I//);
$count_Q = ( $seq =~ tr/Q//);
$count_H = ( $seq =~ tr/H//);
$count_P = ( $seq =~ tr/P//);
$count_L = ( $seq =~ tr/L//);
$count_W = ( $seq =~ tr/W//);
$count_C = ( $seq =~ tr/C//);
$count_Y = ( $seq =~ tr/Y//);
$count_F = ( $seq =~ tr/F//);
$count_Miss = ( $seq =~s/[^YCWLPHQIMTNKSRVADEGF]//ig);
#print "$count_Miss\n";
$ratio_G = ($count_G/$len);
#print "\n$ratio_G\n";
$ratio_E = ($count_E/$len);
$ratio_D = ($count_D/$len);
$ratio_A = ($count_A/$len);
$ratio_V = ($count_V/$len);
$ratio_R = ($count_R/$len);
$ratio_S = ($count_S/$len);
$ratio_K = ($count_K/$len);
$ratio_N = ($count_N/$len);
$ratio_T = ($count_T/$len);
$ratio_M = ($count_M/$len);
$ratio_I = ($count_I/$len);
$ratio_Q = ($count_Q/$len);
$ratio_H = ($count_H/$len);
$ratio_P = ($count_P/$len);
$ratio_L = ($count_L/$len);
$ratio_W = ($count_W/$len);
$ratio_C = ($count_C/$len);
$ratio_Y = ($count_Y/$len);
$ratio_F = ($count_F/$len);
$ratio_Miss = ($count_Miss/$len);
open(FH,">>C:/Users/hp/Desktop/Amino_acid_count_data.txt");
print
FH "$define\t$len\t$ratio_G\t$ratio_E\t$ratio_D\t$ratio_A\t$ratio_V\t$
+ratio_R\t
$ratio_S\t$ratio_K\t$ratio_N\t$ratio_T\t$ratio_M\t$ratio_I\t$ratio_Q\t
+$ratio_H\
t$ratio_P\t$ratio_L\t$ratio_W\t$ratio_C\t$ratio_Y\t$ratio_F\t$ratio_Mi
+ss\n";
#print "$define\t$len\t$ratio_G\t$ratio_E\t$ratio_D\t$ratio_A\t$ratio_
+V\t$ratio
_R\t$ratio_S\t$ratio_K\t$ratio_N\t$ratio_T\t$ratio_M\t$ratio_I\t$ratio
+_Q\t$rati
o_H\t$ratio_P\t$ratio_L\t$ratio_W\t$ratio_C\t$ratio_Y\t$ratio_F\t$rati
+o_Miss\n"
;
}
`

Comment onperlkhan 77DownloadCode