Skip to content

Commit

Permalink
Remove cov cut-off before PCF
Browse files Browse the repository at this point in the history
  • Loading branch information
nansari-pour authored Aug 14, 2021
1 parent 49d40ed commit 5ac2a7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/prepare_wgs_germline.R
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ germline_reconstruct_normal = function(GERMLINENAME,NORMALNAME,chrom_coord,chrom
medcov=median(COV[,3])
cov=mean(COV[,3])
denSNP=nrow(COV)/(nSNPs/sum(chr_loc$length)*seg_ivd$Position_dist[j])
if (!is.na(cov) & cov < -0.8 & medcov < -0.8 & !is.null(denSNP) & denSNP>0.5){ # to use a minimum SNP density of 0.5 to get logR estimate
#if (!is.na(cov) & cov < -0.8 & medcov < -0.8 & !is.null(denSNP) & denSNP>0.5){ # to use a minimum SNP density of 0.5 to get logR estimate
if (!is.na(cov) & !is.null(denSNP) & denSNP>0.5){ # to use a minimum SNP density of 0.5 to get logR estimate AND not put the cov cut-off before applying PCF
#loh=data.frame(start=start,end=end,LogR=cov,medianLogR=medcov,denSNP=denSNP)
jpcf=pcf(COV,gamma=GAMMA_LOGR,verbose = F)
jpcf=jpcf[which(jpcf$mean < -0.8),]
Expand Down Expand Up @@ -420,7 +421,8 @@ germline_reconstruct_normal = function(GERMLINENAME,NORMALNAME,chrom_coord,chrom
cov=mean(COV[,3])
medcov=median(COV[,3])
denSNP=nrow(COV)/(nSNPs/sum(chr_loc$length)*seg_ivd$Position_dist[j])
if (!is.na(cov) & cov < -0.8 & medcov < -0.8 & !is.null(denSNP) & denSNP>0.5){ # to use a minimum SNP density of 0.5 to get logR estimate #glcode
#if (!is.na(cov) & cov < -0.8 & medcov < -0.8 & !is.null(denSNP) & denSNP>0.5){ # to use a minimum SNP density of 0.5 to get logR estimate
if (!is.na(cov) & !is.null(denSNP) & denSNP>0.5){ # to use a minimum SNP density of 0.5 to get logR estimate AND not put the cov cut-off before applying PCF
#loh=data.frame(start=start,end=end,LogR=cov,medianLogR=medcov,denSNP=denSNP)
jpcf=pcf(COV,gamma=GAMMA_LOGR,verbose = F)
jpcf=jpcf[which(jpcf$mean < -0.8),]
Expand Down

0 comments on commit 5ac2a7c

Please sign in to comment.