Closed frahimov closed 3 months ago
Thank you for your message!
You are right, markers missing r2 values are excluded from the plot. I agree that it would be nice and make more sense to keep them in the plot in a gray color. Unfortunately there is no argument for that at the moment, but I will fix this in the next topr release.
Hi @totajuliusd , just wanted to second that this functionality is much needed!
This functionality has been added to the latest topr release (v 2.0.2)
Hi Thorhildur, Thank you for the R package. This is really nice! When I run the locuszoom function I get this message "removed 74 rows containing missing values (
geom_point()
)". Does this mean SNPs with no r2 data are excluded from the plot? I intentionally kept "NA" in the R2 column so I can plot SNPs with no LD information. I would like to keep them in the plot, but in a gray color. Is there an argument for that?I guess, I am talking about something like this
set_lz_colors <- function(dat){ for(i in seq_along(dat)){ df <- dat[[i]] df$color <- "darkblue" df$color <- ifelse(df$R2 == 1, "purple", df$color) df$color <- ifelse(df$R2 != 1 & df$R2 > 0.8, "red", df$color) df$color <- ifelse(df$R2 < 0.8 & df$R2 > 0.6, "orange", df$color) df$color <- ifelse(df$R2 < 0.6 & df$R2 > 0.4, "green", df$color) df$color <- ifelse(df$R2 < 0.4 & df$R2 > 0.2, "turquoise", df$color) df$color <- ifelse(is.na(df$R2), "darkgrey", df$color) dat[[i]] <- df } return(dat) }
The rationale is that you may accidentally exclude an independent, genome-wide significant variant with no LD information with the lead SNP.