Giter Site home page Giter Site logo

cimm-kzn / cgrtools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from python3pkg/cgrtools

43.0 43.0 16.0 3.63 MB

CGRs, molecules and reactions manipulation

License: GNU Lesser General Public License v3.0

Python 99.17% Cython 0.75% JavaScript 0.08%

cgrtools's People

Contributors

dependabot[bot] avatar neon-monster avatar pandylandy avatar phrolycheva avatar salikhovi4 avatar stsouko avatar tagirshin avatar timurgimadiev avatar valiaafo avatar zarinaibr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cgrtools's Issues

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

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.

not all SMILES lines are read in a reaction SMILES file

The following script doesn't translate all lines to the rdf format:

#!/usr/bin/env python3

import sys
from CGRtools import SMILESRead
from CGRtools import RDFWrite

input_fn = sys.argv[1]
count = 0

with SMILESRead(input_fn) as input:
    with RDFWrite(sys.stdout) as output:
        for d in input:
            output.write(d)
            count += 1

print('read %d' % count, file = sys.stderr)

it would be nice a CGR_from_reaction method

currently, you need to use the tilde operator, but this is not very easy to find / explicit
when you are new to this package.
Also, there could be a to_CGR method in the reaction object/container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.