decontam
decontam copied to clipboard
Error in data.frame and Removed 3 samples with zero total counts (or frequency)
Hi, I need some help with my analysis. I'm trying to plot the frequency of contaminants with Decontam but I have some errors: Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 64, 67 In addition: Warning message: In plot_frequency(physeq1, taxa_names(physeq1)[c(1, 96)], conc = "QUANT_READING") : Removed 3 samples with zero total counts (or frequency). The error in the data frame occurred because in the previous step the program exclude 3 samples with 0 reads and now the data do have not the same quantity of rows. How can I fix that to proceed with the analysis? Thank you so much!
Can you clarify the code you are running to get to this error?
Also some description of the underlying data, e.g. number of samples/taxa, and what type of DNA quantitation data you are working with, perhaps also with a summary
of that column.
Yes! First I ran this decontam code, and the program excluded 3 samples with 0 total counts: contfreq1 <- isContaminant(physeq1, method="frequency", conc="QUANT_READING") Warning messages: 1: In .is_contaminant(seqtab, conc = conc, neg = neg, method = method, : Removed 3 samples with zero total counts (or frequency). 2: In .is_contaminant(seqtab, conc = conc, neg = neg, method = method, : Removed 3 samples with zero total counts (or frequency).
So I continued the steps and in the step code of the plot the frequency I get this error: Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 64, 67 In addition: Warning message: In plot_frequency(physeq1, taxa_names(physeq1)[c(1, 96)], conc = "QUANT_READING") : Removed 3 samples with zero total counts (or frequency).
We sequenced the 16S genome of samples containing the gut of bees exposed to insecticides. I have 63 samples plus 4 blankets. In qiime demultiplexing, three blankets remain with 0 reads, and I continued with the file I get after qiime processing to work in decontam. Apparently, the program excluded these samples with 0 reads. I attached the images of qiime table-dada2 and of my metadata.
Thanks so much!
If you remove the samples yourself before running isContaminant
then things should match up before and after.
e.g.
non.zero <- sample_sums(ps) > 0
ps.nonzero <- prune_samples(non.zero, ps)
# Then go forward with ps.nonzero
It worked! Thank you so much! When I continued the analysis I got another error in the presence-absence analysis:
physeq1.pa.neg <- prune_samples(sample_data(physeq1.pa)$CONTROL == "Control Sample", physeq1.pa) Error in h(simpleError(msg, call)) : error in evaluating the argument 'samples' in selecting a method for function 'prune_samples': sam_data slot is empty.
Can you help me with that? Thanks