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

Error when using hellinger transformation with ordinate and PCoA #1749

Open
timz0605 opened this issue May 7, 2024 · 1 comment
Open

Error when using hellinger transformation with ordinate and PCoA #1749

timz0605 opened this issue May 7, 2024 · 1 comment

Comments

@timz0605
Copy link

timz0605 commented May 7, 2024

Hello, I am working with COI metabarcoding data of 24 samples, and there are many zeroes in the data frame, as some zotus are not detected in certain samples. I am using the transform_sample_counts to convert my otu_table into Hellinger-transformed data. After that, I want to do a PCoA using bray-curtis dissimilarity. However, I have been encountering this issue with the above approach.

Below is the code I am using:

merged_ps_hellinger <- transform_sample_counts(merged_ps, function(x) sqrt(x / sum(x)))
merged_ps.hellinger <- ordinate(merged_ps_hellinger, "PCoA", "bray")
p <- plot_ordination(merged_ps_hellinger, merged_ps.helligner, color = "locality",
                     shape = "monthCollected")

However, I have been encountering this error message:

Warning messages:
1: In scores(ordination, choices = axes, display = "species", physeq = physeq) :
  restarting interrupted promise evaluation
2: In plot_ordination(merged_ps_hellinger, merged_ps.helligner, color = "locality",  :
  Could not obtain coordinates from the provided `ordination`. 
Please check your ordination method, and whether it is supported by `scores` or listed by phyloseq-package.

Looking at the merged_ps.hellinger after the ordinate step, compared to simply performing PCoA with bray of the original phyloseq object, I notice that the values data frame went from 24 rows and 6 columns to 23 rows and 5 columns, missing the column for Rel_corr_eig. Might this be the reason causing this issue? I wonder if anyone have encountered similar issues before, and know the solution?

@Ch1m4nsk1
Copy link

I am encountering the same error in my analysis. Did you manage to find a workaround for this problem?

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