getSampleDepths {chromVAR} | R Documentation

## getSampleDepths

### Description

makes vector of read depths in bam files or RG groups within bam files

### Usage

    getSampleDepths(alignment_files, paired = TRUE, by_rg = FALSE,
      format = c("bam", "bed"))

### Arguments

`alignment_files` | filenames for bam or bed file(s) with aligned reads
`paired` | paired end data?
`by_rg` | use RG tags to separate groups?
`format` | bam or bed format? default is bam

### Value

numeric vector

### See Also

`getCounts`, `filterSamples`

### Examples

    # With single bam with RG tags (can also give multiple bams with RG)
    test_rg <- system.file("extdata", "test_RG.bam", package = "chromVAR")
    test_counts <- getSampleDepths(test_rg,  by_rg = TRUE,
                              paired = TRUE)

    # Multiple bams without RG tags
    test_bam1 <- system.file("extdata", "test_single1.bam", package = "chromVAR")
    test_bam2 <- system.file("extdata", "test_single2.bam", package = "chromVAR")
    test_bam3 <- system.file("extdata", "test_single3.bam", package = "chromVAR")
    test_counts2 <- getSampleDepths(c(test_bam1, test_bam2,test_bam3),
                               by_rg = FALSE,
                               paired = TRUE)

[Package chromVAR version 1.14.0 Index]