Free2Code
The majority of forums are now only available as archives, which means posting/editing is disabled.

The Anything and Everything forum is still open.
 
Time: 2013-05-18, 02:00pm
frequency of aminoacid in a protein sequ
Subject: frequency of aminoacid in a protein sequ  ·  Posted: 2004-08-23, 11:22pm
Rank: ? (2)
Member #: 16705
print "please type the filename of protein sequences:";
$p_filename=<STDIN>;
chomp $p_filename;
unless(open(proteinfile,$p_filename)){
print"cannot open file\"$p_filename\"n\n";
exit;
}
@protein=<proteinfile>;
close proteinfile;
$protein = join('',@dna);
$protein=~s/\s//g;
@protein=('',$protein);
$count_of_A=0;
$count_of_R=0;
$count_of_N=0;
$count_of_D=0;
$count_of_C=0;
$count_of_Q=0;
$count_of_E=0;
$count_of_G=0;
$count_of_H=0;
$count_of_I=0;
$count_of_L=0;
$count_of_K=0;
$count_of_M=0;
$count_of_F=0;
$count_of_P=0;
$count_of_S=0;
$count_of_T=0;
$count_of_W=0;
$count_of_Y=0;
$count_of_V=0;
$errors =0;
foreach $aa(@protein){
if ($aa eq 'A' ){
++$count_of_A;
}elsif ($aa eq 'R'){
++$count_of_R;
}elsif($aa eq 'N'){
++$count_of_N;
}elsif($aa eq 'D'){
++$count_of_D;
}elsif($aa eq 'C'){
++$count_of_C;
++$count_of_C;
}elsif($aa eq 'Q'){
++$count_of_Q;
}elsif($aa eq 'E'){
++$count_of_E;
}elsif($aa eq 'G'){
++$count_of_G;
}elsif($aa eq 'H'){
++$count_of_H;
}elsif($aa eq 'I'){
++$count_of_I;
}elsif($aa eq 'L'){
++$count_of_L;
}elsif($aa eq 'K'){
++$count_of_K;
}elsif($aa eq 'M'){
}elsif($aa eq 'F'){
++$count_of_F;
}elsif($aa eq 'P'){
++$count_of_P;
}elsif($aa eq 'S'){
++$count_of_S;
}elsif($aa eq 'T'){
++$count_of_T;
}elsif($aa eq 'W'){
++$count_of_W;
}elsif($aa eq 'Y'){
++$count_of_Y;
}elsif($aa eq 'V'){
++$count_of_V;
}else{
print"!!!!!!!! Error-I don\'t recognize this aminoacid:$aa\n";
++$errors;
}
}
print "A=$count_of_A\n";
print "R=$count_of_R\n";
print "N=$count_of_N\n";
print "D=$count_of_D\n";
print "C=$count_of_C\n";
print "Q=$count_of_Q\n";
print "E=$count_of_E\n";
print "G=$count_of_G\n";
print "H=$count_of_H\n";
print "I=$count_of_I\n";
print "L=$count_of_L\n";
print "K=$count_of_K\n";
print "M=$count_of_M\n";
print "F=$count_of_F\n";
print "P=$count_of_P\n";
print "S=$count_of_S\n";
print "T=$count_of_T\n";
print "W=$count_of_w\n";
print "Y=$count_of_Y\n";
print "V=$count_of_V\n";
print "errors =$errors\n";
exit;
I have writen this program for finding the frequency of aminoacid in a protein sequence but i am not sucessful , can anybody please help me what should i modify in this programme.


 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

Penguino AVR

Want to learn about robotics or microcontrollers?
Check out the Penguino AVR from our friends at
Icy Labs