fisw10 / BHPMF

Bayesian Probabilistic Matrix Factorization - Uncertainty quantified imputation of hierarchical databases
9 stars 7 forks source link

R session aborted error #2

Closed rwdearth closed 2 years ago

rwdearth commented 2 years ago

Hi, every time I run GapFilling command, I encounter fatal error and R session aborts. Can you please, help? my R version is 3.4.1 I followed all the manual direction, but don't know why I failed. data set and codes are as follows;

phylo <- matrix(c( "Abarema jupunba", "Abarema", "Fabaceae", "Angi", "Abarema jupunba", "Abarema", "Fabaceae", "Angi", "Abarema jupunba", "Abarema", "Fabaceae", "Angi", "Abarema jupunba", "Abarema", "Fabaceae", "Angi", "Albies alba", "Abies", "Pinaceae", "Gymn", "Albies alba", "Abies", "Pinaceae", "Gymn", "Albies alba", "Abies", "Pinaceae", "Gymn", "Albies alba", "Abies", "Pinaceae", "Gymn", "Albies alba", "Abies", "Pinaceae", "Gymn", "Abies amabilis", "Abies", "Pinaceae", "Gymn", "Abies amabilis", "Abies", "Pinaceae", "Gymn", "Pinus ponderosa", "Pinus", "Pinaceae", "Gymn", "Pinus ponderosa", "Pinus", "Pinaceae", "Gymn", "Pinus ponderosa", "Pinus", "Pinaceae", "Gymn", "Pinus ponderosa", "Pinus", "Pinaceae", "Gymn" ), 15, 4, byrow = TRUE)

traits <- matrix(c( NA, 17.5, NA, NA, 283.7, NA, NA, NA, NA, 9.44, NA, NA, NA, NA, NA, 0.78, NA, 4.45, NA, NA, NA, 5.6, NA, NA, NA, NA, -3.65, NA, NA, NA, -4.15, NA, NA, NA, NA, 0.353, NA, NA, NA, 0.4, NA, NA, 6.96, NA, 155, NA, NA, NA, NA, 3.23, NA, NA, NA, NA, -3.86, NA, NA, NA, NA, 0.38 ), 15, 4, byrow=TRUE)

nrow(phylo) == nrow(traits)

back_trans_pars <- list() rm_col <- c() for(i in 1:ncol(traits)){ x <- traits[, i] min_x <- min(x, na.rm=TRUE) if(min_x < 0.00000001){ x <- x - min_x +1 } logx <- log10(x) mlogx <- mean(logx, na.rm = TRUE) slogx <- sd(logx, na.rm = TRUE) x <- (logx - mlogx)/slogx back_trans_pars[[i]] <- list(min_x = min_x, mlogx = mlogx, slogx = slogx) traits[, i] <- x }

tmp.dir <- "c:/Users/76gra/Desktop/Phd/Climate/Trait analysis/tmp/" dirname(tmp.dir)

write.csv(back_trans_pars, paste0(tmp.dir, "back_trans_pars.csv")) #up to here everything is working fine.

However, if I run GapFilling line below, R session just crashes.

GapFilling(traits, phylo, mean.gap.filled.output.path = paste0(tmp.dir, "/mean_gap_filled.txt"), std.gap.filled.output.path = paste0(tmp.dir,"/std_gap_fileed.txt"))

LuciaOliveiracruz commented 7 months ago

Hello, I get the same error as you. How did you solve it ? Thank you.

rwdearth commented 7 months ago

Hi, Lucia,

How did you structure your data? It is important that you have an ID column before species name. And, make sure that each cell in the ID column have a unique value so that the algorithm does not get confused with multiple input of the same species.

Hope it helps!

LuciaOliveiracruz commented 7 months ago

Hello, Thanks a lot for your answer. We tried without the ID column on Linux and this is working fine. And this is actually working on Windows with your tip ! Thank you. Lucia Oliveira-cruz

Le mer. 28 févr. 2024 à 05:01, rwdearth @.***> a écrit :

Hi, Lucia,

How did you structure your data? It is important that you have an ID column before species name. And, make sure that each cell in the ID column have a unique value so that the algorithm does not get confused with multiple input of the same species.

Hope it helps!

— Reply to this email directly, view it on GitHub https://github.com/fisw10/BHPMF/issues/2#issuecomment-1968174290, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCWPDJFBPBFOKV4NADGF4BLYV2TYNAVCNFSM6AAAAAAQCWCSP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRYGE3TIMRZGA . You are receiving this because you commented.Message ID: @.***>