Problem with printing continuous minimum and maximum polypurine stretches using sliding window
0
0
Entering edit mode
7.0 years ago

Hi All, I need to extract polypurine stretches with max. 1 pyrimidine residues. my perl code:

for(my $i=0; $i <=$len; $i++) {

for(my $j=0; $j <=length($data[$i]) - $window; $j += $step){
my $nucltde = substr($data[$i], $j, $window);
   while($nucltde =~ /G/g)
{
$countG++
}
#print $nucltde,"\n";
my $Gper=($countG/$window)*100;
#print "$countG\t$Gper\n";
if($Gper >= 50){
    while($nucltde =~ /[AG]/g)
    {
    $countAG++
    }
    while($nucltde =~ /[CT]/g)
    {
    $countCT++
    }
    my $AGper=($countAG/$window)*100;
    if(($countAG >=15) && ($AGper >= 46) && ($countCT <=1)){

After counting residues and I applied if condition. I could able to print 30nts stretches only. I am not able to print min. of 15nt stretches and maximum of continuous stretches of any length. For that I tried with join and push command. It prints all or joining the same seq. Could you please guide me to solve this problem.

sequence perl • 1.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 2308 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6