| validate,BamFile-method {easyRNASeq} | R Documentation |
Describes extensions to the Rsamtools package.
For BamFile and
BamFileList objects:
validate validates a BamFile or
BamFileList object.
## S4 method for signature 'BamFile' validate(obj, header = TRUE, cross.validation = TRUE)
obj |
An object of the |
header |
a boolean to (de)activate the check for a BAM header |
cross.validation |
a boolean - only valid for
|
validate checks whether the BAM file exists and if a BAI index is present.
validate returns invisibly a vector of boolean.
Fails anyway if any file is missing.
Nicolas Delhomme
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)