Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get reference and query from PairwiseAlignment #55

Open
jakobnissen opened this issue Jul 23, 2021 · 2 comments
Open

Get reference and query from PairwiseAlignment #55

jakobnissen opened this issue Jul 23, 2021 · 2 comments

Comments

@jakobnissen
Copy link
Member

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).

@timoleistner
Copy link

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.

@timoleistner
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants