getBamFileList {easyRNASeq} | R Documentation

## Get a BamFileList from a list of filenames

### Description

A utility function to create a `BamFileList-class` object from a set of filenames. The filenames need to contain the file path if they are not in the working directory.

### Usage

    ## S4 method for signature 'character,character'
    getBamFileList(filenames = character(0), indexnames = character(0))

### Arguments

`filenames` | a character vector containing fully defined BAM file filenames
`indexnames` | a character vector containing fully defined BAM index file filenames

### Value

a `BamFileList-class`

### See Also

`BamFileList-class` `dir`

### Examples

    # tutorial data - store the data in the BiocCache
    tdir <- tutorialData()

      # creating a BamFileList using a directory and pattern
      # using filenames (from the Bioc cache)
      filenames <- dir(tdir,pattern="[A,C,T,G]{6}\\.bam$",full.names=TRUE)
      indexnames <- sapply(paste0(sub(".*_","",basename(filenames)),".bai"),fetchData)
      bfl <- getBamFileList(filenames,indexnames)

      # get them recursively
      filenames <- dir(path=tdir,pattern="[A,C,T,G]{6}\\.bam$",
                       full.names=TRUE,recursive=TRUE)
      indexnames <- sapply(paste0(sub(".*_","",basename(filenames)),".bai"),fetchData)
      bfl <- getBamFileList(filenames,indexnames)

[Package easyRNASeq version 2.24.1 Index]