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

Adjust otu-table sample names to match sample data when subsetting duplicate samples #45

Open
mikemc opened this issue Jul 23, 2020 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@mikemc
Copy link
Owner

mikemc commented Jul 23, 2020

Suppose one wants to create bootstrap replicates of the phyloseq dataset. Doing

smpls <- sample(nsamples(ps), replace = TRUE)
otu1 <- otu_table(ps)[smpls,]
data1 <- sample_data(ps0)[smpls,]
sample_names(otu1) %>% anyDuplicated
sample_names(data1) %>% anyDuplicated
sample_names(data1)

Shows that otu1 has duplicated sample names, for the samples that were drawn multiple times, but that the sample names in data1 are made unique (I think by make.unique()). I suspect this behavior comes down to differences in the matrix and data.frame subsetting methods. However, for phyloseq components, it seems desirable for the sample names to match.

@mikemc mikemc added enhancement New feature or request question Further information is requested labels Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant