Thank you.
It tried broom from this link:
https://cran.r-project.org/web/packages/broom/vignettes/broom.html
But which method I should use?
ttest?glm?lm? I used lm and I got all my p-values 1,1,1,1... which cannot be correct.which one from the following code will be my data in broom code?"
dat" or "ex"
dat <- read.csv("Gene_variable_file.csv", check.name = FALSE, stringsAsFactors = FALSE, header = T)
df <- as.data.frame(dat)
ex <- melt(df, id.vars="continousVariable")
colnames(ex) <- c("continousVariable", "gene", "exprs")
#######################
####
ggscatter(ex, x = "continousVariable", y = "exprs",
add = "reg.line",
add.params = list(color = "blue", fill = "lightgray"),
color = "black", palette = "jco", fill = "lightgray",
#shape = "cyl",
fullrange = TRUE,
rug = TRUE, facet.by = "gene", cor.coef = T,
title = "Sarco-Specific DEGs-SMA Correlation-FEMALE",
conf.int = TRUE,
cor.coeff.args = list(),
cor.method = "spearman",
cor.coef.coord = c(NULL, NULL),
cor.coef.size = 4,
)+
geom_vline(xintercept = 102, colour="red", linetype = "longdash")
I used ex as my data in broom
