Giter Club home page Giter Club logo

chemml's People

Contributors

aatishpr avatar aditya1707 avatar bhargavaurala avatar gvishwak avatar jhachmann avatar mojtabah avatar ramv2 avatar tintoanto 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

chemml's Issues

TypeError when loading dataset

I am receiving an error when trying to load load_organic_density (ChemML v 1.2)

from chemml.datasets import load_organic_density
smi, density, features = load_organic_density()

Here is the error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Untitled-1.ipynb Cell 23 line 3
      [1](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#X31sdW50aXRsZWQ%3D?line=0) from chemml.datasets import load_organic_density
----> [3](vscode-notebook-cell:Untitled-1.ipynb?jupyter-notebook#X31sdW50aXRsZWQ%3D?line=2) smi, density, features = load_organic_density()

File [~\AppData\Roaming\Python\Python310\site-packages\chemml\datasets\base.py:87](https://untitled+.vscode-resource.vscode-cdn.net/~/AppData/Roaming/Python/Python310/site-packages/chemml/datasets/base.py:87), in load_organic_density()
     85 smi = pd.DataFrame(df['smiles'], columns=['smiles'])
     86 density = pd.DataFrame(df['density_Kg/m3'], columns=['density_Kg/m3'])
---> 87 features = df.drop(['smiles', 'density_Kg/m3'],1)
     89 return smi, density, features

TypeError: DataFrame.drop() takes from 1 to 2 positional arguments but 3 were given

from chemml import wrapperRUN

Hi,

When I tried "from chemml import wrapperRUN" in The Jupyter interpreter, I get the following error message:


ImportError Traceback (most recent call last)
in
----> 1 from chemml import wrapperRUN

ImportError: cannot import name 'wrapperRUN' from 'chemml' (/Users/amir/.local/lib/python3.8/site-packages/chemml/init.py)


How can resolve this issue?

Thanks,
Amir

Can't find pybel despyte it being installed and working

I'm unable to load chemml after following install instructions:

from openbabel import pybel, openbabel
from chemml.chem import Molecule

The error message:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-7-8e1fb2bc2fb0> in <module>()
      1 from openbabel import pybel, openbabel
----> 2 from chemml.chem import Molecule

/home/henrique/.local/lib/python3.6/site-packages/chemml/chem/__init__.py in <module>()
      9 """
     10 
---> 11 from .molecule import Molecule
     12 from .molecule import XYZ
     13 from .CoulMat import CoulombMatrix

/home/henrique/.local/lib/python3.6/site-packages/chemml/chem/molecule.py in <module>()
      3 import keras # required to go around the protobuf error after importing pybel prior to tensorflow
      4 from rdkit import Chem
----> 5 import pybel
      6 from rdkit.Chem import AllChem
      7 import warnings

ModuleNotFoundError: No module named 'pybel'

chemML cant read XYZ format as string

My molecules are stored in XYZ format in a pandas DataFrame and I'm trying to iterate them to chemml, It looks like I can not pass a string directly and I was with the impresison that this was possible.

Here is what I'm trying:
My molecule (just a test):

Ethane = """8
	Energy:      -4.7343653
C          0.10289       -0.52365       -0.00000
C         -1.40917       -0.52366       -0.00000
H          0.48726        0.04224       -0.85384
H          0.48726       -1.54605       -0.06316
H          0.48726       -0.06716        0.91700
H         -1.79354       -0.98015       -0.91700
H         -1.79354        0.49874        0.06316
H         -1.79354       -1.08955        0.85384
"""

And here is the raised error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-71-ebbc3a0998bf> in <module>()
----> 1 mol = Molecule(Ethane, input_type="xyz")

/home/henrique/.local/lib/python3.6/site-packages/chemml/chem/molecule.py in __init__(self, input, input_type, **kwargs)
    275         self._init_attributes()
    276         self._extra_docs()
--> 277         self._load(input, input_type, **kwargs)
    278 
    279     def __repr__(self):

/home/henrique/.local/lib/python3.6/site-packages/chemml/chem/molecule.py in _load(self, input, input_type, **kwargs)
    422         """
    423         if input_type == 'xyz':
--> 424             self._load_pybel(input, input_type, **kwargs)
    425         elif input_type in ['smiles', 'smarts', 'inchi']:
    426             self._load_rdkit(input, input_type, **kwargs)

/home/henrique/.local/lib/python3.6/site-packages/chemml/chem/molecule.py in _load_pybel(self, input, input_type, **kwargs)
    495             else:
    496                 msg = "The input '%s' is not a valid XYZ input file."%input
--> 497                 raise ValueError(msg)
    498 
    499         if pybel_mol is None:

ValueError: The input '8
	Energy:      -4.7343653
C          0.10289       -0.52365       -0.00000
C         -1.40917       -0.52366       -0.00000
H          0.48726        0.04224       -0.85384
H          0.48726       -1.54605       -0.06316
H          0.48726       -0.06716        0.91700
H         -1.79354       -0.98015       -0.91700
H         -1.79354        0.49874        0.06316
H         -1.79354       -1.08955        0.85384
' is not a valid XYZ input file.

If, instead, I'm providing a real XYZ file instead of a string (with path end everything) it works.

Z-Score

Hello,

I am wondering wether I can apply your Z-Score analysis. I tried to find it in this repository but no luck.

Thank you so much,

GeneticAlgorithm function fitness argument does not check number of inputs

The number of elements in the fitness tuple is not checked during GeneticAlgorithm function execution.

Example: when performing single objective minimization, the function is expected to work like

GeneticAlgorithm(..., fitness=(min,), ...)

But it can also work as

GeneticAlgorithm(..., fitness=('min', 'min', 'min', ...), ...)

which would be more appropriate for multi-objective.

The function will still execute and return the single objective

Directly feed ChemML with a RDKit molecule (object)

Hello, thanks for the amazing code!
I'm working with a large pandas dataframe containing organometallic molecules in the .mol V3000 format. RDKit can read it perfectly but as I can see ChemML, using the Molecule function, can read smiles, smarts, inchi, and xyz. For my molecules, I can't convert them to one line notations because that removes the correct geometry of the molecules, so, here is my question:

Since RDKit is reading the molecules correctly, is there a way to feed ChemML with the molecule objects already interpreted by RDKit?

Dependency Issue in Installation

Dear contributors,

When I followed the instructions of installing with anaconda:
conda create --name chemml_env python=3.8
source activate chemml_env
conda install -c conda-forge openbabel rdkit nb_conda_kernels python-graphviz
pip install chemml

I got the following dependency error:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

sqlalchemy 2.0.27 requires typing-extensions>=4.6.0, but you have typing-extensions 4.5.0 which is incompatible.
Successfully installed MarkupSafe-2.1.5 absl-py-2.1.0 appnope-0.1.4 asttokens-2.4.1 astunparse-1.6.3 backcall-0.2.0 cachetools-5.3.2 charset-normalizer-3.3.2 chemml-1.3 comm-0.2.1 decorator-5.1.1 et-xmlfile-1.1.0 executing-2.0.1 flatbuffers-23.5.26 future-0.18.3 gast-0.4.0 google-auth-2.28.0 google-auth-oauthlib-1.0.0 google-pasta-0.2.0 grpcio-1.60.1 h5py-3.10.0 idna-3.6 ipython-8.12.3 ipywidgets-8.1.2 jedi-0.19.1 joblib-1.3.2 jupyterlab-widgets-3.0.10 keras-2.13.1 libclang-16.0.6 lxml-5.1.0 markdown-3.5.2 matplotlib-inline-0.1.6 numpy-1.24.3 oauthlib-3.2.2 openpyxl-3.1.2 opt-einsum-3.3.0 parso-0.8.3 pexpect-4.9.0 pickleshare-0.7.5 prompt-toolkit-3.0.43 protobuf-4.25.3 ptyprocess-0.7.0 pure-eval-0.2.2 pyasn1-0.5.1 pyasn1-modules-0.3.0 pygments-2.17.2 requests-2.31.0 requests-oauthlib-1.3.1 rsa-4.9 scikit-learn-1.3.2 scipy-1.10.1 seaborn-0.13.2 stack-data-0.6.3 tensorboard-2.13.0 tensorboard-data-server-0.7.2 tensorflow-2.13.1 tensorflow-estimator-2.13.0 tensorflow-io-gcs-filesystem-0.34.0 termcolor-2.4.0 threadpoolctl-3.3.0 typing-extensions-4.5.0 urllib3-2.2.1 wcwidth-0.2.13 werkzeug-3.0.1 wget-3.2 widgetsnbextension-4.0.10 wrapt-1.16.0

And when I tried to run magpie feature module I got:

2024-02-19 01:04:32.630354: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "/Users/yanjunliu/Documents/3DSC/magpie_feature.py", line 39, in
print(MAGPIE_features('NaCl'))
File "/Users/yanjunliu/Documents/3DSC/magpie_feature.py", line 20, in MAGPIE_features
features = f.generate_features(entries=all_comps)
File "/Users/yanjunliu/opt/anaconda3/envs/3DSC/lib/python3.8/site-packages/chemml/chem/magpie_python/attributes/generators/composition/ValenceShellAttributeGenerator.py", line 64, in generate_features
n_valence[i] = LookUpData.load_property("N"+s+"Valence")
File "/Users/yanjunliu/opt/anaconda3/envs/3DSC/lib/python3.8/site-packages/chemml/chem/magpie_python/data/materials/util/LookUpData.py", line 161, in load_property
values = np.zeros(len(self.element_ids), dtype=np.float)
File "/Users/yanjunliu/opt/anaconda3/envs/3DSC/lib/python3.8/site-packages/numpy/init.py", line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'float'.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Are these errors related? I just need the related functions in chemml to generate magpie features. Thank you very much!

Best regards,

Yanjun Liu

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.