Coder Social home page Coder Social logo

wengong-jin / chemprop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chemprop/chemprop

60.0 60.0 3.0 55.38 MB

Chemical Property Prediction with Graph Convolutional Networks

License: MIT License

Python 47.15% CSS 16.49% HTML 35.54% JavaScript 0.82%

chemprop's People

Contributors

swansonk14 avatar wengong-jin avatar yangkevin2 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

Watchers

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

chemprop's Issues

code lacks a proper project structure

The current code layout is pretty confusing with everything living in one directory.

Would it be useful refactor it so that this repository becomes a more standard python project?
Something like:

Chemprop/
|   demo/
|   |-- data/
|   |   |-- ___.csv
|   |--demo_runner.py
|
|-- chemprop/
|   |-- test/
|   |   |-- __init__.py
|   |   |-- test_todo.py
|   |   
|   |-- __init__.py
|   |-- mpn.py
|   |-- runers.py
|   |-- utils.py
|   |-- io.py
|
|-- setup.py
|-- README
|-- LICENCE

I'm happy to help out.

3D distance feature

Hi, I found that in your code, some 3D distance was attached to the bond feature, but It's not mentioned in your paper and in the refined code, this feature was deleted. Why this was deleted? Isn't it a good supplementary information for some molecules' property prediction?

Input pipeline

Hi everybody,

first of all, thanks for this great repo.

For me a minor issue is that the training process seems to be rather slow.
Are there any plans on parallelizing the input pipeline?

Thanks in advance!
Florian

prediction by default picking up all models in the directory

Use case
DIR1/model1/
DIR1/model2/
DIR1/model3/
etc...

predict.py automatically picking up all other directories (model1/2/3) while I defined to use only one for predictions, I suppose it should use only and only one directory to look for *.pt?
python /home/user/git/chemprop/predict.py --test_path test.csv --preds_path test_preds.csv --checkpoint_path ./DIR1/model3/

BCELoss is unstable

The “BCELoss” is highly unstable and crashes chemprop with assert statements on cuda level, could you change this to “BCEWithLogitsLoss”

generalize FunctionalGroupFeaturizer

Dear all, the SMARTS definition is hard to read and does not allow comments or any details.
Might I suggest to switch to the RDKit feature factory to make this more generic?

Find the class modification attached and please change the following command line parameters in parsing.py

parser.add_argument('--additional_atom_features', type=str, nargs='*', choices=['smarts','family_and_type'], default=[],
                    help='Use additional features in atom featurization')
parser.add_argument('--atom_features_family_and_type', type=str, default='{RDDataDir}/BaseFeatures.fdef',
                    help='Path to txt file of smarts for functional groups, if functional_group features are on.')
parser.add_argument('--atom_features_smarts', type=str, default='chemprop/features/smarts.txt',
                    help='Path to txt file of smarts for functional groups, if functional_group features are on.')

functional_groups.py.txt

Replace hard-wired features with feature factory

Hi, for enabling us to feed in easily other type of vectorial data without enforcing hard-coding in a deeper class/function, I replaced the existing logic by using fully the already existing feature factory.
This is also used in argparse and can therefore easily handle more extensions by just adding new modules to the feature factory.

Please check and let me know what you think
https://github.com/joergkurtwegner/chemprop/commit/0e14e539592e17f60dce8c73d13bbac58badb027

predict.py AssertionError

python predict.py --test_path data/tox21.csv --checkpoint_dir tox21_checkpoints --preds_path tox21_preds.csv

Traceback (most recent call last):
File "predict.py", line 6, in
make_predictions(args)
File "/home/chupvl/git/chemprop/chemprop/train/make_predictions.py", line 30, in make_predictions
assert smiles is not None # Note: Currently only works with smiles provided, not with data file.
AssertionError

features_only failing?

python train.py --gpu 0 --features_only --virtual_edges --ensemble_size 5 --num_folds 5 --data_path data/tox21.csv --dataset_type classification --save_dir checkpoints/tox21

causes
AttributeError: 'Namespace' object has no attribute 'features_dim'

Error while running the code

Hi, sorry if the question is a little noobish, but I get the following error while running the code :

(chemprop) C:\Users\1901566.admin\Downloads\chemprop-master>python web/run.py
Traceback (most recent call last):
  File "web/run.py", line 10, in <module>
    from app import app, db
  File "C:\Users\1901566.admin\Downloads\chemprop-master\web\app\__init__.py", line 6, in <module>
    app.config.from_object('config')
  File "C:\Users\1901566.admin\.conda\envs\chemprop\lib\site-packages\flask\config.py", line 174, in from_object
    obj = import_string(obj)
  File "C:\Users\1901566.admin\.conda\envs\chemprop\lib\site-packages\werkzeug\utils.py", line 568, in import_string
    __import__(import_name)
  File "C:\Users\1901566.admin\Downloads\chemprop-master\web\config.py", line 9, in <module>
    import torch
  File "C:\Users\1901566.admin\.conda\envs\chemprop\lib\site-packages\torch\__init__.py", line 81, in <module>
    ctypes.CDLL(dll)
  File "C:\Users\1901566.admin\.conda\envs\chemprop\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

Could anyone please please help me solve this? I don't know the reason of this error.

Issue with TensorboardX version 1.7

Hello,

There seems to be an issue with the new TensorboardX release. (1.7) after installing (conda version).
"TypeError: init() got an unexpected keyword argument 'log_dir' "
Reverting back to 1.6 seems to fix the issue.
pytorch/ignite#534

About this model training file

As mentioned in the literature, you used RDKit to calculate 12 molecular features as part of the training set. But I can't understand the specific format of this training file. Could you give me an example file?

adding partial charges

modify featurization.py

7a8,10
> from rdkit.Chem.rdPartialCharges import *
> from rdkit.Chem import ChemicalFeatures
> import os
34,35c37,39
< # len(choices) + 1 to include room for uncommon values; + 2 at end for IsAromatic and mass
< ATOM_FDIM = sum(len(choices) + 1 for choices in ATOM_FEATURES.values()) + 2
---
> # len(choices) + 1 to include room for uncommon values; + 3 at end for IsAromatic and mass and partial charge
> ATOM_FDIM = sum(len(choices) + 1 for choices in ATOM_FEATURES.values()) + 3
94c98,99
<            [atom.GetMass() * 0.01]  # scaled to about the same range as other features
---
>            [atom.GetMass() * 0.01] + \
>            [float(atom.GetProp("_GasteigerCharge"))]
192a198,201
> 
>         #assign partial charges
>         ComputeGasteigerCharges(mol)
>         #iterate over atoms

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.