BioAlignments.jl
BioAlignments.jl copied to clipboard
Get reference and query from `PairwiseAlignment`
It would be nice if there were exported methods to get the reference and query form an alignment. Something like ref(aln)
and seq(aln)
.
The documentation mentions these
LongDNASeq([x for (x, _) in aln]) # create aligned `s1` with gaps
LongDNASeq([y for (_, y) in aln]) # create aligned `s2` with gaps
which can simply be written into small functions:
seq(aln::PairwiseAlignment) = LongDNASeq([y for (y, _) in aln])
ref(aln::PairwiseAlignment) = LongDNASeq([x for (_, x) in aln])
depending on which you determine to be reference and query you'd have to change the functionnames.
The above mentioned gives you the gapped strings, to obtain the original sequences again you can do
aln.a.seq
and aln.b
.
I agree that some convenience functions would be nice though.