Bioinformatics/Global alignment: Difference between revisions
m
→{{header|Raku}}: more idiomatic
(added Raku programming solution) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: more idiomatic) |
||
Line 523:
loop ( my $offset = 0, my \S1 = $ = '' ; ; $offset++ ) {
S1 = s1.substr: $offset ;
with S1.index(s2.substr(0,1)) -> $p { $offset += $p } else { return
S1 = s1.substr: $offset ;
return s1.chars - $offset if s2.starts-with: S1
Line 530:
sub deduplicate {
my @sorted = @_.unique.sort:
gather while ( my $target = shift @sorted ) {
take $target unless @sorted.grep: { .contains: $target }
Line 542:
my \sup = $ = @perm[0];
for @perm.rotor(2 => -1) -> @duo {
my \overlapPos = stringCentipede |@duo[0
sup ~= @duo[1].substr: overlapPos;
}
|