sriramlab / SCORE

SCalable genetic CORrelation Estimator
8 stars 1 forks source link

Assertion `aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols()' failed #9

Open Wainberg opened 1 year ago

Wainberg commented 1 year ago

I'm running SCORE on 52 phenotypes and 16 covariates across 409625 participants:

software/SCORE/build/SCORE -g genotypes -p phenotypes.pheno -c covariates.tsv -b 10 -o SCORE_output.tsv

and getting the following error:

SCORE: /home/software/SCORE/include/Eigen/src/Core/CwiseBinaryOp.h:110: Eigen::CwiseBinaryOp<BinaryOp, Lhs, Rhs>::CwiseBinaryOp(const Lhs&, const Rhs&, const BinaryOp&) [with BinaryOp = Eigen::internal::scalar_product_op<double, double>; LhsType = const Eigen::Matrix<double, -1, -1, 1>; RhsType = const Eigen::Matrix<double, -1, -1, 1>; Lhs = Eigen::Matrix<double, -1, -1, 1>; Rhs = Eigen::Matrix<double, -1, -1, 1>]: Assertion `aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols()' failed.

Here's the log and stacktrace when running with GDB after compiling with -O0 -g:

$ gdb --args software/SCORE/build/SCORE -g genotypes -p phenotypes.pheno -c covariates.tsv -b 10 -o SCORE_output.tsv
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-conda-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from software/SCORE/build/SCORE...
(gdb) run
Starting program: /home/wainberg/software/SCORE/build/SCORE -g genotypes -p phenotypes.pheno -c covariates.tsv -b 10 -o SCORE_output.tsv
Binary phenotype: 0
Filling phenotype with mean: 0
Compute heritability: 1
Output write to destination SCORE_output.tsv
Read in 52 phenotypes
There are 396462 409216 405909 407307 409594 409074 378907 409625 408714 409046 409005 369935 362390 259616 409625 409625 403584 403607 359607 335866 332076 396436 384992 374830 374609 383443 404552 409334 409617 395809 409316 405642 403459 401937 402502 408827 405141 405051 409625 408797 324711 382862 215469 406978 172507 332478 407291 409162 369564 409147 127492 408753 individuals with no missing phenotypes
Total number of annotation groups: 1
num of random vectors: 10
Read in 16 Covariates..
genotype size: 409625 X 9410777
Total number of blocks: 2221
Start reading genotype round 1/2...
Reading chromosome 0
SCORE: /home/wainberg/software/SCORE/include/Eigen/src/Core/CwiseBinaryOp.h:110: Eigen::CwiseBinaryOp<BinaryOp, Lhs, Rhs>::CwiseBinaryOp(const Lhs&, const Rhs&, const BinaryOp&) [with BinaryOp = Eigen::internal::scalar_product_op<double, double>; LhsType = const Eigen::Matrix<double, -1, -1, 1>; RhsType = const Eigen::Matrix<double, -1, -1, 1>; Lhs = Eigen::Matrix<double, -1, -1, 1>; Rhs = Eigen::Matrix<double, -1, -1, 1>]: Assertion `aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols()' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff7741387 in raise () from /lib64/libc.so.6
(gdb) backtrace
#0  0x00007ffff7741387 in raise () from /lib64/libc.so.6
#1  0x00007ffff7742a78 in abort () from /lib64/libc.so.6
#2  0x00007ffff773a1a6 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff773a252 in __assert_fail () from /lib64/libc.so.6
#4  0x00005555557e12f9 in Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, Eigen::Matrix<double, -1, -1, 1, -1, -1> const, Eigen::Matrix<double, -1, -1, 1, -1, -1> const>::CwiseBinaryOp (this=0x7fffffff9300, aLhs=..., aRhs=..., func=...) at /home/wainberg/software/SCORE/include/Eigen/src/Core/CwiseBinaryOp.h:110
#5  0x00005555557dc91f in Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >::cwiseProduct<Eigen::Matrix<double, -1, -1, 1, -1, -1> > (this=0x7fffffff8c10, other=...)
    at /home/wainberg/software/SCORE/include/Eigen/src/Core/../plugins/MatrixCwiseBinaryOps.h:25
#6  0x00005555557ce0b9 in compute_b1 (use_cov=true, y_sum=..., exist_ind=396462, pheno_prime_cur=..., pheno_fill=false, pheno_num=52, snp_idx=0, cov_num=16)
    at /home/wainberg/software/SCORE/src/score_stream.cpp:1103
#7  0x00005555557d2ba9 in main (argc=11, argv=0x7fffffffcf48) at /home/wainberg/software/SCORE/src/score_stream.cpp:1671

Some of the phenotypes are NA, but mean-imputing them in Python before running SCORE doesn't fix the problem. Taking out -c covariates.tsv fixes the problem, as does removing some combinations of phenotypes. But there's no individual phenotype that causes the problem, whether it runs or fails seems to be a property of which combination of phenotypes are included.