Skip to content

Instantly share code, notes, and snippets.

@timo
Created May 5, 2020 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timo/4fecd3851edca8fb286d9db3cf7c2ef1 to your computer and use it in GitHub Desktop.
Save timo/4fecd3851edca8fb286d9db3cf7c2ef1 to your computer and use it in GitHub Desktop.
diff --cc Come on, sister/script/benchmark2.p6
index 8d9e789,79038c3..0000000
--- a/Come on, sister/script/benchmark2.p6
+++ b/Come on, sister/script/benchmark2.p6
@@@ -30,10 -30,10 +30,10 @@@ class Sam
$!seq = $!seq.substr($0)
if $!CIGAR~~s/^(\d+)S//; # clip the sequence field
$!seq = $!seq.substr(0, * - $0)
-- if $!CIGAR~~s/(\d+)S$//; # clip the sequence field
++ if $!CIGAR.ends-with("S") && $!CIGAR~~s/(\d+)S$//; # clip the sequence field
$!end = $!start - 1; # calculate the end of the alignment
- $!end += $!CIGAR.match(/ (\d+) <!before I> /, :g).sum; # <!beforer XXX>: https://docs.perl6.org/language/regexes#Capture_markers:_%3C(_)%3E
- $!end += $_ for $!CIGAR.comb(/ \d+ )> <-[I]> /); # <!beforer XXX>: https://docs.perl6.org/language/regexes#Capture_markers:_%3C(_)%3E
++ $!end += $!CIGAR.comb(/ \d+ )> <-[I]> /).sum; # <!beforer XXX>: https://docs.perl6.org/language/regexes#Capture_markers:_%3C(_)%3E
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment