Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggvenn_pq only gives number of samples #31

Closed
gabyr2 opened this issue Oct 19, 2023 · 8 comments
Closed

ggvenn_pq only gives number of samples #31

gabyr2 opened this issue Oct 19, 2023 · 8 comments

Comments

@gabyr2
Copy link

gabyr2 commented Oct 19, 2023

Hi Adrien,

First, thank you for the great package! I enjoy testing out these different ways to visualize my dataset.

I'm running into an issue with ggvenn_pq. When I run the function, with the physeq and fact arguments, I get a plot but instead of the number of ASVs, the only numbers I'm seeing are the number of samples in each 'fact' group. E.g., I have a fact variable that has three groups with 18 samples each. So, the 3-dimension venn diagram shows "0 (0%)" in each of the overlapping regions, and 18 in each of the 'solo' regions of the circles. I feel like there may be something off with how I'm setting this up, but I'm not sure what it is. Any help would be appreciated!

Thanks,
Gaby

@adrientaudiere
Copy link
Owner

Hi @gabyr2,

Thanks for the feedback. It's definitely a bug. Could you send me your script, your data (or at least a minimal reproducible example) and the resulting plot?

Best,
Adrien

@gabyr2
Copy link
Author

gabyr2 commented Oct 19, 2023

Hi @adrientaudiere ,

I've never made a reproducible example before, but in trying to figure out how to do that - I think I found my problem. My data files and phyloseq object have the taxa arranged as rows. So, when I changed the otu_table to have taxa as columns, ggvenn_pq() is now providing real values in the venn diagram! My apologies - I feel like I should have figured that out already!

Thanks,
Gaby

@adrientaudiere
Copy link
Owner

Thanks for the feedback @gabyr2. I added code to convert the phyloseq object with taxa as column in the new version of MiscMetabar.
Best,
Adrien

@gabyr2
Copy link
Author

gabyr2 commented Oct 20, 2023

Hi @adrientaudiere, I just re-installed the package and tried using ggvenn_pq() without transforming my physeq object's OTU table, and I am getting a different error. I'm not sure if this is a result of forcing the taxa as columns, or if it's something else on my end? The function still works fine, though, if I manually change the physeq object so that taxa are as columns.
This is the error message I'm getting:

Error in `[[<-.data.frame`(x3, i, ..., value = value) : 
  replacement has 0 rows, data has 54

Thanks,
Gaby

@adrientaudiere
Copy link
Owner

Thank you for the bug report. I then reopen the issue.

@adrientaudiere
Copy link
Owner

@gabyr2 : Hum, this is weird because my function works for both taxa in column and taxa in row. Can you send me your data (at least a part)? And can you try the following code?

library(MiscMetabar)
ggvenn_pq(data_fungi, "Time")
ggvenn_pq(clean_pq(data_fungi, force_taxa_as_rows = T), "Time")

@gabyr2
Copy link
Author

gabyr2 commented Oct 25, 2023

@adrientaudiere : As I was subsetting my dataset to send to you, I tested out the function with the pruned data and found my error - I had a typo in the fact argument! I'm so sorry, that's on me! Now, I can run ggvenn_pq() with no issues - when I run it with my dataset, I now just get the message of: Taxa are now in columns. So, that looks good. I also tried the code you pasted and that works fine for me too.

Thank you so much for this package and for working through this with me, especially when it has mostly been silly errors on my part!

@adrientaudiere
Copy link
Owner

@gabyr2 That sounds good news. Have a good time analyzing now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants