internal error in trio library when trying to use lfmm() in LEA package
1
0
Entering edit mode
@4c67128f
Last seen 2.9 years ago
Israel

Hello, I am trying to run an analysis with the package LEA, but when using the function lfmm() I am getting the following message:

Error in lfmm("Genidentity.geno", "variables.env", K = 3, rep = 10, iterations = 1e+05, : internal error in trio library

I believe my .geno and my .env files are formatted correctly, and I am using an updated R version. I also tried to install again the trio library, but apparently none of this helped.

This is the command I am using, with the related output:

obj.lfmm = lfmm("Genidentity.geno", "variables.env", K = 3, rep = 10, iterations =100000, burnin=50000, project="new")


[1] "*********************************************************"
[1] " Conversion from the geno format to the lfmm format"
[1] "*********************************************************"
The project is saved into :
 Genidentity_variables.lfmmProject 

To load the project, use:
 project = load.lfmmProject("Genidentity_variables.lfmmProject")

To remove the project, use:
 remove.lfmmProject("Genidentity_variables.lfmmProject")

[1] "********************************"
[1] "* K = 3  repetition 1  d = 1   *"
[1] "********************************"
Summary of the options:

        -n (number of individuals)      206
        -L (number of loci)             454
        -K (number of latent factors)   3
        -o (output file)                Genidentity_variables.lfmm/K3/run1/Genidentity_r1
        -i (number of iterations)       100000
        -b (burnin)                     50000
        -s (seed random init)           1657784617
        -p (number of processes (CPU))  1
        -x (genotype file)              Genidentity.lfmm
        -v (variable file)              variables.env
        -D (number of covariables)      18
        -d (the dth covariable)         1

SNP 1 is constant among individuals.

Error in lfmm("Genidentity.geno", "variables.env", K = 3, rep = 10, iterations = 1e+05,  : 
  internal error in trio library


sessionInfo( )

R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] LEA_3.2.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6          raster_3.4-10       magrittr_2.0.1      usethis_2.0.1       devtools_2.4.1     
 [6] pkgload_1.2.1       lattice_0.20-41     R6_2.5.0            rlang_0.4.11        fastmap_1.1.0      
[11] tools_4.0.5         pkgbuild_1.2.0      rgdal_1.5-23        grid_4.0.5          sessioninfo_1.1.1  
[16] cli_2.5.0           withr_2.4.2         remotes_2.3.0       ellipsis_0.3.2      rprojroot_2.0.2    
[21] lifecycle_1.0.0     crayon_1.4.1        processx_3.5.2      purrr_0.3.4         BiocManager_1.30.15
[26] callr_3.7.0         fs_1.5.0            ps_1.6.0            codetools_0.2-18    testthat_3.0.2     
[31] glue_1.4.2          memoise_2.0.0       cachem_1.0.4        sp_1.4-5            compiler_4.0.5     
[36] desc_1.3.0          prettyunits_1.1.1

I would really appreciate if you could give me any tip to fix this error. Thanks, Valentina

lfmm LEA • 2.2k views
ADD COMMENT
0
Entering edit mode
Wu • 0
@cc43f272
Last seen 2.2 years ago
China

Recently,I had the same problem.Running the sample file found no problems. I think there's something wrong with my file.So I reformatted it.

#Convert the .lfmm file again. LFMM format before conversion, but error: internal error in trio library.
library("LEA")

r <- read.lfmm("H:/LEA/plink3_recode12.lfmm")
r1 <- write.lfmm(r, "plink3_recode.lfmm")

#Create an .env file.

f <- matrix(1:33, )   #This number should be equal to your number of individuals. I have 33.
f[1:33, ] <- c(rep(1, 33))  #I found that the values of this data are not all the same. An error that SNP 1 is constant among individuals is reported when all values are the same.
f <- write.env(f, "f.env")

#lfmm analysis

project <- lfmm("plink3_recode.lfmm", 'f.env', K = 3 , repetitions = 2,
               project = "new")

I hope my experience is useful to you.

ADD COMMENT
0
Entering edit mode
##analysis using PCA####

write.lfmm(sample_data,"genotype.lfmm") [1] "genotype.lfmm" pc=pca("genotype.lfmm",scale =T) [1] "**" [1] " Principal Component Analysis " [1] "**" summary of the options:

    -n (number of individuals)          498
    -L (number of loci)                 499
    -K (number of principal components) 498
    -x (genotype file)                  D:\PAT_IASRI\New folder_3\genotype.lfmm
    -a (eigenvalue file)                D:\PAT_IASRI\New folder_3\genotype.pca/genotype.eigenvalues
    -e (eigenvector file)               D:\PAT_IASRI\New folder_3\genotype.pca/genotype.eigenvectors
    -d (standard deviation file)        D:\PAT_IASRI\New folder_3\genotype.pca/genotype.sdev
    -p (projection file)                D:\PAT_IASRI\New folder_3\genotype.pca/genotype.projections
    -s data centered and scaled 

Error: SNP 305 is constant among individuals.

Error in pca("genotype.lfmm", scale = T) : internal error in trio library

I am getting this error using "LEA" package. I need suggestions on this issue.

ADD REPLY
0
Entering edit mode

I'm getting the same "constant among individuals" and "trio library" error messages too when using LEA. How did you resolve the issue?

ADD REPLY

Login before adding your answer.

Traffic: 831 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6