From b1f0df00473b5d073bc1406c597845177e0d85d2 Mon Sep 17 00:00:00 2001 From: fromer Date: Thu, 16 Dec 2010 02:19:55 +0000 Subject: [PATCH] Handle case where read lengths are longer than fragment size git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4852 348d0f76-0448-11de-a6fe-93d51630548a --- R/phasing/RBP_theoretical.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/phasing/RBP_theoretical.R b/R/phasing/RBP_theoretical.R index 250f44d33..8b9e65fa5 100644 --- a/R/phasing/RBP_theoretical.R +++ b/R/phasing/RBP_theoretical.R @@ -69,8 +69,11 @@ pPairedEndReadsOfSpecificFragmentCanCoverHetPairAtDistance <- function(L, F, k) stop("Cannot have fragments of size < 1") } + # if F < L, then set the effective read length to be F: + L = pmin(L, F) + i = F - 2 * L - #print(paste("pPairedEndReadsOfSpecificFragmentCanCoverHetPairAtDistance(L= ", L, ", F= (", paste(F, collapse=", "), "), k= (", paste(k, collapse=", "), ")), i= (", paste(i, collapse=", "), ")", sep="")) + #print(paste("pPairedEndReadsOfSpecificFragmentCanCoverHetPairAtDistance(L= (", paste(L, collapse=", "), "), F= (", paste(F, collapse=", "), "), k= (", paste(k, collapse=", "), ")), i= (", paste(i, collapse=", "), ")", sep="")) # If i < 0, then ASSUMING that overlapping region is identical, we can "pretend" to have 2 reads of length L and L+i, with no insert between them. # Otherwise, leave i alone and L1 = L2 = L: