benjjneb / decontam

Simple statistical identification and removal of contaminants in marker-gene and metagenomics sequencing data
https://benjjneb.github.io/decontam/
144 stars 24 forks source link

plot_frequency error #58

Open lixiaopi1985 opened 4 years ago

lixiaopi1985 commented 4 years ago

Hi,

I encountered an issue when plotting frequency:

Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 605, 633

In addition: Warning message: In plot_frequency(phyloseq_merged, taxa_names(phyloseq_merged)[c(1, : Removed 28 samples with zero total counts (or frequency).

Most likely it is due to 0 reads in the samples (605+28 = 633):

> summary(sample_sums(phyloseq_merged))

Min. 1st Qu. Median Mean 3rd Qu. Max. 0 11713 17840 19295 26885 54391

Is there way to keep those 0 frequency samples?

This issue is the same as issue #30, but that post does not point to where the problem was.

Thanks

benjjneb commented 4 years ago

This looks like a bug, in that the zero-count samples are being removed as appropriate, but then either the row.names or some other variable is not being appropriately subset as well.

However, as a workaround can you just subset out the zero-count samples prior to plot_frequency? That won't affect the (intended) function as it will remove those uninformative samples anyway.