Repository navigation
cpp11bigwig 0.3.0
-
Fix a CRAN
gcc-san(UBSan)load of misaligned addressruntime error when
reading a bigBed block that packs more than one record. In libBigWig's
bwValues.c, records are stored as threeuint32_tfields followed by a
variable-length name, so every record after the first starts on an
unaligned offset; the fields are now read withmemcpyinstead of an
aligneduint32_tcast. -
Multi-range queries now open the file once per call instead of re-opening it
for every range. The per-range loop moved into C++, so a query of many ranges
(and especially a remote file, where each open re-fetches headers) is
substantially faster. -
read_bigbed()no longer crashes on a bigBed file with no embedded autoSql
schema.bbGetSQL()returnsNULLin that case, and constructing a
std::stringfrom it was undefined behavior; such files now read back their
chrom/start/endcolumns with no extra typed fields. -
The bigWig/bigBed readers now release the libBigWig file handle and read
buffer when they error out (e.g. on an unreadable file or a failed interval
query), rather than leaking them. -
Fix a CRAN
gcc-ASANglobal-buffer-overflow reported when reading bigBed
files. The autoSql schema parser no longer usesstd::regex(which tripped
an AddressSanitizer error inside libstdc++); it now parses the schema with
simple string operations. -
read_bigwig()andread_bigbed()can now query multiple ranges in a single
call. Pass equal-length (or length-1, recycled)chrom,start, andend
vectors, or aGRangesof regions viachrom. Forread_bigwig(as = "Rle"),
a multi-range query returns a namedRleListwith one element per range
(#18).