validate,BamFile-method {easyRNASeq} | R Documentation

## Extension of the Rsamtools package

### Description

Describes extensions to the Rsamtools package.

- For `BamFile` and `BamFileList` objects:

  - `validate` validates a `BamFile` or `BamFileList` object.

### Usage

    ## S4 method for signature 'BamFile'
    validate(obj, header = TRUE, cross.validation = TRUE)

### Arguments

`obj` | An object of the `BamFile` or `BamFileList` class
`header` | a boolean to (de)activate the check for a BAM header
`cross.validation` | a boolean - only valid for `BamFileList` objects - to (de)activate the cross validation of all the BAM files header

### Details

`validate` checks whether the BAM file exists and if a BAI index is present.

### Value

`validate` returns invisibly a vector of boolean. Fails anyway if any file is missing.

### Author(s)

Nicolas Delhomme

### See Also

- `BamFile`

- `BamFileList`

### Examples

    # retrieve the data
    tdir <- tutorialData()

    # get the bam file path from the Bioc cache
    filenames <- dir(tdir,pattern="[A,C,T,G]{6}\\.bam$",full.names=TRUE)

    # retrieve the index from the Bioc cache too
    inxnames <- sapply(paste0(sub(".*_","",basename(filenames)),".bai"),fetchData)

    bfl <-BamFileList(filenames,index=inxnames)

    validate(bfl)

[Package easyRNASeq version 2.30.0 Index]