Closed ian-small closed 3 days ago
Good catch. The following commit should fix the immediate issue, but I will try to find a more elegant solution.
Do note that complement(join(1..10,20..30))
and join(complement(1..10),complement(20..30))
are not equal, though:
s = dna"ATGCGCTAA"
println(sequence(s, Locus("join(complement(1..3),complement(7..9))")))
println(sequence(s, Locus("complement(join(1..3,7..9))"))
returns
CATTTA
TTACAT
Thanks for the very rapid fix, but it's not quite complete. 'if locus(gene) isa Union{Join, Order}' fails for loci constructed as Complement(Join([Locus, Locus])). I can work round this by constructing all such features as Join([Complement(Locus), Complement(Locus)]) (in which case everything works perfectly as far as I can see), but you might not want to rely on features always being constructed that way.