Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z1 <= Z2 ? #2

Open
pneuvial opened this issue Nov 16, 2016 · 6 comments
Open

Z1 <= Z2 ? #2

pneuvial opened this issue Nov 16, 2016 · 6 comments
Assignees
Labels
correctness Issues related to correctness of the statistical model, estimator, algorithm, etc.

Comments

@pneuvial
Copy link
Owner

In https://github.com/pneuvial/incas-cn/blob/master/R/getZ.R#L17-L23 we are taking care of the situation where minor CN > major CN in the latent profiles. Does this happen? Hopefully not. If not, then we should rather throw an error than silently swapping minor and major CNs.

@mpierrejean
Copy link
Collaborator

This doesn't happen for the simulations but does on real data experiments (probably due to the trick to estimate DoH and then minor and major CNs).
We may put a "warning" at the beginning of the algorithm to warn user that some estimates of Z1 are greater than Z2.

@pneuvial
Copy link
Owner Author

Would you mind commenting on what you did to address this issue, and link to a specific commit?

@pneuvial pneuvial reopened this Nov 24, 2016
@mpierrejean
Copy link
Collaborator

Modification of get.Z.
Remove

Z1 <- sapply(idx, function(ii){
      jj <- which(Z1[,ii]>Z2[,ii])
      Z1[jj, ii] <- Z2[jj, ii]
       return(Z1[,ii])
    })

minor CN > major CN cannot happen if estimates are correctly done.

@pneuvial
Copy link
Owner Author

If it cannot happen, then you should add a sanity check that it doesn't, using e.g. stopifnot().
If it may happen in weird case, then you should at least add a warning.

It would also be nice to have a test about this, but I'm not sure how to do that.

@mpierrejean
Copy link
Collaborator

Add a warning when Z1 is larger than Z2.
5e91d7d

@mpierrejean
Copy link
Collaborator

In most of cases Z1 is larger than Z2 when the optimal number of archetype is reached.
An example is given below, after p>=4 :

set.seed(147)
len <- 500*10
nbClones <- 3
bkps <- list(c(100,250)*10, c(150,400)*10,c(150,400)*10)
regions <- list(c("(1,2)", "(0,2)", "(1,2)"),
  c("(1,1)", "(0,1)", "(1,1)"), c("(0,2)", "(0,1)", "(1,1)"))
dataAnnotTP <- acnr::loadCnRegionData(dataSet="GSE13372_HCC1143", tumorFraction=1)
dataAnnotN <- acnr::loadCnRegionData(dataSet="GSE13372_HCC1143", tumorFraction=0)
datSubClone <- buildSubclones(len, dataAnnotTP, dataAnnotN, nbClones, bkps, regions)
W = rSparseWeightMatrix(15, 3, 0.7)
datList <- mixSubclones(subClones=datSubClone, W)
l1 <- seq(from=1e-8, to=1e-5, length.out=10)
nb.arch <- 2:6
parameters.grid <- list(lambda1=l1, nb.arch=nb.arch) 
res <- c3co(datList, parameters.grid, verbose=FALSE)

@HenrikBengtsson HenrikBengtsson added the correctness Issues related to correctness of the statistical model, estimator, algorithm, etc. label Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correctness Issues related to correctness of the statistical model, estimator, algorithm, etc.
Projects
None yet
Development

No branches or pull requests

3 participants