decontam
decontam copied to clipboard
Some batches contain zero or one samples.
Hi
I am trying to use decontam on my data and I keep getting this error:
Error in isContaminant(physeq2, method = "frequency", conc = "quant_reading") : Some batches contain zero or one sample.
I have checked my data there are no zero quantity values and I have removed the samples with zero OTUs.
What can be going wrong? Please help
Do any of your batches contain one sample or less?
You can inspect that by table(my_data_frame$batch-column)
It gives this error: Error in table(otu_table$batch - column) : object 'column' not found
This is what I have been doing so far: ##load data in R## I've converted the BIOM ASVs file form QIIME to TSV and then to csv to load in R otu_table <- read.csv(file.choose(), header= TRUE, row.names = 1) taxonomy <- read.csv(file.choose(), header=T, row.names = 1) sample_data <- read.csv(file.choose(), row.names = 1, header =T)
###converted to a phyloseq object ###
count_tab <- otu_table(otu_table, taxa_are_rows=T) sample_info <- sample_data(sample_data) physeq2 <- phyloseq(count_tab, sample_info)
run with decontam
contamdf.freq <- isContaminant(physeq2, method="frequency", conc="quant_reading")
and then it gives me the error
Error in isContaminant(physeq2, method = "frequency", conc = "quant_reading") : Some batches contain zero or one sample.
How many samples are in physeq2? You can just physeq2
to get a summary of what's stored in that object.
phyloseq-class experiment-level object otu_table() OTU Table: [ 8397 taxa and 1 samples ] sample_data() Sample Data: [ 1 samples by 2 sample variables ]
That's the problem. Your physeq2
object has just one sample in it.
This is probably an issue with how you are exporting data from QIIME and importing it into R.
HI
So the files that I upload have all the samples. I then do this:
count_tab <- otu_table(otu_table, taxa_are_rows=T) sample_info <- sample_data(sample_data) physeq2 <- phyloseq(count_tab, sample_info)
This is when it considers them as 1 sample. What am I doing wrong?
I have made a biom file and then a tsv file and then a csv file to import in R
I'm not sure. Is this being exported from QIIME2? If so I think they have developed documentation about how to export QIIME2 data into R as a phyloseq object that you should take a look at.
In fact someone's made an R pakage for just that purpose: https://github.com/jbisanz/qiime2R