3
$\begingroup$

Using the PUG service from NCBI, I am retrieving 3d structure data for a molecule.

Raw data here.

I am trying to understand this record, specifically for the purpose of rendering in a 3D coordinate system using threejs.

Could anyone please assist in understanding this information. Due to the large size of the json response and as I am using javascript, I have constructed some Typescript types that describe the shape of the data to assist the discussion. I have specific questions, which are stated below.

//// Root Object
interface JSON_Response {
    PC_Compounds: PC_Compound[];
}

//// Compound Object
// must stand for PubChem Compound
interface PC_Compound {
    id: ID;
    atoms: {
        aid: number[];
        element: number[];
    };
    bonds: {
        aid1: number[];
        aid2: number[];
        order: number[];
    };
    stereo: Stereo[];
    coords: Coords[];
    props: Data[];
    count: Count;
}

//////// Sub-types described below

Atoms

The atoms object has two arrays; 'aid' and 'element'.In the above JSON response, these arrays are both of length 13. The data for L-Alanine shows it has 13 atoms. I am correct in saying that the numbers in the 'element' array are corresponding to Atomic Numbers? And these atomic numbers are assigned to ids from the corresponding indexes in the 'id' array?

Bonds

What are aid1, aid2, and order? These arrays are 12 entries each so each must represent 1 bond between two atoms. But what do the number values correspond to? How should they be interpretted?

Coords

In the coordinates object,

interface Coords {
    type: number[];
    aid: number[];
    conformers: [
        {
        x: number[];
        y: number[];
        z: number[];
        data: Data[];
        }
    ];
    data: Data[];
}

The x, y, & z arrays are of length 13. Am I correct in saying that these represent the x, y, and z coordinates of atoms in the corresponding index of the above elements array?

Data

Data Object seems to be part of a esoteric system for attaching arbitrary data to the object. If anyone has any pointer on this it would be greatly appreciated.

interface Data {
    urn: {
        label: string;
        name: string;
        datatype: number;
        release: string;
        version?: string;
        software?: string;
        source?: string;
        parameters?: string;
    };
    value: {
        sval?: string;
        fval?: number;
        slist?: string[];
        fvec?: number[];
        ivec?: number[];
    };
}

stereo

seems to describe planes of rotation

//// Compound sub-types
interface Stereo {
    tetrahedral: {
        center: number;
        above: number;
        top: number;
        bottom: number;
        below: number;
        parity: number;
        type: number;
    };
}


interface ID {
    id: {
        cid: number;
    };
}

miscellaneous chemical information

interface Count {
    heavy_atom: number;
    atom_chiral: number;
    atom_chiral_def: number;
    atom_chiral_undef: number;
    bond_chiral: number;
    bond_chiral_def: number;
    bond_chiral_undef: number;
    isotope_atom: number;
    covalent_unit: number;
    tautomers: number;
}

In addition, if anyone has any techniques or advice on how to extract meaning from the response data from PubChem, if they could please post below it could come in handy for me or some other person working on this.

$\endgroup$
6
$\begingroup$

The PubChem format description is not that easy to find: https://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/asn_spec/pcsubstance.asn.html

And the ASN file linked here: https://pubchemdocs.ncbi.nlm.nih.gov/data-specification

I am correct in saying that the numbers in the 'element' array are corresponding to Atomic Numbers?

Yes, 1 is hydrogen, 6 is carbon, 8 is oxygen, etc.

And these atomic numbers are assigned to ids from the corresponding indexes in the 'id' array?

in your example, "atoms": {"aid": [1, 2, 3, ..., 13], "element": [8, 8, 7, ..., 1]},, the the ID of the first atom would be 1 and element 8 (oxygen), the third atom: ID 3 and element 7 (nitrogen).

Am I correct in saying that these represent the x, y, and z coordinates of atoms in the corresponding index of the above elements array?

Yes

What are aid1, aid2, and order?

aid1 and aid2 are the atom identifiers. order is the bond type.

These arrays are 12 entries each so each must represent 1 bond between two atoms. But what do the number values correspond to? How should they be interpretted?

For example aid1 = [1, 2], aid2 = [3, 4], order = [1, 2] would mean a single bond between atom 1 and atom 3 and a double bond between atom 2 and atom 4.

Good examples of implementations:

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.