Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: What is wrong in this code???

by brap (Pilgrim)
on Dec 07, 2012 at 21:08 UTC ( #1007827=note: print w/replies, xml ) Need Help??


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

Hey anonymous,

I could be way off base here, but it almost sounds like you want an array of counters, where each element of the array represents the position of the line you're counting. Something along the order of (untested):

if ($split_seq_to_examine[$j] eq 'A') {$count_A[$j]++;} elsif ($split_seq_to_examine[$j] eq 'T') {$count_T[$j]++;} elsif ($split_seq_to_examine[$j] eq 'C') {$count_C[$j]++;} elsif ($split_seq_to_examine[$j] eq 'G') {$count_G[$j]++;} elsif ($split_seq_to_examine[$j] eq '-') {$count_non[$j]++;}

To find out what you have in, say, position 56, look at $count_A[56], $count_T[56], $count_G[56], and $count_C[56].

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007827]
help
Chatterbox?
[Your Mother]: :P
[ambrus]: YourMother: my brother told me their cat wants to climb into the dishwasher if they leave the door open. Not when the dishwasher is started, but after it's done washing, because it's still warm and cats like warm.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2017-12-18 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (491 votes). Check out past polls.

    Notices?