Description Usage Arguments Value Examples
Get alternative allele count for positions of interest
1 | getAlleleCount(gr, bamFile, indexFile, verbose = FALSE)
|
gr |
GenomicRanges object for positions of interest |
bamFile |
bam file |
indexFile |
bai index file |
verbose |
Boolean of whether or not to print progress and info |
refCount reference allele count information for each position of interest altCount alternative allele count information for each position of interest
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# Sites of interest (chr1:4600000, chr2:2000)
gr <- GRanges(c('chr1', 'chr2'), IRanges(start=c(4600000, 2000), width=1))
# we can get the coverage at these SNP sites from our bams
path <- '../data-raw/bams/'
files <- list.files(path = path)
files <- files[grepl('.bam$', files)]
alleleCounts <- lapply(files, function(f) {
bamFile <- paste0(path, f)
indexFile <- paste0(path, paste0(f, '.bai'))
getAlleleCount(gr, bamFile, indexFile)
})
altCounts <- do.call(cbind, lapply(1:length(gr), function(i) alleleCounts[[i]][[1]]))
refCounts <- do.call(cbind, lapply(1:length(gr), function(i) alleleCounts[[i]][[2]]))
colnames(altCounts) <- colnames(refCounts) <- files
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.