Learn R Programming

rbamtools (version 2.0.1)

isOpen: isOpen(bamReader), isOpen(bamWriter)

Description

Checks for open connection from bamReader (or bamWriter) to .bam file.

Usage

isOpen(con,rw="")

Arguments

con
An instance of class bamReader or bamWriter.
rw
This argument is included solely for compatibility with the function template for connections in package base. It's not evaluated internally.

Details

The function acutally checks, if the externalptr (reader or writer) slot has nil-value.

Examples

Run this code
library(rbamtools)
bam_file <- system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam_file)
isOpen(reader)
align<-getNextAlign(reader)
bamClose(reader)
isOpen(reader)

Run the code above in your browser using DataLab