decontam icon indicating copy to clipboard operation
decontam copied to clipboard

Reading in data as a phyloseq object using readRDS()

Open NaomiHuntley opened this issue 4 years ago • 5 comments

Dear All,

I am looking at the Decontam vignette but I am stuck at the beginning where you read in the data with the following code:

ps <- readRDS(system.file("extdata", "MUClite.rds", package="decontam"))

I am familiar with reading in data as a phyloseq object, using the code:

ps <- phyloseq(otu_table(as.matrix(ASV), taxa_are_rows=TRUE), sample_data(meta), tax_table(as.matrix(tax)))

However, the issue I am having is if I read in the data as a phyloseq object in the manner that I did before, I do not have the quant_reading column that seems to be an important component in the remaining steps. Can you please help me to understand what the inputs should be in the code in your vignette?

Thank you! Naomi

NaomiHuntley avatar Jun 03 '20 01:06 NaomiHuntley

Can you clarify: You are trying to follow the tutorial? But... you are adding an additoinal step with ps <- phyloseq(...) into the tutorial workflow? Or... are you trying to appply this workflow to your own data and that is the problem?

benjjneb avatar Jun 03 '20 03:06 benjjneb

I am trying to follow the tutorial on my own data to read in the data using the code:

ps <- readRDS(system.file("extdata", "MUClite.rds", package="decontam")) but I do not know what the inputs should be for my own data for "extdata" and "MUClite.rds"

NaomiHuntley avatar Jun 03 '20 03:06 NaomiHuntley

For your own data there shouldn't even be a "extdata" or "MUClite.rds" probably. Those are directories and filenames intended to read in an example phyloseq object.

For your data, have you generated a phyloseq object already? If so, that's what to work with. Doest it include data about the DNA concentrations in each sample? If so, under what column name?

benjjneb avatar Jun 03 '20 03:06 benjjneb

Yes I made a ps object using this code:

ps <- phyloseq(otu_table(as.matrix(ASV), taxa_are_rows=TRUE), sample_data(meta), tax_table(as.matrix(tax)))

So I think the problem is that I do not have the quant_reading column the same way that your ps object did.

NaomiHuntley avatar Jun 03 '20 03:06 NaomiHuntley

Yes, if you don't have that column in your meta data.frame. then it won't work exactly as written. Is that data in another form or under another name in that data.frame? If so, you can potentially just change the name of the colum in the code and apply the tutorial workflow. If not, then you don't have the necessary information in your data.

benjjneb avatar Jun 03 '20 03:06 benjjneb