Description Usage Arguments Details Value Author(s) See Also Examples
Among multiple alignments of the same read (i.e. multihit), select the alignment corresponding to the bin with the maximum posterior for the enriched state.
1 | disambiguateMultihits(alignGal, nbhGRList, postprobCutoff = 0)
|
alignGal |
GAlignments object with an additional column in the |
nbhGRList |
GRangesList each item containig the HMM training results on a single chromosome. Importantly, the posterior probabilities for the background and enriched states need to be present the |
postprobCutoff |
Posterior cutoff for returning only the reads with maximum posterior that is greater than the threshold (Default: 0; i.e., no cutoff). |
Each multihit (i.e., read aligned to multiple loci) flagged in the getAlignGal
function are assigned to a unique locus corresponding to the j^th bin with the highest posterior or responsibility from the RIP state. Intuitively, the RIP state corresponds to the read-enriched loci. Disambiguating multihits in this way will potentially improve the power of detecting more RIP regions but may also introduce certain bias towards the idea of "rich gets richer". After this step, RIPSeeker will rerun the functions from selectBinSize
to nbh
to improve the HMM model estimation with augmented read count data. Optionally, user can choose not to reiterate the training process to go straight to the next step to detect RIP regions (See seekRIP
).
GAlignments with each read mapped uniquely to a single locus.
Yue Li
getAlignGal, ripSeek, mainSeek, mainSeekSingleChrom
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 27 28 29 30 31 32 33 34 35 36 37 38 | # 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
minBinSize <- NULL # turn off min bin size in automatic bin size selection
maxBinSize <- NULL # turn off max bin size in automatic bin size selection
multicore <- FALSE # use multicore
strandType <- "-" # set strand type to minus strand
# 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)
alignGal <- combineAlignGals(bamFiles=grep(pattern="SRR039214",
bamFiles, value=TRUE, invert=TRUE), reverseComplement=TRUE, genomeBuild="mm9")
alignGR <- as(alignGal, "GRanges")
alignGR <- addPseudoAlignment(alignGR)
alignGRList <- GRangesList(as.list(split(alignGR, seqnames(alignGR))))
################ run mainSeekSingleChrom function for HMM inference on a single chromosome ################
nbhGRList <- lapply(alignGRList, mainSeekSingleChrom, K = 2, binSize=binSize,
minBinSize = minBinSize, maxBinSize = maxBinSize, runViterbi=FALSE)
nbhGRList <- GRangesList(nbhGRList)
alignGalFiltered <- disambiguateMultihits(alignGal, nbhGRList)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.