benjjneb / decontam

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

Probable bug in "getFromPS(ps, conc) : ng.DNA is not a valid sample-variable in the provided phyloseq object." #128

Closed roey-angel closed 1 year ago

roey-angel commented 1 year ago

After updating to version 1.20.0: isContaminant(Ps_obj, method = "frequency", conc = "ng.DNA") says:

Error in getFromPS(ps, conc) : 
  ng.DNA is not a valid sample-variable in the provided phyloseq object.

But

isContaminant(Ps_obj, method = "frequency", conc = get_variable(Ps_obj, "ng.DNA"))

Works

benjjneb commented 1 year ago

What version of phyloseq are you using? Can you provide a small phyloseq object that I can use to reproduce this behavior?

roey-angel commented 1 year ago

I'm using phyloseq 1.44 The issue turned out to be simply NAs in the "conc" variable. The error message could be more informative, but it's nothing critical.