HCBravoLab/metagenomeSeq

Error : At least one NA normalization factors

Closed this issue · 5 comments

Hello,
I am trying to analyse differential abundances of bacterial taxa in subways. Using fitFeatureModel(). First I subset the MRexperiment object, keeping three levels of the factor "surface_type":

obj1 <- obj[, which(pData(obj)$surface_type %in% selected)]

After that I normalized the data, using default options.
When fitting the model I got that error massage

Error in fitFeatureModel(obj, mod) : At least one NA normalization factors

But when I check for NA, I got:
is.na(normFactors(obj1))

SRR3545898 SRR3545941 SRR3546351 SRR3546354 SRR3546358 SRR3546361 SRR3546371 SRR3546380
FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

Can you, please, give me a hint where is my fault!
Thank you!

Do you get the same error on the data without subsetting to the selected surface types?

I did not get any error, when analyzing the "sampling_place" (which has just two levels). However I decided to subset the data, because there was a message:

Can't analyze currently

Probably because the factor has more than three levels.
I found that line:

if(ncol(mmCount)>3){ stop("Can't analyze currently.") }

So I decided to analyze a subset of three surfaces. And then I got that error.

Maybe re-leveling the 'surface_type' column helps:

obj1 <- obj[, which(pData(obj)$surface_type %in% selected)]
pData(obj1)$surface_type <- factor(pData(obj1)$surface_type)

Thanks I will try.
And could you tell the reason for the "Can't analyze currently" error?
Is it the factor's levels or there is another reason?

Ok, let us know how it goes. The fitFeatureModel model is only supported for two level factor comparisons, which gives rise to the error.