wengong-jin / chemprop Goto Github PK
View Code? Open in Web Editor NEWThis project forked from chemprop/chemprop
Chemical Property Prediction with Graph Convolutional Networks
License: MIT License
This project forked from chemprop/chemprop
Chemical Property Prediction with Graph Convolutional Networks
License: MIT License
A minor thing, but the project is listed as "HTML" project.
Maybe you want to change this to a more sensible category, e.g. Python? :P
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
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.
As we know, the random seed in splitting the dataset has a large impact on the final performance of test set, So all of these dataset should be evaluate as same as the test set in deepchem/molnet, namely, you should split your dataset as deepchem does! not just by yourself
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
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/
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'
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.')
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.
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
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
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
The “BCELoss” is highly unstable and crashes chemprop with assert statements on cuda level, could you change this to “BCEWithLogitsLoss”
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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.