Closed ricmedveterinario closed 1 year ago
That depends on how to explain the field which contains the 0/NA values. A preprocessing step of filtering out 0/NA values before plotting by ggvenn would help if required.
By the way, could you provide an example to make the issue clearer?
Hello,
I am having the same problem - I have three columns but two are shorter than the other so end up having blank cells at the end of their last values - therefore these are appearing as common values between the two groups. I have tried to delete these cells prior to uploading to R but this hasn't worked.
I am not sure how to make an example for you but it was uploaded as a csv - sorry if that isn't enough info! Thanks, Amy
Hi, @amy-houseman
If you have loaded the csv into R as variable 'a', you can try dput(a)
to get the construction command. If the file is too big, I suggest you simplify it first. We just need a minimal case to show the problem.
Hi,
Thanks for you reply! I managed to fix my problem with
df[df == ''] <- NA
df <- na.omit(df)
Before turning it into a list for ggvenn! Thank you :))
Thank you very much for the useful sharing. I think I can close this issue now.
Hello,
Sorry, me again! I was able to use df[df == ''] <- NA
to add na to the blanks but actually df <- na.omit(df) was removing the entire row from being used in the Venn diagram.
csv file uploaded = TEST_overlapping_GOF_LOF_2_plus_denovo
Code:
a <- TEST_overlapping_GOF_LOF_2_plus_denovo
a[a == ''] <- NA
a <- na.omit(a)
library(ggvenn)
a <- list('LOF_2_or_more_list'= a$LOF_2_or_more_list,
'GOF_2_or_more_list' = a$GOF_2_or_more_list,
'De_novo' = a$De_novo)
ggvenn(a, c("LOF_2_or_more_list", "GOF_2_or_more_list", "De_novo"), fill_color = c("pink", "lightblue3", "mediumseagreen"))
I tired to dput(a) but I think it misses out the end of the file which is where the problems occur - I have made a small version of the file attached TEST_overlapping_GOF_LOF_2_plus_denovo.csv
To produce the venn:
a <- TEST_overlapping_GOF_LOF_2_plus_denovo
library(ggvenn)
a <- list('LOF_2_or_more_list'= a$LOF_2_or_more_list,
'GOF_2_or_more_list' = a$GOF_2_or_more_list,
'De_novo' = a$De_novo)
ggvenn(a, c("LOF_2_or_more_list", "GOF_2_or_more_list", "De_novo"), fill_color = c("pink", "lightblue3", "mediumseagreen"))
As you can see from this example, there should be: LOF_2_or_more_list Vs De_novo = 3 overlaps (A,B,C). LOF_2_or_more_list should have 2 of its own values (D,E). and GOF_2_or_more_list should not overlap with anything but have 1 of its own values (H).
But as you can see: LOF_2_or_more_list Vs De_novo = 3 LOF_2_or_more_list = 2 own values GOF_2_or_more_list = 1 of its own GOF_2_or_more_list Vs De_novo = 1
This GOF_2_or_more_list Vs De_novo = 1 is caused by the GOF_2_or_more_list and De_novo list both having blank cells which are being detected as shared values.
Do you know what can stop these blanks being detected as values?
Thanks! Amy
Yes, you're right. NA should not be counted in such cases. That is indeed a bug. I will fix it soon.
Hi, @amy-houseman
I have fixed this issue in this commit, and published a new release (v0.1.10), as well as on CRAN.
You may upgrade to the new version by either
devtools::install_github("yanlinlin82/ggvenn")
or
install.package("ggvenn")
Hi, I have installed the new version but I'm still not sure its working - could I send you my file via email for you to test? Thanks! Sorry to be a pain! Amy
Hi, I have installed the new version but I'm still not sure its working - could I send you my file via email for you to test? Thanks! Sorry to be a pain! Amy
ok
Hello @yanlinlin82 ,
Thank you for updating the package,
I will test again soon,
Sorry, but I believe I missed the updates for this discussion,
Best Regards,
Is there a way, that values like 0 and NA are not recognized in an intersection in a list? I believe that zero should be recognized as nothing, or null.