BioJulia / GenomicAnnotations.jl

MIT License
16 stars 4 forks source link

gffstring can still merge reverse strand multi-position loci #16

Closed ian-small closed 3 days ago

ian-small commented 4 days ago

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.

kdyrhage commented 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