validate,BamFile-method {easyRNASeq}R Documentation

Extension of the Rsamtools package

Description

Describes extensions to the Rsamtools package.

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

Examples

library(curl)
 invisible(sapply(c("ACACTG","ACTAGC"),function(bam){
     curl_download(paste0("https://github.com/UPSCb/UPSCb/raw/",
                          "master/tutorial/easyRNASeq/",bam,".bam"),paste0(bam,".bam"))
     curl_download(paste0("https://github.com/UPSCb/UPSCb/raw/",
                          "master/tutorial/easyRNASeq/",bam,".bam.bai"),paste0(bam,".bam.bai"))
 }))

filenames <- dir(".",pattern="[A,C,T,G]{6}\\.bam$",full.names=TRUE)

bfl <-BamFileList(filenames,index=filenames)

validate(bfl)


[Package easyRNASeq version 2.16.0 Index]