Spec
BgzfStreamReading and writing of BGZF data.
Reading and writing of BGZF data.
Extends | Stream |
---|---|
All Extended | Stream |
All Impl'd | StreamConcept |
Defined in | <seqan/stream.h> |
Signature |
template <>
class Stream<Bgzf>;
|
Interface Function Overview
-
void attachToFile(stream, fileHandle, mode);
Attach to already open input/output POSIX file. -
bool checkEofIsValid(stream);
Check that the EOF marker is present in BGZF (e.g. BAM) file. -
bool open(stream, fileName, mode);
Open a stream.
Interface Functions Inherited From Stream
Interface Functions Inherited From StreamConcept
Interface Metafunction Overview
Interface Metafunctions Inherited From StreamConcept
Detailed Description
Remarks
Not copy constructable, not assignable.
BGZF is the Block GZip Format which is used as the underlying format for BAM and TABIX. Data is written out compressed with gzip but the uncompressed data is split into blocks with a maximum block size. It is therefore possible to jump to beginnings of blocks in the resulting files, decompress the block and then jump into the block itself.
Examples
Stream<Bgzf> stream; if (!open(stream, "myfile.bam", "r")) return 1; // error // ... work
Interface Functions Detail
void attachToFile(stream, fileHandle, mode);
Attach to already open input/output POSIX file.
Parameters
stream
|
Stream to attach to file. Types: BGZF Stream |
---|---|
fileHandle
|
The file handle to attach to. Type: int |
mode
|
The mode flag the file was opened with. Type: int |
Remarks
A previously opened file is closed.
bool checkEofIsValid(stream);
Check that the EOF marker is present in BGZF (e.g. BAM) file.
Parameters
stream
|
The BgzfStream to check. |
---|
Returns
bool |
true if the marker is present and false otherwise. |
---|
bool open(stream, fileName, mode);
Open a stream.
Parameters
stream
|
The stream to open. |
---|---|
fileName
|
The path to the file to open. Type: char const *. |
mode
|
The mode for opening. |
Returns
bool |
true on success, false on failure. |
---|
Remarks
You can append 0-9 or u or w in mode. for setting the compression level to 0-9 or "no compression".