Thanq for the help guys. I don't think I've explained what I'm wanting to do properly. I am wanting to count the number of each type of character in a line, and then (eventually) find a way to print what the most common character was. This should generate a consensus sequence for my multiple alignments. (Im a bioinformatician)

So for example, say the line is ---ADGRCMNAAAPPRS I want the program to count the number of the different characters: $Acount, $Dcount, $gapcount (which is -) etc. and store the most common letter in my consensus sequence array. Think this is possible ?! Then the program should move onto the next line of the file and repeat the process... Thanks for pointing out I don't need to put $line, I realise now that the line information is stored in $_

basm100


In reply to Re: Re: Counting using transliteration by basm100
in thread Counting using transliteration by basm100

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.