Skip to content

Inchis of single atoms read from xyz files different than those generated by openbable. #6

@dln22

Description

@dln22

I am trying to use your tool to generate inchi strings. This is my way around of installing the obenbabel. Here is the script I wrote:

with cgr.files.XYZRead(file='h.xyz') as f:
    xyz = f.read()
xyz = xyz[0]
rdkitMol = cgr_utils.to_rdkit_molecule(data =xyz)
inchi = rdkit.Chem.inchi.MolToInchi(rdkitMol)

As you can see I go from the cgr molecule object into rdkit mol and then do the conversion to inchi. The problem is that for, e.g. a single hydrogen atom xyz file:

1

H 0.0 0.0 0.0

the produced inchi is as follows: InChI=1S/H/q-1 where it should rather be InChI=1S/H
I also noticed that in the MoleculeContainer for atomic hydrogen, the molecular_charge property was set to -1. Should not it rather be 0?

Similarly for the following xyz input:

1

F 0.0 0.0 0.0

the corresponding inchi is: InChI=1S/FH/h1H/p-1 as compared to InChI=1S/F
Similarly to hydrogen example, the molecular_charge property is also -1.

I wonder if there are any settings I could try while parsing the xyz files or converting to the rdkit mol object so that the resulting molecules would produce the expected inchi strings.

Just to say that for all larger molecules I have converted with my script the produced inchis were identical to those from openbabel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions