Comments (6)
Sorry that I never followed up with this issue. I tried some solutions but I haven't succeeded. I am not sure why this happens. It seems to be more related to RcppArmadillo than sommer itself but I will keep trying things and see if I can make it work.
Cheers,
Hi, the problem seems to be in MNR.cpp, I tried the following changes to avoid such error messages.
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
// we only include RcppArmadillo.h which pulls Rcpp.h in for us
#define ARMA_64BIT_WORD
#define ARMA_DONT_PRINT_ERRORS
#include "RcppArmadillo.h"
#include "stdlib.h"
#include <progress.hpp>
// [[Rcpp::export]]
arma::mat amat(const arma::mat & Xo, const bool & vanraden, double minMAF) {
// remove min.MAF
arma::rowvec pfreq = mean(Xo+1,0)/2; // frequency of p
arma::mat pqfreq = arma::join_cols(pfreq,1-pfreq); // frequencies of p and q
arma::rowvec MAF = min(pqfreq,0); // minor allele freqs
arma::uvec indexMAF = find(MAF > minMAF); // index for good markers > minMAF
arma::mat Xo2 = Xo.cols(indexMAF); // new X only with polymorphic markers
// remove monomorphic markers
arma::rowvec xVar = var(Xo2,0); // column variance
arma::uvec index = find(xVar > 0); // index for good markers
arma::mat X = Xo2.cols(index); // new X only with polymorphic markers
// initialize A
int p = X.n_cols;// number of markers
int n = X.n_rows;
arma::mat A(n,n);
if(vanraden == true){ // regular vanRaden
arma::rowvec ms012 = mean( X+1, 0 ); // means of columns
arma::rowvec freq = ms012/2;
double v = 2 * mean(freq % (1 - freq));
arma::mat one(n, 1, arma::fill::ones);
arma::mat freqmat = one * freq;
arma::mat W = (X + 1) - (2 * freqmat);
//
arma::mat K = W * W.t();
A = K/v/p;
}else{ // Endelman (currently we have a bug here)
// IN R: M <- scale(X, center = TRUE, scale = FALSE)
arma::rowvec ms = mean( X, 0 ); // means of columns
arma::mat M = X.each_row() - ms;
// IN R: tcrossprod(M)
arma::mat K = M * M.t();
// IN R: K/mean(diag(K)) mean(K.diag())
double v = mean(diagvec(K));
A = K/v;
}
return A;
}
from sommer.
Dear Eduardo,
We are trying to use A.mat with 75000k lines and 10k markers, getting the following error:
Error: Mat::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD
Still seems to work with 50k lines, but 75k doesn't work any more. Must be related to the number of individuals, because I can replicate it with only 5 markers too. rrBLUP::A.mat does not seem to have this problem, but I thought sommer::A.mat might be more efficient?I am not sure if that is something related to sommer or Rcpp...
Best Gregor
Hello, I also encountered the same problem as you. Is there any solution?
from sommer.
Dear Eduardo,
We are trying to use A.mat with 75000k lines and 10k markers, getting the following error:Error: Mat::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD
Still seems to work with 50k lines, but 75k doesn't work any more. Must be related to the number of individuals, because I can replicate it with only 5 markers too. rrBLUP::A.mat does not seem to have this problem, but I thought sommer::A.mat might be more efficient?
I am not sure if that is something related to sommer or Rcpp...
Best GregorHello, I also encountered the same problem as you. Is there any solution?
Hi, my solution was to use A.mat from the rrBLUP package.
Best Gregor
from sommer.
Dear Eduardo,
We are trying to use A.mat with 75000k lines and 10k markers, getting the following error:Error: Mat::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD
Still seems to work with 50k lines, but 75k doesn't work any more. Must be related to the number of individuals, because I can replicate it with only 5 markers too. rrBLUP::A.mat does not seem to have this problem, but I thought sommer::A.mat might be more efficient?
I am not sure if that is something related to sommer or Rcpp...
Best GregorHello, I also encountered the same problem as you. Is there any solution?
Hi, my solution was to use A.mat from the rrBLUP package.
Best Gregor
Okay thanks for your reply.
from sommer.
Sorry that I never followed up with this issue. I tried some solutions but I haven't succeeded. I am not sure why this happens. It seems to be more related to RcppArmadillo than sommer itself but I will keep trying things and see if I can make it work.
Cheers,
from sommer.
I already tried that and it solves it for isolated functions but it does not work for compiling the entire package. But thanks for trying on your side. This issue seems to arise from functions that use the sparse matrix functions from the Armadillo library. I will keep trying other things.
from sommer.
Related Issues (20)
- predict function when spl2D is used HOT 4
- predict() error in cross-validation HOT 6
- Facing error at the stage of A.mat HOT 3
- Can't get mmec to run HOT 4
- mmec using weights (W) HOT 5
- mmer fails when number of observations > 2^15 HOT 4
- Poisson and Negative Bionomial Distributed Traits HOT 2
- how to add permanent environmental effect in random regression model ? HOT 1
- Throw error for singular system HOT 6
- GWAS entries in CHANGELOG and documentation HOT 2
- Predict.mmec function issue HOT 1
- Different varcomp estimates between sommer and ASReml-R when it is bounded HOT 1
- multivariate model specification with different fixed effects per trait HOT 1
- Possible mix up between VanRaden and Endleman GRMs HOT 1
- Cooks distance HOT 2
- multivariate (multi-trait) for modeling GCA HOT 5
- Error in predict.mmer Error in `$<-.data.frame`(`*tmp*`, start, value = c(1, 2, 3, 4, 5, 13, : replacement has 16 rows, data has 8 HOT 2
- thetaC constraint in isc, dsc, ... functions: lack of documentation HOT 1
- Factor analytic covariance structure updates during REML HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sommer.