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

How to apply decontam to functional data #151

Open
Ivy-ops opened this issue Oct 2, 2024 · 3 comments
Open

How to apply decontam to functional data #151

Ivy-ops opened this issue Oct 2, 2024 · 3 comments

Comments

@Ivy-ops
Copy link

Ivy-ops commented Oct 2, 2024

Hi Developer,
Thank you for developing this tool. Applying it to feature count data is quite straightforward. As you know functional information is also important for the microbiome data. I was wondering if it can also be applied to the HUMAnN3 output, which is CPM-transformed data?
Thanks!

@benjjneb
Copy link
Owner

benjjneb commented Oct 3, 2024

Yes, if you have the appropriate auxiliary data. Either the same functional profiles from negative controls, or measurements of the input DNA concentrations.

@Ivy-ops
Copy link
Author

Ivy-ops commented Oct 5, 2024

@benjjneb Thank you! I saw the tutorial is on phyloseq data format. How can have a decontamed table? As my input is a OTU table, and my output wants to be a decontamed OTU table.

The demo code only returns a list of vectors.

st <- readRDS(system.file("extdata", "st.rds", package="decontam"))
conc <- c(6413, 3581.0, 5375, 4107, 4291, 4260, 4171, 2765, 33, 48)
neg <- c(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE)
isContaminant(st, conc=conc, method="frequency", threshold=0.2) 

@benjjneb
Copy link
Owner

is.conc <- isContaminant(st, conc=conc, method="frequency", threshold=0.2)

This will return a TRUE/FALSE vector (a logical vector) where TRUE values indicate contaminants identifed at the 0.2 threshold.

If you want to remove those OTUs/ASVs, then st.nocontam <- st[,!is.conc] will return a sequence table without the contaminant-classified OTUsASVs.

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