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

microbiome::transform confusing transformation #221

Open
alimayy opened this issue Nov 6, 2023 · 0 comments
Open

microbiome::transform confusing transformation #221

alimayy opened this issue Nov 6, 2023 · 0 comments

Comments

@alimayy
Copy link

alimayy commented Nov 6, 2023

Hi, thanks for developing the microbiome package. Question about microbiome::transform():

When I provide the function with a phyloseq object where rows are OTUs and columns are samples, and run it with

OTU = otu_table(tax_count_38_mat, taxa_are_rows = TRUE)

# remove taxa with less than 1 count in more than 10% of the samples
min_count <- 1
perc_samples <- 0.1

tax_count_38_highab <- OTU[ rowSums(OTU > min_count) > ncol(OTU)*perc_samples, ]

compositional_abundance_table <- microbiome::transform((tax_count_38_highab), 
                                                       transform = 'compositional', 
                                                       target = 'OTU')

I see that the data is normalised column-wise, i.e. the sum of each column is 1. This is confusing, because the "target" parameter is specified as

target: Apply the transform for 'sample' or 'OTU'. Does not affect the log transform.
https://rdrr.io/github/microbiome/microbiome/man/transform.html

if the transform was applied to OTUs as specified in my command above, I don't think the column sums would necessarily sum up to 1 for each sample (that would require target = 'sample')?

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

1 participant