Skip to content

Plotting genome position in Kb and Mb #2345

Closed as not planned
Closed as not planned

Description

@hyanwong

At the moment the genome positions in both text and SVG plots are listed in standard coordinates (interpreted as "base pairs"), but often the sequences run to thousands or millions of bases.

I wonder if, by default, if the largest plotted position is > 10,000, we should plot the numbers divided by 1000 (and adjust the X axis label accordingly, perhaps saying "Kb"), and similarly if Mb if the largest plotted position is > 10,000,000. The extra decimal point will take up more space, but I think it would make the positions more readable.

Alternatively, or as well, we could allow explicit labels to be passed, as we do for the Y axis (but not currently for the X)

Activity

  1. added
    Visualisation
    on Jun 16, 2022
  2. molpopgen commented on Jun 16, 2022

    @molpopgen
    Member

    It is not always the case, though, that the unit of a tree sequence is a "base pair". While that is probably true for inferred tree sequences, it often isn't for simulated ones.

  3. hyanwong commented on Jun 16, 2022

    @hyanwong
    MemberAuthor

    Yes, I had forgotten to say that. There is a potential problem with labelling, although this could be solved like matplotlib does by saying x 1e3 units near the axis (a bit ugly though).

    In principle, simulated ones that aren't in base pairs are likely to be from zero to one, I suspect?

  4. molpopgen commented on Jun 16, 2022

    @molpopgen
    Member

    In principle, simulated ones that aren't in base pairs are likely to be from zero to one, I suspect?

    Not necessarily. I've done things that are 10 "units" long where each unit is one of the [0, 1) things you are thinking of, etc..

  5. benjeffery commented on Jun 20, 2022

    @benjeffery
    Member

    Just k or M would avoid having to be specific but still easily understandable I think.

  6. added
    Python API
    on Jun 22, 2022
  7. added
    future
    on Jun 9, 2025
  8. benjeffery commented on Jun 9, 2025

    @benjeffery
    Member

    Closing for inactivity and labelling "future".

  9. hyanwong commented on Jun 9, 2025

    @hyanwong
    MemberAuthor

    I started on this, but then realised that often we want from e.g. position 1,000,123 - 1,000,345, and putting two ticks identically labelled 1M would be a bit pointless, and 1.000123M ... 1.000345M takes up more space, if anything. So I'm not sure there's a simple solution

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 APIVisualisationfuture

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions