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

Label genes #407

Closed
alimanfoo opened this issue Jun 1, 2023 · 5 comments · Fixed by #653
Closed

Label genes #407

alimanfoo opened this issue Jun 1, 2023 · 5 comments · Fixed by #653
Assignees
Labels
enhancement New feature or request

Comments

@alimanfoo
Copy link
Member

It would be useful to be able to label some genes of interest in a genes plot.

The bokeh LabelSet feature looks potentially useful here, see also bokeh labels docs.

@alimanfoo
Copy link
Member Author

Perhaps a label_genes parameter which takes a mapping of gene IDs to gene labels, allowing customisation of the labels to appear.

Perhaps also a label_loci parameter which takes an instance of LabelSet allowing arbitrary labelling of the genes track.

@alimanfoo alimanfoo added the enhancement New feature or request label Dec 14, 2023
@leehart leehart self-assigned this Oct 21, 2024
@leehart
Copy link
Collaborator

leehart commented Oct 24, 2024

While trying this out, I encountered an amusing problem, which arises if I put a label on every gene, e.g. using its gene ID... When zoomed out the gene tracks become long smears of incoherent overlapping text, where the labels go beyond the limits of their gene and overlap each other. So I need to devise some way to avoid this... 🤔

Screenshot 2024-10-24 at 18 27 07 Screenshot 2024-10-24 at 18 26 46

@alimanfoo
Copy link
Member Author

Maybe something like this...?

image

From here.

@leehart
Copy link
Collaborator

leehart commented Nov 14, 2024

Assuming we don't get too many genes to label, we can do something like this:
Screenshot 2024-11-14 at 12 58 11
Screenshot 2024-11-14 at 12 58 52

@leehart
Copy link
Collaborator

leehart commented Nov 14, 2024

It's not yet clear to me how we want to accept a custom LabelSet, but we could do something like this:

Screenshot 2024-11-14 at 16 25 24

Note: there is a general problem accommodating labels within the default plot height and current layout.

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

Successfully merging a pull request may close this issue.

2 participants