-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
38 lines (31 loc) · 1.07 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# v.0.1
# PaDEL-robust: robust version of PaDEL-descriptor Python interface
# Developed in 2022 by Mikhail Markovsky <[email protected]>
from padel_robust import PadelDescriptor
if __name__ == '__main__':
# Definition of target substances
SOURCE_SINGLE = 'CCC'
SOURCE_ARRAY = [
'CCC',
'CCCCC',
'CCCCCCC'
]
# PaDEL object initiated
padel = PadelDescriptor(
convert_3d=True,
d_2d=True,
d_3d=True,
timeout=120,
threads=1
)
# Example of a single calculation
print('PaDEL-robust test.')
print('Calculating a single descriptor...')
descriptors_single = padel.make_descriptor(SOURCE_SINGLE)
print(f'{len(descriptors_single)} descriptors calculated for a substance.\n')
# Example of a batch calculation
print('Starting a batch calculation...')
descriptors_multiple = padel.make_descriptors_batch(SOURCE_ARRAY)
print(f'{len(descriptors_multiple[0])} descriptors calculated for each of {len(SOURCE_ARRAY)} substances.\n')