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 following tutorial with example data #10

Open
Abbie-Williams opened this issue Sep 2, 2021 · 1 comment
Open

Error when following tutorial with example data #10

Abbie-Williams opened this issue Sep 2, 2021 · 1 comment

Comments

@Abbie-Williams
Copy link

Hi,

Congratulations on the awesome package - I'm really enjoying playing around with it and definitely planning to use it for some of my data. I was attempting to recreate the horizon plots which plotted a single taxon across multiple subjects. I couldn't recreate this in my own data as I kept getting the error message (see below):

Error in prepanel(otudata = otu, metadata = metadata, singleVarOTU = "taxon 1", :
metadata must have the same number of samples for each subject to perform single OTU analysis

In my metadata, I have the same number of samples for each subject I listed, and I double checked this. I switched over to the example data and followed the tutorial, but I still got this same error message even with the example data. Everything else prior to this code has worked fine, and I can generate stacked horizon plots for different taxa within a single subject. This seems a really great feature that I'm planning to use, but I'm unsure how to resolve this error.

@isaacfink21
Copy link
Collaborator

isaacfink21 commented Sep 4, 2021

Hi @Abbie-Williams,

Thank you for this! I'm able to generate the plot using the code from the tutorial without any issues - could you try entering these commands into your console and let me know what it outputs?

library(biomehorizon)
library(dplyr)

## Subset the data set to the subjects who were sampled on all 17 days, and arrange by date
metadata_17 <- metadatasample_diet %>%
  filter(subject %in% c("MCTs08","MCTs18","MCTs23","MCTs26","MCTs33","MCTs36")) %>%
  arrange(subject, collection_date)

otu_17 <- otusample_diet %>%
  select(taxon_id, as.character((metadatasample_diet %>% filter(subject %in% c("MCTs08","MCTs18","MCTs23","MCTs26","MCTs33","MCTs36")))$sample))

## Single variable analysis with "Taxon 1"
paramList <- prepanel(otudata = otu_17, metadata = metadata_17, singleVarOTU = "taxon 1", subj = 		
	c("MCTs08","MCTs18","MCTs23","MCTs26","MCTs36","MCTs33"))

horizonplot(paramList)

@HCB-M2RG HCB-M2RG mentioned this issue Nov 24, 2021
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