rdworks 0.39.1__tar.gz → 0.40.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. {rdworks-0.39.1 → rdworks-0.40.2}/PKG-INFO +45 -5
  2. rdworks-0.40.2/README.md +42 -0
  3. {rdworks-0.39.1 → rdworks-0.40.2}/pyproject.toml +3 -3
  4. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/__init__.py +1 -1
  5. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/conf.py +18 -6
  6. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/mol.py +9 -3
  7. rdworks-0.40.2/src/rdworks/testdata.py +24 -0
  8. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/utils.py +29 -0
  9. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks.egg-info/PKG-INFO +45 -5
  10. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks.egg-info/SOURCES.txt +1 -0
  11. {rdworks-0.39.1 → rdworks-0.40.2}/tests/test_basics.py +2 -1
  12. rdworks-0.39.1/README.md +0 -2
  13. {rdworks-0.39.1 → rdworks-0.40.2}/LICENSE +0 -0
  14. {rdworks-0.39.1 → rdworks-0.40.2}/setup.cfg +0 -0
  15. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/autograph/__init__.py +0 -0
  16. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/autograph/autograph.py +0 -0
  17. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/autograph/centroid.py +0 -0
  18. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/autograph/dynamictreecut.py +0 -0
  19. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/autograph/nmrclust.py +0 -0
  20. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/autograph/rckmeans.py +0 -0
  21. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/bitqt/__init__.py +0 -0
  22. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/bitqt/bitqt.py +0 -0
  23. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/descriptor.py +0 -0
  24. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/display.py +0 -0
  25. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/ionized.py +0 -0
  26. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/matchedseries.py +0 -0
  27. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/mollibr.py +0 -0
  28. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/pka.py +0 -0
  29. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Asinex_fragment.xml +0 -0
  30. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Astex_RO3.xml +0 -0
  31. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Baell2010_PAINS/Baell2010A.xml +0 -0
  32. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Baell2010_PAINS/Baell2010B.xml +0 -0
  33. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Baell2010_PAINS/Baell2010C.xml +0 -0
  34. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Baell2010_PAINS/PAINS-less-than-015-hits.xml +0 -0
  35. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Baell2010_PAINS/PAINS-less-than-150-hits.xml +0 -0
  36. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Baell2010_PAINS/PAINS-more-than-150-hits.xml +0 -0
  37. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Baell2010_PAINS/makexml.py +0 -0
  38. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Brenk2008_Dundee/makexml.py +0 -0
  39. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/CNS.xml +0 -0
  40. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/BMS.xml +0 -0
  41. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/Dundee.xml +0 -0
  42. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/Glaxo.xml +0 -0
  43. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/Inpharmatica.xml +0 -0
  44. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/LINT.xml +0 -0
  45. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/MLSMR.xml +0 -0
  46. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/PAINS.xml +0 -0
  47. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/SureChEMBL.xml +0 -0
  48. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ChEMBL_Walters/makexml.py +0 -0
  49. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999.xml +0 -0
  50. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999Acid.xml +0 -0
  51. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999Base.xml +0 -0
  52. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999ElPh.xml +0 -0
  53. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999NuPh.xml +0 -0
  54. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Hann1999_Glaxo/makexml.py +0 -0
  55. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Kazius2005/Kazius2005.xml +0 -0
  56. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/Kazius2005/makexml.py +0 -0
  57. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ZINC_druglike.xml +0 -0
  58. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ZINC_fragment.xml +0 -0
  59. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ZINC_leadlike.xml +0 -0
  60. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/fragment.xml +0 -0
  61. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ionized/simple_smarts_pattern.csv +0 -0
  62. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/ionized/smarts_pattern.csv +0 -0
  63. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/misc/makexml.py +0 -0
  64. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/misc/reactive-part-2.xml +0 -0
  65. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/misc/reactive-part-3.xml +0 -0
  66. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/predefined/misc/reactive.xml +0 -0
  67. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/readin.py +0 -0
  68. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/rgroup.py +0 -0
  69. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/scaffold.py +0 -0
  70. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/std.py +0 -0
  71. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/stereoisomers.py +0 -0
  72. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/tautomers.py +0 -0
  73. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/torsion.py +0 -0
  74. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/units.py +0 -0
  75. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/xml.py +0 -0
  76. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/xtb/__init__.py +0 -0
  77. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks/xtb/wrapper.py +0 -0
  78. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks.egg-info/dependency_links.txt +0 -0
  79. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks.egg-info/requires.txt +0 -0
  80. {rdworks-0.39.1 → rdworks-0.40.2}/src/rdworks.egg-info/top_level.txt +0 -0
  81. {rdworks-0.39.1 → rdworks-0.40.2}/tests/test_decimals.py +0 -0
  82. {rdworks-0.39.1 → rdworks-0.40.2}/tests/test_gypsumdl.py +0 -0
  83. {rdworks-0.39.1 → rdworks-0.40.2}/tests/test_iupac_name.py +0 -0
  84. {rdworks-0.39.1 → rdworks-0.40.2}/tests/test_nn_xtb.py +0 -0
  85. {rdworks-0.39.1 → rdworks-0.40.2}/tests/test_web.py +0 -0
  86. {rdworks-0.39.1 → rdworks-0.40.2}/tests/test_xtb_wrapper.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rdworks
3
- Version: 0.39.1
4
- Summary: Frequently used tasks built on RDKit and other tools
3
+ Version: 0.40.2
4
+ Summary: Routine tasks built on RDKit and other tools
5
5
  Author-email: Sung-Hun Bae <sunghun.bae@gmail.com>
6
6
  Maintainer-email: Sung-Hun Bae <sunghun.bae@gmail.com>
7
7
  License-Expression: MIT
@@ -10,7 +10,7 @@ Project-URL: Repository, https://github.com/sunghunbae/rdworks.git
10
10
  Project-URL: Issues, https://github.com/sunghunbae/rdworks/issues
11
11
  Project-URL: Changelog, https://github.com/sunghunbae/rdworks/blob/master/CHANGELOG.md
12
12
  Project-URL: Documentation, https://sunghunbae.github.io/rdworks/
13
- Keywords: cheminformatics,rdkit
13
+ Keywords: cheminformatics,rdkit,cdpkit
14
14
  Classifier: Development Status :: 3 - Alpha
15
15
  Classifier: Intended Audience :: Developers
16
16
  Classifier: Programming Language :: Python :: 3
@@ -30,5 +30,45 @@ Requires-Dist: bitarray
30
30
  Requires-Dist: pytest
31
31
  Dynamic: license-file
32
32
 
33
- # rdworks
34
- Higher level wrapper using RDKit
33
+ # Rdworks - routine tasks made easy
34
+
35
+ Rdworks is designed to perform routine cheminformatics tasks easily. It is built on RDKit and other tools.
36
+
37
+ ## Install
38
+
39
+ ```sh
40
+ $ pip install rdworks
41
+ ```
42
+
43
+ OR
44
+
45
+ ```sh
46
+ $ pip install git+https://github.com/sunghunbae/rdworks.git
47
+ ```
48
+
49
+ ## Getting started
50
+
51
+ ```py
52
+ from rdworks import Mol
53
+
54
+ version = rdworks.__version__
55
+
56
+ mol = Mol('CC(=O)Nc1ccc(O)cc1', 'acetaminophen')
57
+
58
+ mol = mol.make_confs(n=5)
59
+ mol.to_sdf('acetaminophen.sdf')
60
+
61
+ torsion_dict = mol.torsion_atoms()
62
+ # torsion_dict = {0: (5,4,3,1)}
63
+
64
+ mol = mol.torsion_energies(calculator='MMFF94', simplify=True)
65
+
66
+ mol.plot_torsion_energies(0, figsize=(6,4))
67
+
68
+ mol.to_png(300, 300, atom_index=True, highlight_atoms=torsion_dict.get(0))
69
+
70
+ serialized = mol.serialize(compress=True)
71
+ mol2 = Mol().deserialize(serialized, compress=True)
72
+
73
+ mol3 = mol.copy()
74
+ ```
@@ -0,0 +1,42 @@
1
+ # Rdworks - routine tasks made easy
2
+
3
+ Rdworks is designed to perform routine cheminformatics tasks easily. It is built on RDKit and other tools.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ $ pip install rdworks
9
+ ```
10
+
11
+ OR
12
+
13
+ ```sh
14
+ $ pip install git+https://github.com/sunghunbae/rdworks.git
15
+ ```
16
+
17
+ ## Getting started
18
+
19
+ ```py
20
+ from rdworks import Mol
21
+
22
+ version = rdworks.__version__
23
+
24
+ mol = Mol('CC(=O)Nc1ccc(O)cc1', 'acetaminophen')
25
+
26
+ mol = mol.make_confs(n=5)
27
+ mol.to_sdf('acetaminophen.sdf')
28
+
29
+ torsion_dict = mol.torsion_atoms()
30
+ # torsion_dict = {0: (5,4,3,1)}
31
+
32
+ mol = mol.torsion_energies(calculator='MMFF94', simplify=True)
33
+
34
+ mol.plot_torsion_energies(0, figsize=(6,4))
35
+
36
+ mol.to_png(300, 300, atom_index=True, highlight_atoms=torsion_dict.get(0))
37
+
38
+ serialized = mol.serialize(compress=True)
39
+ mol2 = Mol().deserialize(serialized, compress=True)
40
+
41
+ mol3 = mol.copy()
42
+ ```
@@ -14,17 +14,17 @@ dependencies = [
14
14
  "tqdm",
15
15
  "ase",
16
16
  # "xtb<6.3.0", <--- installation with conda, issue with FORTRAN runtime error
17
- "mendeleev",
17
+ "mendeleev", # periodic table
18
18
  "scour", # SVG optimization
19
19
  "bitarray", # dependencies of bitqt
20
20
  "pytest",
21
21
  ]
22
22
  authors = [{name = "Sung-Hun Bae", email="sunghun.bae@gmail.com"}, ]
23
23
  maintainers = [{name = "Sung-Hun Bae", email="sunghun.bae@gmail.com"}, ]
24
- description = "Frequently used tasks built on RDKit and other tools"
24
+ description = "Routine tasks built on RDKit and other tools"
25
25
  readme = "README.md"
26
26
  license = "MIT"
27
- keywords = ["cheminformatics", "rdkit",]
27
+ keywords = ["cheminformatics", "rdkit", "cdpkit"]
28
28
  classifiers = [
29
29
  "Development Status :: 3 - Alpha",
30
30
  "Intended Audience :: Developers",
@@ -1,4 +1,4 @@
1
- __version__ = '0.39.1'
1
+ __version__ = '0.40.2'
2
2
 
3
3
  from rdworks.conf import Conf
4
4
  from rdworks.mol import Mol
@@ -19,7 +19,7 @@ from PIL import Image
19
19
  from rdworks.std import clean_2d
20
20
  from rdworks.torsion import get_torsion_atoms, create_torsion_fragment
21
21
  from rdworks.units import ev2kcalpermol, pm2angstrom
22
- from rdworks.utils import recursive_round
22
+ from rdworks.utils import recursive_round, compress_string, decompress_string
23
23
  from rdworks.xtb.wrapper import GFN2xTB
24
24
  from rdworks.display import render_png, render_svg
25
25
 
@@ -60,7 +60,10 @@ class Conf:
60
60
 
61
61
  if isinstance(molecule, str): # 3-D MolBLock string
62
62
  try:
63
- self.rdmol = Chem.MolFromMolBlock(molecule)
63
+ self.rdmol = Chem.MolFromMolBlock(molecule,
64
+ sanitize=False,
65
+ removeHs=False,
66
+ strictParsing=True)
64
67
  except:
65
68
  ValueError(f'Conf() Error: invalid MolBlock string')
66
69
 
@@ -581,7 +584,7 @@ class Conf:
581
584
  return json.dumps(self.props)
582
585
 
583
586
 
584
- def serialize(self, decimals: int = 3) -> str:
587
+ def serialize(self, decimals: int = 3, compressed: bool = False) -> str:
585
588
  """Serialize information necessary to rebuild a Conf object.
586
589
  Args:
587
590
  decimals (int, optional): number of decimal places for float data type. Defaults to 3.
@@ -598,10 +601,13 @@ class Conf:
598
601
  'molblock' : self.to_molblock(),
599
602
  })
600
603
 
604
+ if compressed:
605
+ serialized = compress_string(serialized)
606
+
601
607
  return serialized
602
608
 
603
609
 
604
- def deserialize(self, serialized: str) -> Self:
610
+ def deserialize(self, serialized: str, compressed: bool = False) -> Self:
605
611
  """De-serialize information and rebuild a Conf object.
606
612
 
607
613
  Example:
@@ -614,6 +620,9 @@ class Conf:
614
620
  Returns:
615
621
  Self: modified self.
616
622
  """
623
+ if compressed:
624
+ serialized = decompress_string(serialized)
625
+
617
626
  data = json.loads(serialized)
618
627
 
619
628
  self.name = data['name']
@@ -626,9 +635,12 @@ class Conf:
626
635
  return self
627
636
 
628
637
 
629
- def to_molblock(self) -> str:
638
+ def to_molblock(self, compressed: bool = False) -> str:
630
639
  """Returns MolBlock"""
631
- return Chem.MolToMolBlock(self.rdmol)
640
+ molblock = Chem.MolToMolBlock(self.rdmol)
641
+ if compressed:
642
+ molblock = compress_string(molblock)
643
+ return molblock
632
644
 
633
645
 
634
646
  def to_xyz(self) -> str:
@@ -37,7 +37,7 @@ from rdworks.std import generate_inchi_key, desalt_smiles, standardize, clean_2d
37
37
  from rdworks.xml import list_predefined_xml, get_predefined_xml, parse_xml
38
38
  from rdworks.scaffold import rigid_fragment_indices
39
39
  from rdworks.descriptor import rd_descriptor, rd_descriptor_f
40
- from rdworks.utils import convert_tril_to_symm, QT, recursive_round
40
+ from rdworks.utils import convert_tril_to_symm, QT, recursive_round, compress_string, decompress_string
41
41
  from rdworks.units import ev2kcalpermol
42
42
  from rdworks.autograph import NMRCLUST, DynamicTreeCut, RCKmeans, AutoGraph
43
43
  from rdworks.bitqt import BitQT
@@ -1558,7 +1558,7 @@ class Mol:
1558
1558
  return json.dumps(props)
1559
1559
 
1560
1560
 
1561
- def serialize(self, decimals: int = 2) -> str:
1561
+ def serialize(self, decimals: int = 2, compressed: bool = False) -> str:
1562
1562
  """Serialize information necessary to rebuild a Mol object.
1563
1563
 
1564
1564
  Args:
@@ -1575,10 +1575,13 @@ class Mol:
1575
1575
  'confs' : [conf.serialize() for conf in self.confs],
1576
1576
  })
1577
1577
 
1578
+ if compressed:
1579
+ serialized = compress_string(serialized)
1580
+
1578
1581
  return serialized
1579
1582
 
1580
1583
 
1581
- def deserialize(self, serialized: str) -> Self:
1584
+ def deserialize(self, serialized: str, compressed: bool = False) -> Self:
1582
1585
  """De-serialize the information and build a new Mol object.
1583
1586
 
1584
1587
  Example:
@@ -1591,6 +1594,9 @@ class Mol:
1591
1594
  Returns:
1592
1595
  Self: modified self.
1593
1596
  """
1597
+ if compressed:
1598
+ serialized = decompress_string(serialized)
1599
+
1594
1600
  data = json.loads(serialized)
1595
1601
 
1596
1602
  self.name = data['name']
@@ -0,0 +1,24 @@
1
+ drugs = {
2
+ 'Acetaminophen': 'CC(=O)Nc1ccc(O)cc1',
3
+ 'Aspirin': 'CC(=O)OC1=CC=CC=C1C(=O)O',
4
+ 'Atorvastatin': 'CC(C)C1=C(C(=C(N1CC[C@H](C[C@H](CC(=O)O)O)O)C2=CC=C(C=C2)F)C3=CC=CC=C3)C(=O)NC4=CC=CC=C4',
5
+ 'Atovaquone': 'C1CC(CCC1C2=CC=C(C=C2)Cl)C3=C(C4=CC=CC=C4C(=O)C3=O)O',
6
+ 'Cefdinir': 'C=CC1=C(N2[C@@H]([C@@H](C2=O)NC(=O)/C(=N\\O)/C3=CSC(=N3)N)SC1)C(=O)O',
7
+ 'Chlorprothixene': 'CN(CC/C=C1C2=CC=CC=C2SC3=C/1C=C(Cl)C=C3)C',
8
+ 'Cimetidine': 'CC1=C(N=CN1)CSCCNC(=NC)NC#N',
9
+ 'Clomipramine': 'CN(C)CCCN1C2=CC=CC=C2CCC3=C1C=C(C=C3)Cl',
10
+ 'Ethopropazine': 'CCN(CC)C(C)CN1C2=CC=CC=C2SC3=CC=CC=C31',
11
+ 'Famotidine': 'C1=C(N=C(S1)N=C(N)N)CSCC/C(=N/S(=O)(=O)N)/N',
12
+ 'Fluconazole': 'C1=CC(=C(C=C1F)F)C(CN2C=NC=N2)(CN3C=NC=N3)O',
13
+ 'Granisetron': 'CN1[C@@H]2CCC[C@H]1CC(C2)NC(=O)C3=NN(C4=CC=CC=C43)C',
14
+ 'Leflunomide': 'CC1=C(C=NO1)C(=O)NC2=CC=C(C=C2)C(F)(F)F',
15
+ 'Linezolid': 'CC(=O)NC[C@H]1CN(C(=O)O1)C2=CC(=C(C=C2)N3CCOCC3)F',
16
+ 'Methixene': 'CN1CCCC(C1)CC2C3=CC=CC=C3SC4=CC=CC=C24',
17
+ 'Molindone': 'CCC1=C(NC2=C1C(=O)C(CC2)CN3CCOCC3)C',
18
+ 'Paroxetine': 'C1CNC[C@H]([C@@H]1C2=CC=C(C=C2)F)COC3=CC4=C(C=C3)OCO4',
19
+ 'Pergolide': 'CCCN1C[C@@H](C[C@H]2[C@H]1CC3=CNC4=CC=CC2=C34)CSC',
20
+ 'Rifampin': 'C[C@H]1/C=C/C=C(\\C(=O)NC2=C(C(=C3C(=C2O)C(=C(C4=C3C(=O)[C@](O4)(O/C=C/[C@@H]([C@H]([C@H]([C@@H]([C@@H]([C@@H]([C@H]1O)C)O)C)OC(=O)C)C)OC)C)C)O)O)/C=N/N5CCN(CC5)C)/C',
21
+ 'Simvastatin': 'O=C(O[C@@H]1[C@H]3C(=C/[C@H](C)C1)\\C=C/[C@@H]([C@@H]3CC[C@H]2OC(=O)C[C@H](O)C2)C)C(C)(C)CC',
22
+ 'Sitagliptin': 'Fc1cc(c(F)cc1F)C[C@@H](N)CC(=O)N3Cc2nnc(n2CC3)C(F)(F)F',
23
+ 'Sofosbuvir': 'C[C@@H](C(OC(C)C)=O)N[P@](OC[C@@H]1[C@H]([C@@](F)([C@@H](O1)N2C=CC(NC2=O)=O)C)O)(OC3=CC=CC=C3)=O',
24
+ }
@@ -1,6 +1,8 @@
1
1
  import numpy as np
2
2
  import math
3
3
  import operator
4
+ import gzip
5
+ import base64
4
6
 
5
7
  from pathlib import Path
6
8
  from types import SimpleNamespace
@@ -14,6 +16,33 @@ from rdkit import Chem
14
16
  from rdworks.autograph.centroid import centroid_medoid
15
17
 
16
18
 
19
+ def compress_string(text: str) -> str:
20
+ """compress string to base64-encoded string.
21
+
22
+ Args:
23
+ text (str): original string.
24
+
25
+ Returns:
26
+ str: base64-encoded compressed string.
27
+ """
28
+ compressed_bytes = gzip.compress(text.encode('utf-8'))
29
+ return base64.b64encode(compressed_bytes).decode('utf-8')
30
+
31
+
32
+ def decompress_string(compressed_text: str) -> str:
33
+ """decompress base64-encoded string to original string.
34
+
35
+ Args:
36
+ compressed_text (str): base64-encoded compressed string.
37
+
38
+ Returns:
39
+ str: original string.
40
+ """
41
+ compressed_bytes = base64.b64decode(compressed_text)
42
+ decompressed_text = gzip.decompress(compressed_bytes).decode('utf-8')
43
+ return decompressed_text
44
+
45
+
17
46
  def compute(fn:Callable, largs: list, **kwargs) -> list:
18
47
  max_workers = kwargs.get('max_workers', 1)
19
48
  chunksize = kwargs.get('chunksize', 10)
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rdworks
3
- Version: 0.39.1
4
- Summary: Frequently used tasks built on RDKit and other tools
3
+ Version: 0.40.2
4
+ Summary: Routine tasks built on RDKit and other tools
5
5
  Author-email: Sung-Hun Bae <sunghun.bae@gmail.com>
6
6
  Maintainer-email: Sung-Hun Bae <sunghun.bae@gmail.com>
7
7
  License-Expression: MIT
@@ -10,7 +10,7 @@ Project-URL: Repository, https://github.com/sunghunbae/rdworks.git
10
10
  Project-URL: Issues, https://github.com/sunghunbae/rdworks/issues
11
11
  Project-URL: Changelog, https://github.com/sunghunbae/rdworks/blob/master/CHANGELOG.md
12
12
  Project-URL: Documentation, https://sunghunbae.github.io/rdworks/
13
- Keywords: cheminformatics,rdkit
13
+ Keywords: cheminformatics,rdkit,cdpkit
14
14
  Classifier: Development Status :: 3 - Alpha
15
15
  Classifier: Intended Audience :: Developers
16
16
  Classifier: Programming Language :: Python :: 3
@@ -30,5 +30,45 @@ Requires-Dist: bitarray
30
30
  Requires-Dist: pytest
31
31
  Dynamic: license-file
32
32
 
33
- # rdworks
34
- Higher level wrapper using RDKit
33
+ # Rdworks - routine tasks made easy
34
+
35
+ Rdworks is designed to perform routine cheminformatics tasks easily. It is built on RDKit and other tools.
36
+
37
+ ## Install
38
+
39
+ ```sh
40
+ $ pip install rdworks
41
+ ```
42
+
43
+ OR
44
+
45
+ ```sh
46
+ $ pip install git+https://github.com/sunghunbae/rdworks.git
47
+ ```
48
+
49
+ ## Getting started
50
+
51
+ ```py
52
+ from rdworks import Mol
53
+
54
+ version = rdworks.__version__
55
+
56
+ mol = Mol('CC(=O)Nc1ccc(O)cc1', 'acetaminophen')
57
+
58
+ mol = mol.make_confs(n=5)
59
+ mol.to_sdf('acetaminophen.sdf')
60
+
61
+ torsion_dict = mol.torsion_atoms()
62
+ # torsion_dict = {0: (5,4,3,1)}
63
+
64
+ mol = mol.torsion_energies(calculator='MMFF94', simplify=True)
65
+
66
+ mol.plot_torsion_energies(0, figsize=(6,4))
67
+
68
+ mol.to_png(300, 300, atom_index=True, highlight_atoms=torsion_dict.get(0))
69
+
70
+ serialized = mol.serialize(compress=True)
71
+ mol2 = Mol().deserialize(serialized, compress=True)
72
+
73
+ mol3 = mol.copy()
74
+ ```
@@ -16,6 +16,7 @@ src/rdworks/scaffold.py
16
16
  src/rdworks/std.py
17
17
  src/rdworks/stereoisomers.py
18
18
  src/rdworks/tautomers.py
19
+ src/rdworks/testdata.py
19
20
  src/rdworks/torsion.py
20
21
  src/rdworks/units.py
21
22
  src/rdworks/utils.py
@@ -511,6 +511,7 @@ def test_torsion_fragment_from_conf():
511
511
  assert frag_ijkl == ta2[0]
512
512
 
513
513
  ref_conf2 = ref_conf2.torsion_energies(calculator='MMFF94', interval=15)
514
+ ref_conf3 = ref_conf2.torsion_energies_one(calculator='MMFF94', indices=frag_ijkl)
514
515
 
515
516
 
516
517
  def test_torsion_energies():
@@ -549,4 +550,4 @@ def test_serialization():
549
550
  rebuilt = Mol().deserialize(serialized)
550
551
  assert rebuilt.count() == 10
551
552
  assert rebuilt.name == name
552
- assert rebuilt == mol
553
+ assert rebuilt == mol
rdworks-0.39.1/README.md DELETED
@@ -1,2 +0,0 @@
1
- # rdworks
2
- Higher level wrapper using RDKit
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes