I'm using the cytofWorkflow package in R to analyse cytof data: https://www.bioconductor.org/packages/release/workflows/vignettes/cytofWorkflow/inst/doc/cytofWorkflow.html https://www.bioconductor.org/packages/devel/bioc/manuals/CATALYST/man/CATALYST.pdf
At the stage of differential analysis where you plot boxplots for the differential expression of each marker using plotPbExprs and then separately calculate the p values using diffcyt, I can't figure out how to add the p values onto the plot. Below is the code and output from the example data on the bioconductor vignette workflow html.
p <- plotMedExprs(sce, features = "state", shape_by = "patient_id")
p$facet$params$ncol <- 3
p
# fit linear model
ds_res3 <- diffcyt(sce,
formula = ds_formula1, contrast = contrast,
analysis_type = "DS", method_DS = "diffcyt-DS-LMM",
clustering_to_use = "merging_all", verbose = FALSE)
# fit linear mixed model with patient ID as random effect
ds_res4 <- diffcyt(sce,
formula = ds_formula2, contrast = contrast,
analysis_type = "DS", method_DS = "diffcyt-DS-LMM",
clustering_to_use = "merging_all", verbose = FALSE)
table(rowData(ds_res3$res)$p_adj < FDR_cutoff)
If you're able to advise me how to add these adj_p values from the output onto the faceted boxplots I would be very grateful! I had a look at stat_pvalue_manual but it all seems to be a very different format that the way this data is stored. I was wondering if there is an integral way to do it using the sce and other outputs from the cytofWorkflow workflow.
Many thanks, Vicky
I tried adding the p values manually using stat_pvalue_manual but I couldn't figure it out this way. I am expecting there is a better way using the data format already existing from the CATALYST/cytofWorkflow/diffcyt outputs to create the faceted boxplots with the adjusted p values on the graphs.

