Skip to content

Feedback about reference sequences: reference_start and restrict alignments options #2092

Closed

Description

@hyanwong

As part of the what-is-an-ARG paper, I thought it would be interesting to see if we could encode the Kreitman (1983) D. melanogaster ADH data (https://www.nature.com/articles/304412a0) as a tree sequence, including the reference sequence from FlyBase. This has brought up a few issues with reference sequences, which might be useful in the light of #1985 and use-case requirements. In particular, I'm only focussing on bases 14615494..14618223 of the genome, for which I am using the consensus sequence in Kreitman as the reference.

I think using part of the genome like this is likely to be something people are likely to want to do. Moreover, it is extremely helpful if the site positions are in the reference genome coordinate space. So in an attempt to solicit feedback, here are 2 possible suggestions to help with this

  1. It might be useful for the reference sequence to have a start_position, by default 0, but it could be e.g in this instance 14615494. When outputting alignments, all bases before the start position (and after the last character in the reference) could simply be filled with N
  2. It would be useful to be able to output the alignments restricted to a particular region, presumably with an extra parameter or two to the alignments method, specifying the start and end positions.

I think 2. is not at all controversial, but maybe 1 needs some discussion? I opened this as an issue rather than a discussion so that it could be closed when this is tackled, but I'd be happy to move it to the Githhub discussions area if that's a better place.

Activity

  1. jeromekelleher commented on Jan 12, 2022

    @jeromekelleher
    Member

    Both good ideas in my book. (1) would be something to consider as part of a bigger update I think, in case it conflicts with the url approach, but the general point on not storing a bunch of Ns at the start of the sequence for no reason is a good one.

    2 is uncontroversial, but would be a bit of work to do in practise because we lack the underlying machinery to generate variants on an interval (but this is being worked on)

  2. petrelharp commented on Jan 13, 2022

    @petrelharp
    Contributor

    Great test case, and great ideas.

  3. benjeffery commented on Jan 14, 2022

    @benjeffery
    Member
    1. works well with URL as I can imagine that you might have a tree sequence that is a subset of a section of a common reference, this would let you refer to it by URL. I think it is something we tackle when we come to implement URL handling though.
  4. hyanwong commented on Jan 19, 2022

    @hyanwong
    MemberAuthor

    2 is uncontroversial, but would be a bit of work to do in practise because we lack the underlying machinery to generate variants on an interval (but this is being worked on)

    Thanks Jerome. I thought we could simply seek to the tree at the start of the region, and iterate over the trees from there, but now I recall that you can't simply get the variants from the trees, so yes, probably worth waiting on #605

  5. added
    enhancement
    Python API
    on Apr 5, 2022
  6. added this to the Python upcoming milestone on Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Python APIenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions