Padded position in Consensus sequence

Discussion in 'Perl Misc' started by Jayaprakash Rudraraju, Aug 14, 2003.

  1. Hi,

    I have written a small subroutine to as part of the program to tag primers
    in Consed. The following subroutine gives padded position on the consensus
    sequence, given its position on reference sequence.

    #!perl -w
    my $consensus = "AGG*TGAC**TA***AGTCCT*T";
    print map { "$_\t". padded_position($_) ."\n"} (1..16);

    sub padded_position {
    my ($unpad, $pads) = (@_, 0);
    $pads++ until $unpad == substr($consensus, 0, $unpad+$pads) =~ tr/ACGT//;
    $unpad+$pads;
    }

    can you suggest me some more efficient or elegant solutions. Eventhough I
    have condensed it as much as I can, I am looking for a simpler logic.

    Prakash.

    --
    My favorite animal is steak.
    -- Fran Lebowitz (1950 - )
    Jayaprakash Rudraraju, Aug 14, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Dalberg
    Replies:
    0
    Views:
    468
    John Dalberg
    Jan 21, 2005
  2. Mike Meng
    Replies:
    37
    Views:
    750
    Dirk Thierbach
    Nov 29, 2004
  3. Mike Meng
    Replies:
    0
    Views:
    269
    Mike Meng
    Nov 23, 2004
  4. Brian Beck
    Replies:
    0
    Views:
    580
    Brian Beck
    Mar 19, 2006
  5. Roedy Green

    creeping consensus

    Roedy Green, Feb 15, 2013, in forum: Java
    Replies:
    6
    Views:
    315
    Andreas Leitgeb
    Feb 26, 2013
Loading...

Share This Page