in reply to Can't think of an algorithm to go..

Hmmm, sorry to bother you again, but, in the code you provided, could there be a modification when it comes to figuring out the consensus line? From what i can see, if, for example you have 5 I and 4 O, it is I. Can we say that, in order to decide for a specific position, there has to be an aggreement in 70% of the LBL sequences?
  • Comment on Re: Can't think of an algorithm to go..

Replies are listed 'Best First'.
Re^2: Can't think of an algorithm to go..
by ikegami (Patriarch) on Jun 11, 2009 at 14:42 UTC
    sub consensus { my %counts; $counts{$_}++ for @_; my ($consensus) = sort { $counts{$b} <=> $counts{$a} } keys(%counts); return ( $counts{$consensus} / @_ >= 0.7 ? $consensus : undef ); }

    Up to you to decide what to do when consensus returns undef because a consensus wasn't achieved.