cimm-kzn / 3d-mil-qsar Goto Github PK
View Code? Open in Web Editor NEWPython source code for 3D/MI/QSAR models
Python source code for 3D/MI/QSAR models
The files under /datasets
are actually CSV files (ie they would not be parsed as SMILES files).
Thank you for your great repo.
I used
ins_net =AttentionNetRegressor(ndim=ndim, init_cuda=init_cuda)
ins_net.fit(x_train, y_train, n_epoch=n_epoch, batch_size=batch_size, weight_decay=weight_decay, lr=lr)
predictions = ins_net.predict(x_test)
print('3D/SI/Bag-AttentionNet: r2_score test = {:.2f}'.format(r2_score(y_test, predictions)))
then got:
TypeError Traceback (most recent call last)
/tmp/ipykernel_18462/3242914669.py in
1 #Bag-AttentionNet
----> 2 ins_net =AttentionNetRegressor(ndim=ndim, init_cuda=init_cuda)
3 ins_net.fit(x_train, y_train, n_epoch=n_epoch, batch_size=batch_size, weight_decay=weight_decay, lr=lr)
4
5 predictions = ins_net.predict(x_test)
/media/pharma1/e09e0694-327d-420b-b724-c197e5847ab6/3D-MIL-QSAR/miqsar/estimators/attention_nets.py in init(self, ndim, det_ndim, init_cuda)
69 class AttentionNetRegressor(AttentionNet, BaseRegressor):
70 def init(self, ndim=None, det_ndim=None, init_cuda=False):
---> 71 super().init(ndim=ndim, det_ndim=det_ndim, init_cuda=init_cuda)
/media/pharma1/e09e0694-327d-420b-b724-c197e5847ab6/3D-MIL-QSAR/miqsar/estimators/attention_nets.py in init(self, ndim, det_ndim, init_cuda)
35 input_dim = ndim[-1]
36 attention = []
---> 37 for dim in det_ndim:
38 attention.append(Linear(input_dim, dim))
39 attention.append(Sigmoid())
TypeError: 'NoneType' object is not iterable
what is det_ndim?
in miqsar/descriptor_calculation/pmapper/pharmacophore.py
Graph.node is deprecated in NetworkX, should be using Graph.nodes instead
https://networkx.org/documentation/stable/release/release_2.4.html#deprecations
Here are the diffs
95c95
< dist = self.__dist(self.__g.node[i]['xyz'], self.__g.node[j]['xyz'], bin_step)
---
> dist = self.__dist(self.__g.nodes[i]['xyz'], self.__g.nodes[j]['xyz'], bin_step)
144c144
< feature_labels = dict(zip(ids, (self.__g.node[i]['label'] for i in ids)))
---
> feature_labels = dict(zip(ids, (self.__g.nodes[i]['label'] for i in ids)))
Thank you for your repo.
import os
from miqsar.utils import calc_3d_pmapper
#Choose dataset to be modeled and create a folder where the descriptors will be stored
nconfs = 5 #number of conformers to create; calculation is time consuming, so here we set 5, for real tasks set 25..100
ncpu = 7 # set number of CPU cores you have
dataset_file = 'datasets/CHEMBL1075104.smi'
descriptors_folder = os.path.join('descriptors')
os.mkdir(descriptors_folder)
bags, labels, molid = calc_3d_pmapper(dataset_file, nconfs=nconfs, stereo=False, path=descriptors_folder, ncpu=ncpu)
print(f'There are {len(bags)} molecules encoded with {bags[0].shape[1]} pmapper descriptors')
TypeError Traceback (most recent call last)
/tmp/ipykernel_99958/2926432156.py in
11 os.mkdir(descriptors_folder)
12
---> 13 bags, labels, molid = calc_3d_pmapper(dataset_file, nconfs=nconfs, stereo=False, path=descriptors_folder, ncpu=ncpu)
14
15 print(f'There are {len(bags)} molecules encoded with {bags[0].shape[1]} pmapper descriptors')
~/caocheng/3D-MIL-QSAR-main/miqsar/utils.py in calc_3d_pmapper(dataset_file, nconfs, stereo, path, ncpu)
24
25 for conf in conf_files:
---> 26 dsc_file = calc_pmapper_descriptors(conf, path=path, ncpu=ncpu, col_clean=None, del_undef=True)
27
28 with open(dsc_file, 'rb') as inp:
~/caocheng/3D-MIL-QSAR-main/miqsar/descriptor_calculation/pmapper_3d.py in calc_pmapper_descriptors(*args, **kwargs)
229
230 def calc_pmapper_descriptors(*args, **kwargs):
--> 231 return main(*args, **kwargs)
TypeError: main() got an unexpected keyword argument 'path'
I didn't change anything in example. Why is it wrong?
Please consider making a release and archive with the GitHub/Zenodo integration and then cite that DOI in the preprint.
I suggest removing the .git
at the end of the URL use in the preprint and just list https://github.com/dzankov/3D-MIL-QSAR.
Hello,
When running example.ipynb, the following error occurs:
path=descriptors_folder, ncpu=ncpu)
File "/data/3D-MIL-QSAR-main/3D-MIL-QSAR-main/miqsar/utils.py", line 37, in calc_3d_pmapper
descr_num=descr_num, remove=0.05, keep_temp=False, ncpu=ncpu, verbose=False)
File "/data/3D-MIL-QSAR-main/3D-MIL-QSAR-main/miqsar/descriptor_calculation/pmapper_3d.py", line 344, in calc_pmapper_descriptors
return main(*args, **kwargs)
TypeError: main() got an unexpected keyword argument 'factory'
I followed the installing process and bellow is the conda list:
Name | Version | Build | Channel
_libgcc_mutex | 0.1 | main |
_openmp_mutex | 5.1 | 1_gnu |
blas | 1 | mkl | https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
bzip2 | 1.0.8 | h7b6447c_0
ca-certificates | 2023.12.12 | h06a4308_0
cairo | 1.16.0 | hb05425b_5
certifi | 2021.5.30 | py36h06a4308_0
cudatoolkit | 11.3.1 | h2bc3f7f_2
dataclasses | 0.8 | pyh4f3eec9_6
decorator | 4.4.2 | pypi_0 | pypi
ffmpeg | 4.3 | hf484d3e_0 | pytorch
fontconfig | 2.14.1 | hef1e5e3_0
freetype | 2.10.4 | h0708190_1 | conda-forge
glib | 2.69.1 | h4ff587b_1
gmp | 6.2.1 | h295c915_3
gnutls | 3.6.15 | he1e5248_0
icu | 58.2 | hf484d3e_1000 | conda-forge
intel-openmp | 2022.1.0 | h9e868ea_3769
joblib | 1.1.1 | pypi_0 | pypi
jpeg | 9b | 0 | https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
lame | 3.1 | h7b6447c_0
lcms2 | 2.12 | h3be6417_0
ld_impl_linux-64 | 2.38 | h1181459_1
libboost | 1.73.0 | h3ff78a5_11
libffi | 3.3 | he6710b0_2
libgcc-ng | 11.2.0 | h1234567_1
libgomp | 11.2.0 | h1234567_1
libiconv | 1.14 | 0 | https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
libidn2 | 2.3.4 | h5eee18b_0
libpng | 1.6.39 | h5eee18b_0
libstdcxx-ng | 11.2.0 | h1234567_1
libtasn1 | 4.19.0 | h5eee18b_0
libtiff | 4.2.0 | h85742a9_0
libunistring | 0.9.10 | h27cfd23_0
libuv | 1.44.2 | h5eee18b_0
libwebp-base | 1.3.2 | h5eee18b_0
libxcb | 1.15 | h7f8727e_0
libxml2 | 2.9.14 | h74e7548_0
lz4-c | 1.9.4 | h6a678d5_0
mkl | 2020.2 | 256 |
mkl-service | 2.3.0 | py36he8ac12f_0
mkl_fft | 1.3.0 | py36h54f3939_0
mkl_random | 1.1.1 | py36h0573a6f_0
ncurses | 6.4 | h6a678d5_0
nettle | 3.7.3 | hbbd107a_1
networkx | 2.5.1 | pypi_0 | pypi
numpy | 1.19.2 | py36h54aff64_0
numpy-base | 1.19.2 | py36hfa32c7d_0
olefile | 0.44 | pypi_0 | pypi
openbabel | 3.1.1 | py36he0ca515_2 | conda-forge
openh264 | 2.1.1 | h4ff587b_0
openjpeg | 2.4.0 | h3ad879b_0
openssl | 1.1.1w | h7f8727e_0
pandas | 1.1.5 | py36ha9443f7_0
pcre | 8.45 | h9c3ff4c_0 | conda-forge
pillow | 8.3.1 | py36h2c7a002_0
pip | 21.2.2 | py36h06a4308_0
pixman | 0.40.0 | h7f8727e_1
pmapper | 1.0.4 | pypi_0 | pypi
py-boost | 1.73.0 | py36ha9443f7_11
python | 3.6.13 | h12debd9_1
python-dateutil | 2.8.2 | pyhd3eb1b0_0
python_abi | 3.6 | 2_cp36m | conda-forge
pytorch | 1.10.2 | py3.6_cuda11.3_cudnn8.2.0_0 | pytorch
pytorch-mutex | 1 | cuda | pytorch
pytorch-ranger | 0.1.1 | pypi_0 | pypi
pytz | 2021.3 | pyhd3eb1b0_0
rdkit | 2020.09.1.0 | py36hd50e099_1 | rdkit
readline | 8.2 | h5eee18b_0
scikit-learn | 0.24.2 | pypi_0 | pypi
scipy | 1.5.4 | pypi_0 | pypi
setuptools | 58.0.4 | py36h06a4308_0
six | 1.16.0 | pypi_0 | pypi
sqlite | 3.41.2 | h5eee18b_0
threadpoolctl | 3.1.0 | pypi_0 | pypi
tk | 8.6.12 | h1ccaba5_0
torch-optimizer | 0.3.0 | pypi_0 | pypi
torchaudio | 0.10.2 | py36_cu113 | pytorch
torchvision | 0.11.3 | py36_cu113 | pytorch
typing_extensions | 4.1.1 | pyh06a4308_0
wheel | 0.37.1 | pyhd3eb1b0_0
xz | 5.4.5 | h5eee18b_0
zlib | 1.2.13 | h5eee18b_0
zstd | 1.4.9 | haebb681_0
Thank you.
Please provide a license statement.
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.