- or download this
Str: AGACGAGTA
Mask: 001111100
---------------
Res: AGxxxxxTA
- or download this
use strict;
use warnings;
...
my $mask=''; vec ($mask,$_,1)=1 for (2..6);
print "Str: $seq\n";
print "Mask: ", unpack ("b*",$mask),"\n";
- or download this
Str: AGACGAGTA
Mask: 00111110
- or download this
#Solution 1:
my @mask = split "",unpack ("b*",$mask);
...
print "Res: ";
print map {! shift @mask ? $_ : "x"} @seq;
print "\n";
- or download this
# Solution 2:
my $s_mask = unpack ("b*",$mask);
...
$pos++;
}
print "\n";
- or download this
Res: AGxxxxxTA