getbambed {CODEX} | R Documentation |
Gets bam file directories, sample names from .txt file, and exonic positions from .bed file.
getbambed(bamdir,bedFile,sampname,projectname,chr)
bamdir |
Column vector. Each line specifies directory of a bam file. Should be in same order as sample names in sampname. |
bedFile |
Path to bed file specifying exonic targets. Is of type character. |
sampname |
Column vector. Each line specifies name of a sample corresponding to the bam file. Should be in same order as bam directories in bamdir. |
projectname |
String specifying the name of the project. Data will be saved using this as prefix. |
chr |
Chromosome. |
bamdir |
Bam directories |
sampname |
Sample names |
ref |
IRanges object specifying exonic positions |
projectname |
String specifying the name of the project. |
chr |
Chromosome |
Yuchao Jiang yuchaoj@wharton.upenn.edu
Lawrence M, Huber W, Pages H, Aboyoun P, Carlson M, Gentleman R, Morgan M and Carey V (2013). "Software for Computing and Annotating Genomic Ranges." PLoS Computational Biology, 9.
library(WES.1KG.WUGSC) dirPath <- system.file("extdata", package = "WES.1KG.WUGSC") bamFile <- list.files(dirPath, pattern = '*.bam$') bamdir <- file.path(dirPath, bamFile) sampnameFile <- file.path(dirPath, "sampname") sampname <- as.matrix(read.table(sampnameFile)) chr <- 22 bambedObj <- getbambed(bamdir = bamdir, bedFile = file.path(dirPath, "chr22_400_to_500.bed"), sampname = sampname, projectname = "CODEX_demo", chr) bamdir <- bambedObj$bamdir sampname <- bambedObj$sampname ref <- bambedObj$ref projectname <- bambedObj$projectname chr <- bambedObj$chr