moleculekit.pdbx.reader.BinaryCifReader module#
- class moleculekit.pdbx.reader.BinaryCifReader.BinaryCifDecoders(storeStringsAsBytes=False, defaultStringEncoding='utf-8', verbose=False)#
Bases:
object
Column oriented Binary CIF decoders implementing StringArray, ByteArray, IntegerPacking, Delta, RunLength, FixedPoint, and IntervalQuantization from the BinaryCIF specification described in:
Sehnal D, Bittrich S, Velankar S, Koca J, Svobodova R, Burley SK, Rose AS. BinaryCIF and CIFTools-Lightweight, efficient and extensible macromolecular data management. PLoS Comput Biol. 2020 Oct 19;16(10):e1008247. doi: 10.1371/journal.pcbi.1008247. PMID: 33075050; PMCID: PMC7595629.
and in the specification at molstar/BinaryCIF
and from the I/HM Python implementation at ihmwg/python-ihm[summary]
- bCifCodeTypeD = {1: 'integer_8', 2: 'integer_16', 3: 'integer_32', 4: 'unsigned_integer_8', 5: 'unsigned_integer_16', 6: 'unsigned_integer_32', 32: 'float_32', 33: 'float_64'}#
Binary CIF protocol internal data type codes to integer and float types
- bCifTypeD = {'float_32': {'max': 3.402823466e+38, 'min': 1.175494351e-38, 'struct_format_code': 'f'}, 'float_64': {'max': 1.7976931348623157e+308, 'min': 2.2250738585072014e-308, 'struct_format_code': 'd'}, 'integer_16': {'max': 32767, 'min': -32768, 'struct_format_code': 'h'}, 'integer_32': {'max': 2147483647, 'min': -2147483648, 'struct_format_code': 'i'}, 'integer_8': {'max': 127, 'min': -128, 'struct_format_code': 'b'}, 'unsigned_integer_16': {'max': 65535, 'min': 0, 'struct_format_code': 'H'}, 'unsigned_integer_32': {'max': 4294967295, 'min': 0, 'struct_format_code': 'I'}, 'unsigned_integer_8': {'max': 255, 'min': 0, 'struct_format_code': 'B'}}#
Binary CIF data type feature dictionary
- byteArrayDecoder(colDataList, encodingDict)#
Decode input byte list into a list of integers/floats
- Parameters:
colDataList (list) – column of data to be decoded
encodingDict (dict) – dictionary of binary CIF encoding details elements described in the specification at molstar/BinaryCIF
- Yields:
list – decoded list of integer/float data
- decode(colDataList, encodingDictList)#
Return the decoded input data column using the input list of encodings
- Parameters:
colDataList (list) – column of data to be decoded
encodingDictList (list) – list of dictionary holding binary CIF encoding details elements described in the specification at molstar/BinaryCIF
- Yields:
list – decoded list of column data
- deltaDecoder(colDataList, encodingDict)#
Decode an integer list stored as a list of consecutive differences.
- Parameters:
colDataList (list) – column of data to be decoded
encodingDict (dict) – dictionary of binary CIF encoding details elements described in the specification at molstar/BinaryCIF
- Yields:
list – decoded list of integer data
- fixedPointDecoder(colDataList, encodingDict)#
Decode a floating point list stored as integers and a multiplicative factor.
- Parameters:
colDataList (list) – column of data to be decoded
encodingDict (dict) – dictionary of binary CIF encoding details elements described in the specification at molstar/BinaryCIF
- Yields:
list – decoded list of float data
- integerPackingDecoder(colDataList, encodingDict)#
Decode a (32-bit) integer list packed into 8- or 16-bit values.
- Parameters:
colDataList (list) – column of data to be decoded
encodingDict (dict) – dictionary of binary CIF encoding details elements described in the specification at molstar/BinaryCIF
- Yields:
list – decoded list of integer data
- intervalQuantizationDecoder(colDataList, encodingDict)#
Decode a list of 32-bit integers quantized within a given interval into a list of floats.
- Parameters:
colDataList (list) – column of data to be decoded
encodingDict (dict) – dictionary of binary CIF encoding details elements described in the specification at molstar/BinaryCIF
- Yields:
list – decoded list of float data
- runLengthDecoder(colDataList, encodingDict)#
Decode an integer list stored as pairs of (value, number of repeats).
- Parameters:
colDataList (list) – column of data to be decoded
encodingDict (dict) – dictionary of binary CIF encoding details elements described in the specification at molstar/BinaryCIF
- Yields:
list – decoded list of integer data
- stringArrayDecoder(colDataList, encodingDict)#
Decode an array of strings stored as a concatenation of all unique strings, a list of offsets to construct the unique substrings, and indices into the offset array.
- Parameters:
colDataList (list) – column of data to be decoded
encodingDict (dict) – dictionary of binary CIF encoding details elements described in the specification at molstar/BinaryCIF
- Yields:
list – decoded list of string data