Jump to content

Bioinformatics/Global alignment: Difference between revisions

m
→‎{{header|Raku}}: Thanks SqrtNegInf for the Rakuish uplifts ; some obsessive but insignificant changes ; it seems a little bit slower with the default topic array variable ?
m (→‎{{header|Raku}}: more idiomatic)
m (→‎{{header|Raku}}: Thanks SqrtNegInf for the Rakuish uplifts ; some obsessive but insignificant changes ; it seems a little bit slower with the default topic array variable ?)
Line 515:
 
sub printCounts(\seq) {
my %$bases = seq.comb.Bag ;
say "\nNucleotide counts for ", seq, " :";
say %$bases.kv, " and total length = ", %$bases.values.sum total
}
 
Line 524:
S1 = s1.substr: $offset ;
with S1.index(s2.substr(0,1)) -> $p { $offset += $p } else { return False }
S1return =s1.chars - $offset if s2.starts-with: s1.substr: $offset ;
return s1.chars - $offset if s2.starts-with: S1
}
}
Line 537 ⟶ 536:
 
sub shortestCommonSuperstring {
my \ß = $ = [~] my @ss = deduplicate @_ ; # ShortestSuper
my \ß = $ = [~] @ss ; # ShortestSuper
for @ss.permutations -> @perm {
my \sup = $ = @perm[0];
for @perm.rotor(2 => -1) ->{ sup ~= @duo_[1].substr: {stringCentipede |@_ }
my \overlapPos = stringCentipede |@duo[0,1];
sup ~= @duo[1].substr: overlapPos;
}
ß = sup if sup.chars < ß.chars ;
}
351

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.