pneuvial / c3co

Inferring cancer cell clonality from copy-number data
5 stars 1 forks source link

ROBUSTNESS: Assert finite estimates on W and Z #49

Open HenrikBengtsson opened 5 years ago

HenrikBengtsson commented 5 years ago

Add sanity checks on the estimates of W and Z:

HenrikBengtsson commented 5 years ago

Observation: At least W can be slightly outside [0,1], e.g.

   Segmented data is provided, skip segment step
   List of 3
    $ W  : num [1:5, 1:5] 0.981 0 0 0 0 ...
     ..- attr(*, "dimnames")=List of 2
     .. ..$ : chr [1:5] NA NA NA NA ...
     .. ..$ : NULL
    $ rW : num [1:2] 0 1
    $ rW-c(0,1): num [1:2] 0.00 2.22e-16
   'all(W <= 1)' is not TRUE
   Execution halted

Comment: We have

> .Machine$double.eps
[1] 2.220446e-16

In other words, it may very well be that all(W <= 1+eps) is always TRUE.

pneuvial commented 5 years ago

We should allow for NA:s in these checks, as get.W can now produce NA:s (cf #67)