NKI-CCB / DISCOVER

DISCOVER co-occurrence and mutual exclusivity analysis for cancer genomics data
Apache License 2.0
27 stars 6 forks source link

Error on running background probability calculation #25

Open idmehta opened 8 months ago

idmehta commented 8 months ago

In R, when running the discover.matrix() function on a binarised alteration matrix: D <- discover.matrix(M)

We obtain an output, but receive the following error:

ABNORMAL_TERMINATION_IN_LNSRCH

Line search cannot locate an adequate point after 20 function and gradient evaluations. Previous x, f and g restored. Possible causes: 1 error in function or gradient evaluation; 2 rounding error dominate computation.

What does this mean and are we able to trust the output of the function in this case? This error only appears when running discover.matrix on specific binarised alteration matrices. We are unsure what characteristics of the binarised alteration matrix are resulting in this error.

Please find an anonymised binarised alteration matrix which reproduces this error message. binarise_alteration_matrix_with_error.csv

scanisius commented 8 months ago

The likely cause of the error you're seeing is the large numbers of genes without any mutation in your matrix. Normally this message is pretty harmless. One way to check if you can trust the output is the following:

summary(rowSums(D$events) - rowSums(D$bg))
#       Min.    1st Qu.     Median       Mean    3rd Qu.       Max.
# -5.526e-05  0.000e+00  0.000e+00 -8.280e-09  0.000e+00  2.360e-05

These differences between observed and expected mutations should be close to zero, which is the case for the matrix you attached.

A way to avoid this message altogether is to exclude genes with no mutations. This will not affect the results of your analyses, since genes without mutations do not contribute to the estimation of the background model.

D2 <- discover.matrix(M[rowSums(M) > 0, ])