in reply to Iso electric point calculation using perl

# calculate pI.

Hmmm, have you considered this:

 print "pI = ", (4 * atan2 1, 1), "\n";

or, even simpler:

print "pI = ", 3.14159265, "\n"

?

OK, I've tried to make some fun, I am not sure that this was really funny, but, frankly, my point is that you are posting a 120-line script obviously highly specialized in biology without giving any explanation of what it is supposed to do, just saying that you don't get any output. I am actually almost surprised that you found some people able to give an answer.

I did some study in biology, but last time I had a course in biology and related sciences was in my first year of medecine study back in 1973-1974, after which I decided to give up medecine (because I found that I did not like it, I actually passed my first year exams, but did not see myself going through that for still many years) and to go for maths and physics, which led me a few years later to software engineering and IT science. This is just to say that I followed some university courses in biology, biochemistry, biophysics, genetics, etc., so that I am not a complete ignoramus on the subject, but sufficiently long ago to have only very vague remembrance (as far as genetics is concerned, the knowledge in this field has so much progressed over the last 40 years that, even if I remembered today everything that I was supposed to learn at the time, my knowledge would probably be far lower than what a high school student is supposed to know today).

In brief, I have no clue on what your program is doing, I don't understand anything, and I think most people here are in more or less the same situation. It would be nice to give some explanations on what you expect.

BTW, just a small slightly off-topic question. From reading through your code (you see... I made an effort), I got the understanding that pI is required to be between 0 and 14, and that sounds like min and max values of pH in chemistry. My gut feeling is that this is extremely unlikely to be a coincidence, so, what is the relation between pH and pI?

Replies are listed 'Best First'.
Re^2: Iso electric point calculation using perl
by yuvraj_ghaly (Sexton) on Jul 22, 2013 at 04:55 UTC

    See As the caption of my talk is to calculate Iso electric point of protein sequences which you havenot understood properly.

    I have a Fasta file containing numerous protein sequences in Fasta format. You can check NCBI homepage for that. www.ncbi.nlm.nih.gov. My task is to calculate Isoelectric point of each protein sequences. The script I composed is not helping me. I'm not a Perl expert so I commited some mistake. I really dont know what. I keep on trying but I'm keep messing around. I need expert advice.

      repost what you have after corrections.What you posted the first time makes no sense.

        may be this code help you to know what I'm trying to do</p> <code> #! /usr/bin/perl -w use strict; $ph=0; $qn1=''; $qn2=''; $qn3='';$qn4='';$qn5=''; $qp1='';$qp2='';$qp3='';$qp4=''; $nq=''; open (S, "$ARGV[0]") || die "cannot open FASTA file to read: $!"; my %s;# a hash of arrays, to hold each line of sequence my %seq; #a hash to hold the AA sequences. my $key; while (<S>){ #Read the FASTA file. chomp; if (/>/){ s/>//; $key= $_; }else{ push (@{$s{$key}}, $_); } } foreach my $a (keys %s){ my $s= join("", @{$s{$a}}); $seq{$a}=$s; #print("$a\t$s\n"); } my @aa= qw(Length); #my @aa= qw(A R N D C Q E G H I L K M F P S T W Y V); my $aa= join("\t", @aa); print ("Sequence\t$aa\n"); foreach my $k (keys %seq){ my %count; # a hash to hold the count for each amino acid in the p +rotein. my @seq= split(//, $seq{$k}); foreach my $r(@seq){ $count{$r}++; } my @row; push(@row, $k); foreach my $a (@aa){ $count{$a}||=0; $count{$a}=length($seq{$k}); # $count{$a}= sprintf("%0.6f",($count{$a}/length($seq{$k}))); push(@row,$count{$a}); } my $row= join("\t",@row); print("\n$row\n"); } my $pkaC= 9.0; my $pkaD= 4.05; my $pkaE= 4.45; my $pkaY= 10.0; my $pkaH= 5.98; my $pkaK= 10.0; my $pkaR= 12.0; foreach my $pka (@row){ $qn1= -1/(1+10^(3.65-$ph)); $qn2= -$cys/(1+10^(9.0-$ph)); $qn3= -$asp/(1+10^(4.05-$ph)); $qn4= -$glu/(1+10^(4.45-$ph)); $qn5= -$tyr/(1+10^(10.0-$ph)); $qp1= 1/(1+10^($ph-8.2)); $qp2= $his/(1+10^($ph-5.98)); $qp3= $lys/(1+10^($ph-10.0)); $qp4= $arg/(1+10^($ph-12.0)); $nq= $qn1+$qn2+$qn3+$qn4+$qn5+$qp1+$qp2+$qp3+$qp4; } if ($ph>=7){ next; } if ($nq<=0){ next; $ph++= 0.01; } open (OUT, ">"."$nq"."_"."$number".".xls") or die "Cannot open file!"; print OUT "$nq";

        And this needs explanation:

        while (<S>){ #Read the FASTA file. chomp; if (/>/){ s/>//; $key= $_; }else{ push (@{$s{$key}}, $_); } }

        And this needs explanation:

        while (<S>){ #Read the FASTA file. chomp; if (/>/){ s/>//; $key= $_; }else{ push (@{$s{$key}}, $_); } }

        After having a good look at your entire program i must conclude i cannot help you unless i learn biology myself. good luck.