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

Added box.padding argument to allow connector length to be increased easily; matchLabelColorsToSig argument to color text labels by significance #126

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

benjibromberg
Copy link

@benjibromberg benjibromberg commented Jan 9, 2024

This pull adds the box.padding argument from ggrepel::geom_text_repel() (link to the documentation here) to the EnhancedVolcano function to allow convenient manipulation of the connector length by changing the padding of the text labels.

Notes

  • I tried adding in nudge_x and nudge_y according to the suggestion from @geneyology in I cannot increase the length of the connectors #125, but I found that this sometimes made text labels disappear and it seemed much simpler to just implement box.padding to EnhancedVolcano.

  • If you want to add more user customizability to the ggrepel::geom_text_repel() functionality of EnhancedVolcano, you could pass the dot-dot-dot argument (as suggested in the linked Stack Overflow response in I cannot increase the length of the connectors #125) to all instances of the ggrepel::geom_text_repel() function in the source code. Could make things messy though when writing the function definition to explicitly that the dot-dot-dot argument is only for the ggrepel::geom_text_repel() functionality so I didn't add that here.

  • Also, I did not add any example usage of the box.padding argument to the package, as I wasn't exactly sure how I should format that.

@benjibromberg
Copy link
Author

I added a new argument to EnhancedVolcano() called matchLabelColorsToSig that is a logical (set to FALSE by default) that indicates whether or not a user wants to match the color of the text of the labels to the corresponding significance level of the point being labeled.

@benjibromberg benjibromberg changed the title Adding box.padding argument to EnhancedVolcano to allow connector length to be increased easily Added box.padding argument to allow connector length to be increased easily and matchLabelColorsToSig argument to color text labels by significance Jan 17, 2024
@benjibromberg benjibromberg changed the title Added box.padding argument to allow connector length to be increased easily and matchLabelColorsToSig argument to color text labels by significance Added box.padding argument to allow connector length to be increased easily;matchLabelColorsToSig argument to color text labels by significance Jan 18, 2024
@benjibromberg benjibromberg changed the title Added box.padding argument to allow connector length to be increased easily;matchLabelColorsToSig argument to color text labels by significance Added box.padding argument to allow connector length to be increased easily; matchLabelColorsToSig argument to color text labels by significance Jan 18, 2024
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

Successfully merging this pull request may close these issues.

1 participant