genetics-statistics / GEMMA

Genome-wide Efficient Mixed Model Association
https://github.com/genetics-statistics/GEMMA
GNU General Public License v3.0
331 stars 125 forks source link

Check matrix properties (5 out of 7 implemented in 0.97) #72

Open pjotrp opened 7 years ago

pjotrp commented 7 years ago

GEMMA should give hints if matrix properties are invalid, such as discussed in https://github.com/genetics-statistics/GEMMA/issues/45#issuecomment-323524276. E.g.

  1. Fail if K has negative eigen values
  2. Fail if K is not symmetric
  3. Fail if K is not positive definite
  4. Warn in eigen values are very small
  5. Warn if K is ill conditioned
  6. Warn on related pairs
  7. Warn on MAF problems

@xiangzhou @pcarbo anything else we can think of?

Failures and warnings should be reported in the log file. These checks can be disabled with the --no-checks switch (i.e., dangerous mode but faster).

pjotrp commented 7 years ago

Implemented points 1..5 in PR https://github.com/genetics-statistics/GEMMA/pull/73

pcarbo commented 7 years ago

@pjotrp That is a great summary. The cholesky factorization methods in most libraries has a check for a matrix being s.p.d. (symmetric positive definite), so you could use this to implement item 4.

pjotrp commented 7 years ago

1-4 have been implemented. 5 and 6 probably show up now as warnings.