Module: MMTF

MMTF module.

Members


<static> fetchReducedUrl :String

URL of the RCSB webservice to obtain reduced MMTF files
Type:
  • String

<static> fetchUrl :String

URL of the RCSB webservice to obtain MMTF files
Type:
  • String

<static> version :String

Version name
Type:
  • String

Methods


<static> decode(binOrDict, params)

Decode MMTF fields
Parameters:
Name Type Argument Description
binOrDict Uint8Array | ArrayBuffer | module:MmtfDecode.EncodedMmtfData binary MessagePack or encoded MMTF data
params Object <optional>
decoding parameters
Properties
Name Type Description
ignoreFields Array.<String> names of optional fields not to decode
Returns:
mmtfData
Type
module:MmtfDecode.MmtfData
Example
// bin is Uint8Array containing the mmtf msgpack
var mmtfData = MMTF.decode( bin );
console.log( mmtfData.numAtoms );

<static> encode(mmtfData)

Encode MMTF fields
Parameters:
Name Type Description
mmtfData module:MmtfDecode.MmtfData mmtf data
Returns:
encoded MMTF fields
Type
Uint8Array

<static> fetch(pdbid, onLoad, onError)

Fetch MMTF file from RCSB webservice which contains
Parameters:
Name Type Description
pdbid String PDB ID to fetch
onLoad module:MMTF.onLoad callback( mmtfData )
onError function callback( error )
Returns:
Type
undefined
Example
MMTF.fetch(
    "3PQR",
    // onLoad callback
    function( mmtfData ){ console.log( mmtfData ) },
    // onError callback
    function( error ){ console.error( error ) }
);

<static> fetchReduced(pdbid, onLoad, onError)

Fetch reduced MMTF file from RCSB webservice which contains protein C-alpha, nucleotide phosphate and ligand atoms
Parameters:
Name Type Description
pdbid String PDB ID to fetch
onLoad module:MMTF.onLoad callback( mmtfData )
onError function callback( error )
Returns:
Type
undefined
Example
MMTF.fetchReduced(
    "3PQR",
    // onLoad callback
    function( mmtfData ){ console.log( mmtfData ) },
    // onError callback
    function( error ){ console.error( error ) }
);

<static> traverse(mmtfData, eventCallbacks, params)

Traverse the MMTF structure data.
Parameters:
Name Type Argument Description
mmtfData module:MmtfDecode.MmtfData decoded mmtf data
eventCallbacks Object
Properties
Name Type Argument Description
onModel module:MmtfTraverse.onModel <optional>
called for each model
onChain module:MmtfTraverse.onChain <optional>
called for each chain
onGroup module:MmtfTraverse.onGroup <optional>
called for each group
onAtom module:MmtfTraverse.onAtom <optional>
called for each atom
onBond module:MmtfTraverse.onBond <optional>
called for each bond
params Object <optional>
traversal parameters
Properties
Name Type Argument Description
firstModelOnly Boolean <optional>
traverse only the first model
Example
// `bin` is an Uint8Array containing the MMTF MessagePack
var mmtfData = MMTF.decode( bin );

// create event callback functions
var eventCallbacks = {
    onModel: function( modelData ){ console.log( modelData ) },
    onChain: function( chainData ){ console.log( chainData ) },
    onGroup: function( groupData ){ console.log( groupData ) },
    onAtom: function( atomData ){ console.log( atomData ) },
    onBond: function( bondData ){ console.log( bondData ) }
};

// traverse the structure and lsiten to the events
MMTF.traverse( mmtfData, eventCallbacks );

Type Definitions


onLoad(mmtfData)

Parameters:
Name Type Description
mmtfData module:MmtfDecode.MmtfData decoded mmtf data object