broadinstitute / ichorCNA

Estimating tumor fraction in cell-free DNA from ultra-low-pass whole genome sequencing.
GNU General Public License v3.0
160 stars 87 forks source link

Error in Optimization #39

Open sengoku93 opened 6 years ago

sengoku93 commented 6 years ago

Hi,

I have pasted code below of error when running ichor_CNA snakemake:

Error in optim(n_prev, fn = completeLikelihoodFun, pType = rep("n", S), : 2 L-BFGS-B needs finite values of 'fn' 1 Calls: HMMsegment -> runEM -> estimateParamsMap

Do you have suggestions on how to resolve this issue? Thank you!

gavinha commented 6 years ago

Hi @sengoku93

There are many reasons for this error. Usually, errors that occur during parameter estimation are related to

Is this error coming up for all samples?
Can you show me the contents of the log file?

Thanks, Gavin

sengoku93 commented 6 years ago

Hi,

The error is coming up for all samples. I have run this without snakemake using bash script and it works fine. But when using snakemake, it results in this error. Is it possible it is an R version related issue? I am using R/3.4.0 for the snakemake to generate wig and run ichor but for bash script, I am using R/3.3.0 to generate wig and then R/3.4.0 to run ichor(using R/3.3.0 results in failure to load XML package). Thank you! Below is the log contents of the log file:

$WIG 1 [1] "results/readDepth/BB1269.bin1000000.wig" 2 3 $gcWig 4 [1] "/nfs/sw/src/ichorCNA/inst/extdata/gc_hg19_1000kLoading required package: IRanges 5 Loading required package: methods 6 Loading required package: BiocGenerics 7 Loading required package: parallel 8 9 Attaching package: ‘BiocGenerics’ 10 11 The following objects are masked from ‘package:parallel’: 12 13 clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, 14 clusterExport, clusterMap, parApply, parCapply, parLapply, 15 parLapplyLB, parRapply, parSapply, parSapplyLB 16 17 The following objects are masked from ‘package:stats’: 18 19 IQR, mad, sd, var, xtabs 20 21 The following objects are masked from ‘package:base’: 22 23 anyDuplicated, append, as.data.frame, cbind, colMeans, colnames, 24 colSums, do.call, duplicated, eval, evalq, Filter, Find, get, grep, 25 grepl, intersect, is.unsorted, lapply, lengths, Map, mapply, match, 26 mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, 27 rbind, Reduce, rowMeans, rownames, rowSums, sapply, setdiff, sort, 28 table, tapply, union, unique, unsplit, which, which.max, which.min 29 30 Loading required package: S4Vectors 31 Loading required package: stats4 32 33 Attaching package: ‘S4Vectors’ 34 35 The following object is masked from ‘package:base’: 36 37 expand.grid 38 39 Loading required package: geneplotter 40 Loading required package: Biobase 41 Welcome to Bioconductor 42 43 Vignettes contain introductory material; view with 44 'browseVignettes()'. To cite Bioconductor, see 45 'citation("Biobase")', and for packages 'citation("pkgname")'. 46 47 Loading required package: lattice 48 Loading required package: annotate 49 Loading required package: AnnotationDbi 50 Loading required package: XML 51 Loading tumour file:tumor 52 Slurping: results/readDepth/BB1269.bin1000000.wig 53 Parsing: fixedStep chrom=1 start=1 step=1000000 span=1000000 54 Parsing: fixedStep chrom=2 start=1 step=1000000 span=1000000 55 Parsing: fixedStep chrom=3 start=1 step=1000000 span=1000000 56 Parsing: fixedStep chrom=4 start=1 step=1000000 span=1000000 57 Parsing: fixedStep chrom=5 start=1 step=1000000 span=1000000 58 Parsing: fixedStep chrom=6 start=1 step=1000000 span=1000000 59 Parsing: fixedStep chrom=7 start=1 step=1000000 span=1000000 60 Parsing: fixedStep chrom=8 start=1 step=1000000 span=1000000 61 Parsing: fixedStep chrom=9 start=1 step=1000000 span=1000000 62 Parsing: fixedStep chrom=10 start=1 step=1000000 span=1000000 63 Parsing: fixedStep chrom=11 start=1 step=1000000 span=1000000 64 Parsing: fixedStep chrom=12 start=1 step=1000000 span=1000000 65 Parsing: fixedStep chrom=13 start=1 step=1000000 span=1000000 66 Parsing: fixedStep chrom=14 start=1 step=1000000 span=1000000 67 Parsing: fixedStep chrom=15 start=1 step=1000000 span=1000000 68 Parsing: fixedStep chrom=16 start=1 step=1000000 span=1000000 69 Parsing: fixedStep chrom=17 start=1 step=1000000 span=1000000 70 Parsing: fixedStep chrom=18 start=1 step=1000000 span=1000000 71 Parsing: fixedStep chrom=19 start=1 step=1000000 span=1000000 24 Parsing: fixedStep chrom=20 start=1 step=1000000 span=1000000 23 Parsing: fixedStep chrom=21 start=1 step=1000000 span=1000000 22 Parsing: fixedStep chrom=22 start=1 step=1000000 span=1000000 21 Parsing: fixedStep chrom=X start=1 step=1000000 span=1000000 20 Parsing: fixedStep chrom=Y start=1 step=1000000 span=1000000 19 Sorting by decreasing chromosome size 18 Correcting Tumour 17 Removed 97 bins near centromeres. 16 Applying filter on data... 15 Correcting for GC bias... 14 Correcting for mappability bias... 13 Filtering low uniqueness regions with mappability score < 0.9 12 Removed 4 bins near centromeres. 11 Determining gender...Gender male 10 Outputting to: results/ichorCNA/BB1269//tumor.correctedDepth.txt 9 Warning message: 8 In dir.create(paste0(outDir, "/", id, "/"), recursive = TRUE) : 7 'results/ichorCNA/BB1269//tumor' already exists 6 runEM: Initialization 5 runEM iter1: Expectation 4 runEM iter1: Maximization 3 Error in optim(n_prev, fn = completeLikelihoodFun, pType = rep("n", S), : 2 L-BFGS-B needs finite values of 'fn' 1 Calls: HMMsegment -> runEM -> estimateParamsMap 0 Execution halted