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

WIP - Cladogram plot #61

Closed
wants to merge 16 commits into from
Closed

WIP - Cladogram plot #61

wants to merge 16 commits into from

Conversation

sdgamboa
Copy link
Contributor

Opening a PR to work on the function for plotting the cladogram.

If internal nodes are of interest, some extra steps need to be taken. This is done
with the lefserAllRank function.

Related issues

suppressPackageStartupMessages(library(lefser))
data("zeller14")
z14 <- zeller14[, zeller14$study_condition != "adenoma"]
tn <- get_terminal_nodes(rownames(z14))
z14tn <- z14[tn, ]
z14tn_ra <- relativeAb(z14tn)

## Run lefser at all taxonomic levels and merge into a
## single result
resAll <- lefserAllRanks(relab = z14tn_ra, groupCol = "study_condition")
#> The outcome variable is specified as 'study_condition' and the reference category is 'control'.
#>  See `?factor` or `?relevel` to change the reference category.
#> The outcome variable is specified as 'study_condition' and the reference category is 'control'.
#>  See `?factor` or `?relevel` to change the reference category.
#> The outcome variable is specified as 'study_condition' and the reference category is 'control'.
#>  See `?factor` or `?relevel` to change the reference category.
#> The outcome variable is specified as 'study_condition' and the reference category is 'control'.
#>  See `?factor` or `?relevel` to change the reference category.
#> The outcome variable is specified as 'study_condition' and the reference category is 'control'.
#>  See `?factor` or `?relevel` to change the reference category.
#> Warning in lefser(relab = x, ...): Convert counts to relative abundances with
#> 'relativeAb()'
#> The outcome variable is specified as 'study_condition' and the reference category is 'control'.
#>  See `?factor` or `?relevel` to change the reference category.
#> The outcome variable is specified as 'study_condition' and the reference category is 'control'.
#>  See `?factor` or `?relevel` to change the reference category.
pp <- suppressWarnings(lefsePlotClad(x = resAll))
pp
#> Warning: Removed 457 rows containing missing values or values outside the scale range
#> (`geom_point_g_gtree()`).
#> Warning: Removed 549 rows containing missing values or values outside the scale range
#> (`geom_point_g_gtree()`).
#> Warning: Removed 1165 rows containing missing values or values outside the scale range
#> (`geom_label_repel()`).

Created on 2024-09-13 with reprex v2.1.1

@sdgamboa sdgamboa mentioned this pull request Sep 14, 2024
2 tasks
@shbrief
Copy link
Contributor

shbrief commented Sep 14, 2024

Do we still need cladogramPlot.R?

@lwaldron
Copy link
Member

I like it!

  1. Is there any way to deal with the overlapping labels for publication? Maybe an option to only label internal nodes instead?
  2. An option to choose other color palettes (including a color-blind option) would be great.

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.

4 participants