Padded position in Consensus sequence

  • Thread starter Jayaprakash Rudraraju
  • Start date
J

Jayaprakash Rudraraju

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top