getbambed: Get bam file directories, sample names, and exonic positions

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/getbambed.R

Description

Gets bam file directories, sample names from .txt file, and exonic positions from .bed file.

Usage

1
getbambed(bamdir,bedFile,sampname,projectname,chr)

Arguments

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.

Value

bamdir

Bam directories

sampname

Sample names

ref

IRanges object specifying exonic positions

projectname

String specifying the name of the project.

chr

Chromosome

Author(s)

Yuchao Jiang yuchaoj@wharton.upenn.edu

References

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.

See Also

getcoverage

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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

CODEX documentation built on Nov. 8, 2020, 8:22 p.m.