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";

In reply to Re^4: Iso electric point calculation using perl by yuvraj_ghaly
in thread Iso electric point calculation using perl by yuvraj_ghaly

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.