anpefi/msap

Error in which(PolyM) : argument to 'which' is not logical

anpefi opened this issue · 1 comments

Error in which(PolyM) : argument to 'which' is not logical

It is caused when all transformed samples in a MSL marker are NA, yielding a NULL return from polymorphic(). However, it makes not sense that a MSL is full of NAs when using uninformative option. The reason of this is that msap didn't expect NAs in the dataset and when classifying MSL and NML, NAs are affecting the relative frequencies as msap is dividing by all the samples, not only the valid samples.

To fix it, in methStatusEval() I need to change:

    if(uninformative) fMet <- 1-(length(x[which(x==11|x==0)])/length(x)) 
    else fMet <- 1-(length(x[which(x==11)])/length(x))

by

if(uninformative) fMet <- 1-(length(x[which(x==11|x==0)])/sum(!is.na(x)) ) 
else fMet <- 1-(length(x[which(x==11)])/sum(!is.na(x)) ) 

It is also important to add into documentation a note about missing data and how to dela with (see issue #11 )