Skip to content

Commit

Permalink
Merge pull request #29 from mskcc/facets_iteration_fix
Browse files Browse the repository at this point in the history
Allowed for 3 attempts to perform a facets iteration, will error out …
  • Loading branch information
timosong authored Nov 15, 2019
2 parents 0032648 + 7e0a1a0 commit 97b1e7e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions doFacets.R
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,21 @@ facets_iteration <- function(COUNTS_FILE, TAG, DIRECTORY, CVAL, DIPLOGR, NDEPTH,

if (RLIB_VERSION >= '0.5.2') {


rcmat = readSnpMatrix2(COUNTS_FILE, err.thresh = 10, del.thresh = 10)

dat = preProcSample(rcmat, ndepth = NDEPTH, het.thresh = 0.25, snp.nbhd = SNP_NBHD, cval = 25,
gbuild = GENOME, hetscale = TRUE, unmatched = unmatched, ndepthmax = 1000)

out = procSample(dat, cval = CVAL, min.nhet = MIN_NHET, dipLogR = DIPLOGR)
fit = emcncf(out)

numcounts = 3
for (i in 1:numcounts){
print(paste0("attempt ",i))
tryCatch({
dat = preProcSample(rcmat, ndepth = NDEPTH, het.thresh = 0.25, snp.nbhd = SNP_NBHD, cval = 25,
gbuild = GENOME, hetscale = TRUE, unmatched = unmatched, ndepthmax = 1000)
out = procSample(dat, cval = CVAL, min.nhet = MIN_NHET, dipLogR = DIPLOGR)
fit = emcncf(out)
break
},
error=function(e){str(e)}
)
}
fit$cncf = cbind(fit$cncf, cf = out$out$cf, tcn = out$out$tcn, lcn = out$out$lcn)

write_output(out, fit, DIRECTORY, TAG, TUMOR_ID )
Expand Down

0 comments on commit 97b1e7e

Please sign in to comment.