Hello, I am a beginner in R studio. I try to do a MAplot after a differential analysis. I try this code but I obtain a message of error. I insert a picture of the dataframe. Could you help me ? I find this code : [https://rpkgs.datanovia.com/ggpubr/reference/ggmaplot.html Thank you very much
Code should be placed in three backticks as shown below
dtf <- read.table("Essai.txt") diffexp <- dtf library(geneplotter) library(ggmatplot) ggmaplot(diffexp, main = expression("Group 1" %->% "Group 2"), fdr = 0.05, fc = 2, size = 0.4, palette = c("#B31B21", "#1465AC", "darkgray"), legend = "top", top = 20, font.label = c("bold", 11), font.legend = "bold", font.main = "bold", ggtheme = ggplot2::theme_minimal()) Error in ggmaplot(nana, main = expression("Group 1" %->% "Group 2"), fdr = 0.05, : could not find function "ggmaplot"
This likely has to do with the 1st row in your input; these are the names of the columns, thus characters, and not numbers. Fix this by adding the argument
header = TRUEto your call when reading in the data. Thus:
Also note that you have comma's as decimal marks, and whereas dots may be expected.... Check the argument
dec = ".").
Thank you for your help. I made the modifications. But I obtain a new error message that I don't understand. Could you help me ?
Without having a reproducible example, or access to your data, it is almost impossible to help you. Also note that
ggpubris not a Bioconductor package...
After having had a quick look at your code I noticed some strange things in your input: the values are really low for a
baseMean..., or do you rather mean
baseMeanLog2? Also, a
padjof 14.6 (at the 5th row) is impossible.... And what about the gene identifiers?
So please double-check your input file (ideally you would use the
DESeq2object directly instead of a saved txt file), and when you keep having errors I would recommend you run the
ggmaplotfunction on a data set that everyone can reproduce. If errors still occur, then you know something fundamental is wrong, if that goes fine, it confirms it is specific to your input.