logScoreWithoutControl: Compute RIPScore based on RIP posteriors alone and test for...

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Compute the RIPScore using only the RIP (typically when control is unavailable) posteriors for each bins, merge and summarize the scores for the merged bins, and finally compute the p-value and adjusted p-value for the summary RIPScore.

Usage

1
logScoreWithoutControl(nbhGRRIP, padjMethod = "BH")

Arguments

nbhGRRIP

GRanges object for the RIP library created from mainSeek containing the posteriors probabilities of the hidden states for each observed read count.

padjMethod

Method used to adjust multiple testing performed in p.adjust (Default: "BH").

Details

The RIPScore is compupted in computeLogOdd as the log odd ratio of the posterior for the RIP state (z_{i} = 2) over the posterior for the background state (z_{i} = 1) in RIP library alone (typically when control is unavailable). The adjacent bins with hidden states predicted by nbh_vit as the enriched state (corresponding to the NB with larger mean) are merged. The RIPSscores are averaged over the merged bins. To assess the statistical significance of the RIPScore for each region, we assume that the RIPScore follows a Gaussian (Normal) distribution with mean and standard deviation estimated using the RIPScores over all of the bins. The rationale is based on the assumption that most of the RIPScores correspond to the background state and together contribute to a stable estimate of the test statistics (TS) and p-value computed using the R built-in function pnorm. The p-value is adjusted by p.adjust with BH method by default.

Value

GRanges of merged bins with values slot saved for RIPScore (lodOdd), p-value (pval), adjusted p-value (pvalAdj) for RIP

Note

Internal function used by seekRIP.

Author(s)

Yue Li

See Also

logScoreWithControl, seekRIP, computeLogOdd, scoreMergedBins

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if(interactive()) { # check the example in seekRIP
# Retrieve system files
extdata.dir <- system.file("extdata", package="RIPSeeker") 

bamFiles <- list.files(extdata.dir, ".bam$", recursive=TRUE, full.names=TRUE)

bamFiles <- grep("PRC2", bamFiles, value=TRUE)

# Parameters setting
binSize <- 1e5					# use a large fixed bin size for demo only
multicore <- FALSE			# use multicore
strandType <- "-"				# set strand type to minus strand

################ run main function for HMM inference on all chromosomes ################
mainSeekOutputRIP <- mainSeek(bamFiles=grep(pattern="SRR039214", 
    bamFiles, value=TRUE, invert=TRUE),
		binSize=binSize, strandType=strandType, 		
		reverseComplement=TRUE, genomeBuild="mm9",
		uniqueHit = TRUE, assignMultihits = TRUE, 
		rerunWithDisambiguatedMultihits = FALSE,				
		multicore=multicore, silentMain=FALSE, verbose=TRUE)
		
    
################ Compute log score and test for significance WITHOUT control ################
ripGR.wocontrol <- logScoreWithoutControl(mainSeekOutputRIP$nbhGRList$chrX)
}

gorillayue/RIPSeeker documentation built on May 17, 2019, 7:59 a.m.