Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
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" ; }

In reply to perlkhan 77 by perlkhan77

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (7)
    As of 2014-11-27 19:37 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My preferred Perl binaries come from:














      Results (187 votes), past polls