cozygene / FEAST

Fast expectation maximization for microbial source tracking
Other
115 stars 60 forks source link

Error in if (abs(m_guesses[length(m_guesses)] - m_guesses[length(m_guesses) - :missing value where TRUE/FALSE needed #58

Open KyleRowe1230 opened 9 months ago

KyleRowe1230 commented 9 months ago

Dear FEAST Group,

Hello,

I'm trying run FEAST on a 16S dataset and have encontered an error while running the algorithm. Command and error below:


> FEAST_output <- FEAST(C = otus, metadata = metadata, different_sources_flag = 0, dir_path = "~/FEAST/",outfile="demo")
Error in if (abs(m_guesses[length(m_guesses)] - m_guesses[length(m_guesses) -  : 
missing value where TRUE/FALSE needed

Thanks!

Kyle

nikolgr commented 8 months ago

No response?

AkilaMuthalagu commented 7 months ago

Does anyone have a solution for this? I am facing the same issue

AkilaMuthalagu commented 7 months ago

It shows there are missing values in your data file. I used (is.na) function to find the rows and columns. if (any(is.na(otus))) { stop("Error: Missing values detected in 'otus'. Please handle missing values.") }

Result: Error: Error: Missing values detected in 'otus'. Please handle missing values. To check the row with missing values

rows_with_na <- which(apply(metadata, 1, anyNA)) cols_with_na <- which(apply(metadata, 2, anyNA))

I used replace function to add 0, That worked for me