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

Plotting actual read counts in Microeco-Class object using original OTU data #429

Open
JayalalKJ opened this issue Oct 29, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@JayalalKJ
Copy link

HI, first of all, thank you for developing microeco—it’s a very intuitive and straightforward library, and I have found the scripts easy to work with.

I have a quick question: I would like to plot the original OTU counts (actual read counts) from a microeco-class object instead of relative abundance. Is there a built-in option to do this within the package? If not, could you suggest a method or workaround to achieve this?

@ChiLiubio
Copy link
Owner

Hi. The cal_abund function can calculate the original abundance to replace relative abundance (rel = FALSE).
Since the calculation of cal_abund is based on the tax_table, we can simply add a column of OTU names to the tax_table.

library(microeco)
data(dataset)
dataset$add_rownames2taxonomy("OTU")
colnames(dataset$tax_table)
# now tax_table in dataset has a new column "OTU"
dataset$cal_abund(rel = FALSE)
View(dataset$taxa_abund$OTU)
# the abundance in this table is same with the original abundance
# taxa_level = "OTU"
t1 <- trans_diff$new(dataset = dataset, method = "anova", group = "Group", taxa_level = "OTU")

@ChiLiubio ChiLiubio added good first issue Good for newcomers documentation Improvements or additions to documentation labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants