From 6310a524d9a3c97b78e75dad674559c8de1776a6 Mon Sep 17 00:00:00 2001 From: fromer Date: Thu, 16 Dec 2010 17:20:25 +0000 Subject: [PATCH] Do not abort integration (over het-het distances) on errors, but warn about them git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4855 348d0f76-0448-11de-a6fe-93d51630548a --- R/phasing/RBP_theoretical.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/phasing/RBP_theoretical.R b/R/phasing/RBP_theoretical.R index 8b9e65fa5..2e19c891d 100644 --- a/R/phasing/RBP_theoretical.R +++ b/R/phasing/RBP_theoretical.R @@ -141,7 +141,11 @@ pDirectlyPhaseHetPair <- function(meanDepth, nReadsToPhase, L, theta, Fm, Fs) { MIN_DISTANCE = 0 MAX_DISTANCE = Inf - integrate(function(k) pDirectlyPhaseHetPairAndDistanceUsingDepth(meanDepth, nReadsToPhase, L, k, theta, Fm, Fs), lower=MIN_DISTANCE, upper=MAX_DISTANCE, subdivisions=1000)$value + iRes = integrate(function(k) pDirectlyPhaseHetPairAndDistanceUsingDepth(meanDepth, nReadsToPhase, L, k, theta, Fm, Fs), lower=MIN_DISTANCE, upper=MAX_DISTANCE, subdivisions=1000, stop.on.error = FALSE) + if (iRes$message != "OK") { + print(paste("DISTANCE INTEGRATION WARNING: ", iRes$message, sep="")) + } + iRes$value } # Probability (over locations of sites on reads, fragment sizes, and read depths) that paired-end reads can TRANSITIVELY phase phaseIndex relative to phaseIndex - 1, given a window of length(windowDistances)+1 het sites at distances given by windowDistances (where an edge in the transitive path requires at least nReadsToPhase reads):