http://www.perlmonks.org?node_id=1007822


in reply to What is wrong in this code???

I think I must somewhere set the counters to 0, but the positions I tried just made the script worse...

If you want to count the number of symbols per line or record, you must reset the counters before counting the symbols in each line/record.

Replies are listed 'Best First'.
Re^2: What is wrong in this code???
by Anonymous Monk on Dec 07, 2012 at 20:59 UTC
    Yes but where, can you tell me? I tried printing outside the loop, but printed statistics only for the last position (all sequences have the same number of letters, and I want to keep statistics for each position, but for all the sequences. So for example, since I have 200 sequences in my file, for position 56, I could have 150 A, 40 C, 25 G and 35 -.