Skip to content

Commit d282fbb

Browse files
author
L. Grondin
committed
[rosalind] TRAN (simpler version)
1 parent fc32a50 commit d282fbb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

rosalind/tran-grondilu.pl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
my ($transitions, $transversions);
99
for @dna[0].comb Z @dna[1].comb -> $a, $b {
1010
next unless $a ne $b;
11-
if ($a eq 'A'|'G' and $b eq 'G'|'A') or ($a eq 'C'|'T' and $b eq 'C'|'T') {
12-
$transitions++
13-
} else {
14-
$transversions++
15-
}
11+
if "$a$b" eq any <AG GA CT TC> { $transitions++ }
12+
else { $transversions++ }
1613
}
1714
say $transitions/$transversions;
1815
}

0 commit comments

Comments
 (0)