Hi everyone,
Currently trying to generate a Venn diagram to no luck. My experiment contains two varieties of crop - tolerant and susceptible. Each has samples from four time points, being control, 40min, 120min, and recovery.
I am trying to show the number of overlapping DEG entries from the (1) tolerant time points compared to the tolerant control and the (2) tolerant time points compared to the corresponding susceptible time point.
This is my script:
overlap_venn_list <- list("DT vs DS DEG" = unique(c(df_xS_tl40_sl40$X[df_xS_tl40_sl40$diffexpressed != "NO"],
df_xS_tl120_sl120$X[df_xS_tl120_sl120$diffexpressed != "NO"],
df_xS_tlr_slr$X[df_xS_tlr_slr$diffexpressed != "NO"])),
"DT drought-responsive DEG" = unique(c(df_xS_tl40_tlc$X[df_xS_tl40_tlc$diffexpressed != "NO"],
df_xS_tl120_tlc$X[df_xS_tl120_tlc$diffexpressed != "NO"],
df_xS_tlr_tlc$X[df_xS_tlr_tlc$diffexpressed != "NO"])))
# venn diagram
lvs_venn_ovlp <- ggvenn(overlap_venn_list, fill_color = c("#0073C2FF", "#EFC000FF"),
stroke_size = 1, set_name_size = 3, text_size = 2)
# save
ggsave(here("output", "Venn", "deg_overlap_venn.png"), lvs_venn_ovlp, width = 6, height = 4)
The script works fine, but my Venn is showing "0" for every value. When I look back, my overlap_venn_list is showing NULL values for the two groups I have generated.
I am uncertain what to do as I am adapting a script given to me for my own work. From my understanding, the code is taking the unique entries from each of the stated comparisons by removing the genes that have a diffexpressed value of "NO", essentially meaning it is neither up or down regulated.
If anyone can understand why I am getting NULL values I would appreciate any input!
Thanks.
Well as it stands it is hard to help you because we do not know what are your objects. Have a look individually at
and try to identify when it is going wrong
The objects include rownames of genes with various columns describing the LFC and padj and such. I have added a column to each object known as "diffexpressed", which is written as "UP" if lfc > 1, "DOWN if lfc < -1, and "NO" if it does not meet these categories.
Does this shed light on things? I have edited the section you have shown a few times but to no avail. No matter which category of "diffexpressed" as filter out, I am still getting null values.
Have you checked if the code lines I mentionned are not NULL ?
When I use the summary(overlap_venn_list) I get this returned:
summary(overlap_venn_list) Length Class Mode DT vs DS DEG 0 -none- NULL DT drought-responsive DEG 0 -none- NULL
Yes you already mentionned it in your post, I was asking if you checked the 3 code lines I mentionned in my former comment. Do they return NULL ?
Apologies, yes I think they do.
So check your data is in a correct format, check the colnames etc, the problem comes from there.