View source: R/getMappableRegions.R
getMappableRegions | R Documentation |
Given a k-mer length and the maximum number of allowed hits per k-mer, find all mappable regions in a genome.
getMappableRegions(
genome,
genomeIndex,
kmerLength = 50,
maxHits = 1,
Ncpu = 2,
quiet = TRUE
)
genome |
The genome sequence to work on. Either a |
genomeIndex |
|
kmerLength |
|
maxHits |
|
Ncpu |
|
quiet |
|
Sequences of all overlapping windows are extracted from the genome
and aligned to the provided genome index using bowtie
with parameters -f -v 0 -a -B 1 -m maxHits
. If no more
than maxHits
hits are found, the window is defined mappable.
A GRanges
object with mappable regions.
All plus-strand sequences in genome
of length kmerLength
with their start (leftmost) position overlapping the GRanges
object
do not generate more than maxHits
hits when aligned to the genome.
Michael Stadler
bowtie
in package Rbowtie used by
getMappableRegions
to align reads to the genome;
bowtie_build
in package Rbowtie for
indexing a genome.
if (requireNamespace("Rbowtie", quietly = TRUE)) {
library(Rbowtie)
genomefile <- system.file("extdata", "getMappableRegions", "hg19sub.fa", package = "swissknife")
indexdir <- tempfile()
indexpre <- "index"
indexname <- file.path(indexdir, indexpre)
idx <- bowtie_build(genomefile, indexdir)
mapgr <- getMappableRegions(genomefile, indexname, 50, quiet = FALSE)
print(mapgr)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.