rdworks 0.41.1__tar.gz → 0.42.1__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 (85) hide show
  1. {rdworks-0.41.1 → rdworks-0.42.1}/PKG-INFO +1 -1
  2. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/__init__.py +1 -1
  3. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/conf.py +1 -1
  4. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/torsion.py +13 -7
  5. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks.egg-info/PKG-INFO +1 -1
  6. {rdworks-0.41.1 → rdworks-0.42.1}/tests/test_basics.py +13 -4
  7. {rdworks-0.41.1 → rdworks-0.42.1}/LICENSE +0 -0
  8. {rdworks-0.41.1 → rdworks-0.42.1}/README.md +0 -0
  9. {rdworks-0.41.1 → rdworks-0.42.1}/pyproject.toml +0 -0
  10. {rdworks-0.41.1 → rdworks-0.42.1}/setup.cfg +0 -0
  11. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/autograph/__init__.py +0 -0
  12. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/autograph/autograph.py +0 -0
  13. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/autograph/centroid.py +0 -0
  14. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/autograph/dynamictreecut.py +0 -0
  15. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/autograph/nmrclust.py +0 -0
  16. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/autograph/rckmeans.py +0 -0
  17. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/bitqt/__init__.py +0 -0
  18. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/bitqt/bitqt.py +0 -0
  19. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/descriptor.py +0 -0
  20. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/display.py +0 -0
  21. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/ionized.py +0 -0
  22. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/matchedseries.py +0 -0
  23. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/mol.py +0 -0
  24. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/mollibr.py +0 -0
  25. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/pka.py +0 -0
  26. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Asinex_fragment.xml +0 -0
  27. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Astex_RO3.xml +0 -0
  28. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Baell2010_PAINS/Baell2010A.xml +0 -0
  29. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Baell2010_PAINS/Baell2010B.xml +0 -0
  30. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Baell2010_PAINS/Baell2010C.xml +0 -0
  31. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Baell2010_PAINS/PAINS-less-than-015-hits.xml +0 -0
  32. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Baell2010_PAINS/PAINS-less-than-150-hits.xml +0 -0
  33. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Baell2010_PAINS/PAINS-more-than-150-hits.xml +0 -0
  34. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Baell2010_PAINS/makexml.py +0 -0
  35. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Brenk2008_Dundee/makexml.py +0 -0
  36. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/CNS.xml +0 -0
  37. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/BMS.xml +0 -0
  38. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/Dundee.xml +0 -0
  39. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/Glaxo.xml +0 -0
  40. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/Inpharmatica.xml +0 -0
  41. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/LINT.xml +0 -0
  42. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/MLSMR.xml +0 -0
  43. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/PAINS.xml +0 -0
  44. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/SureChEMBL.xml +0 -0
  45. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ChEMBL_Walters/makexml.py +0 -0
  46. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999.xml +0 -0
  47. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999Acid.xml +0 -0
  48. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999Base.xml +0 -0
  49. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999ElPh.xml +0 -0
  50. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Hann1999_Glaxo/Hann1999NuPh.xml +0 -0
  51. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Hann1999_Glaxo/makexml.py +0 -0
  52. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Kazius2005/Kazius2005.xml +0 -0
  53. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/Kazius2005/makexml.py +0 -0
  54. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ZINC_druglike.xml +0 -0
  55. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ZINC_fragment.xml +0 -0
  56. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ZINC_leadlike.xml +0 -0
  57. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/fragment.xml +0 -0
  58. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ionized/simple_smarts_pattern.csv +0 -0
  59. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/ionized/smarts_pattern.csv +0 -0
  60. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/misc/makexml.py +0 -0
  61. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/misc/reactive-part-2.xml +0 -0
  62. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/misc/reactive-part-3.xml +0 -0
  63. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/predefined/misc/reactive.xml +0 -0
  64. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/readin.py +0 -0
  65. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/rgroup.py +0 -0
  66. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/scaffold.py +0 -0
  67. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/std.py +0 -0
  68. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/stereoisomers.py +0 -0
  69. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/tautomers.py +0 -0
  70. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/testdata.py +0 -0
  71. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/units.py +0 -0
  72. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/utils.py +0 -0
  73. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/xml.py +0 -0
  74. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/xtb/__init__.py +0 -0
  75. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks/xtb/wrapper.py +0 -0
  76. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks.egg-info/SOURCES.txt +0 -0
  77. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks.egg-info/dependency_links.txt +0 -0
  78. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks.egg-info/requires.txt +0 -0
  79. {rdworks-0.41.1 → rdworks-0.42.1}/src/rdworks.egg-info/top_level.txt +0 -0
  80. {rdworks-0.41.1 → rdworks-0.42.1}/tests/test_decimals.py +0 -0
  81. {rdworks-0.41.1 → rdworks-0.42.1}/tests/test_gypsumdl.py +0 -0
  82. {rdworks-0.41.1 → rdworks-0.42.1}/tests/test_iupac_name.py +0 -0
  83. {rdworks-0.41.1 → rdworks-0.42.1}/tests/test_nn_xtb.py +0 -0
  84. {rdworks-0.41.1 → rdworks-0.42.1}/tests/test_web.py +0 -0
  85. {rdworks-0.41.1 → rdworks-0.42.1}/tests/test_xtb_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rdworks
3
- Version: 0.41.1
3
+ Version: 0.42.1
4
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>
@@ -1,4 +1,4 @@
1
- __version__ = '0.41.1'
1
+ __version__ = '0.42.1'
2
2
 
3
3
  from rdworks.conf import Conf
4
4
  from rdworks.mol import Mol
@@ -453,7 +453,7 @@ class Conf:
453
453
  }
454
454
 
455
455
  if simplify:
456
- frag, frag_ijkl = create_torsion_fragment(ref_conf.rdmol, indices)
456
+ (frag, frag_ijkl, frag_created, wbo_filtered) = create_torsion_fragment(ref_conf.rdmol, indices)
457
457
  frag_conf = Conf(frag)
458
458
  for angle in np.arange(-180.0, 180.0, interval):
459
459
  # Iterated numpy.ndarray does not contain the last 180: -180., ..., (180).
@@ -426,7 +426,7 @@ def create_fragment_on_bonds(rdmol: Chem.Mol, bonds: dict, cap: bool = True) ->
426
426
 
427
427
  def create_torsion_fragment(rdmol: Chem.Mol,
428
428
  torsion_indices: tuple,
429
- wbo_tolerance: float = 0.03) -> tuple[Chem.Mol, list[int]]:
429
+ wbo_tolerance: float = 0.03) -> tuple[Chem.Mol, list[int], bool, bool]:
430
430
  """Create a close surrogate fragment that captures the PES of the intended torsion.
431
431
 
432
432
  Fragmentation aims to preserve the local chemical environment around the targeted torsion
@@ -443,7 +443,10 @@ def create_torsion_fragment(rdmol: Chem.Mol,
443
443
  torsion_indices (tuple): (i, j, k, l, atoms to be rotated, atoms to be fixed)
444
444
 
445
445
  Returns:
446
- Chem.Mol: simplified fragment molecule.
446
+ (Chem.Mol: fragment molecule,
447
+ list[int]: fragment indices,
448
+ bool: True if fragmented,
449
+ bool: True if WBO filtering is used)
447
450
 
448
451
  References:
449
452
  https://pubs.acs.org/doi/10.1021/acs.jcim.2c01153
@@ -455,8 +458,10 @@ def create_torsion_fragment(rdmol: Chem.Mol,
455
458
 
456
459
  if not candidates:
457
460
  # no fragmentation
458
- return rdmol, torsion_indices
459
-
461
+ return (rdmol, torsion_indices, False, False)
462
+
463
+ # fragmented
464
+ WBO_filtered = False
460
465
  if GFN2xTB().version() is not None:
461
466
  # filter candidate(s) by Wiberg bond order (WBO) if xTB is available
462
467
  jk = tuple(sorted([j, k]))
@@ -472,11 +477,12 @@ def create_torsion_fragment(rdmol: Chem.Mol,
472
477
  frag_jk = tuple(sorted(frag_jk))
473
478
  if abs(fragment.wbo[frag_jk] - parent.wbo[jk]) < wbo_tolerance:
474
479
  wbo_passed_candidates[bond_idx] = (p, q)
475
- frag_multi_breaks = create_fragment_on_bonds(rdmol, wbo_passed_candidates)
480
+ frag_multi_breaks = create_fragment_on_bonds(rdmol, wbo_passed_candidates)
481
+ WBO_filtered = True
476
482
  else:
477
483
  # skip WBO filtering
478
484
  frag_multi_breaks = create_fragment_on_bonds(rdmol, candidates)
479
485
 
480
- frag_ijkl = get_fragment_idx(rdmol, (i, j, k, l), frag_multi_breaks)
486
+ frag_indices = get_fragment_idx(rdmol, (i, j, k, l), frag_multi_breaks)
481
487
 
482
- return frag_multi_breaks, frag_ijkl
488
+ return (frag_multi_breaks, frag_indices, True, WBO_filtered)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rdworks
3
- Version: 0.41.1
3
+ Version: 0.42.1
4
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>
@@ -472,17 +472,22 @@ def test_torsion_fragment():
472
472
  # {0: (0, 1, 3, 7), 1: (3, 4, 32, 33), 2: (4, 5, 26, 27), 3: (7, 6, 19, 20),
473
473
  # 4: (3, 7, 8, 9), 5: (7, 8, 9, 10), 6: (8, 9, 10, 18), 7: (18, 10, 11, 12),
474
474
  # 8: (10, 11, 12, 17), 9: (17, 12, 13, 14), 10: (12, 13, 14, 15), 11: (36, 35, 34, 32)}
475
- frag, frag_ijkl = create_torsion_fragment(mol.confs[0].rdmol, ta[6])
475
+ (frag, frag_ijkl, frag_created, wbo_filtered) = create_torsion_fragment(mol.confs[0].rdmol, ta[6])
476
476
  assert frag_ijkl == (5, 6, 7, 12)
477
+ assert frag_created == True
478
+ assert wbo_filtered == True
477
479
 
478
480
  mol2 = Mol(molecule='CC(=O)Nc1ccc(O)cc1', name='acetaminophen.3').make_confs(n=1)
479
481
  ta2 = mol2.torsion_atoms()
480
482
  # {0: (5, 4, 3, 1)}
481
483
  assert len(ta2) == 1
482
- frag, frag_ijkl = create_torsion_fragment(mol2.confs[0].rdmol, ta2[0])
484
+
485
+ (frag, frag_ijkl, frag_created, wbo_filtered) = create_torsion_fragment(mol2.confs[0].rdmol, ta2[0])
483
486
  # expects no fragmentation
484
487
  assert frag == mol2.confs[0].rdmol
485
488
  assert frag_ijkl == ta2[0]
489
+ assert frag_created == False
490
+ assert wbo_filtered == False
486
491
 
487
492
 
488
493
  def test_torsion_fragment_from_conf():
@@ -495,8 +500,10 @@ def test_torsion_fragment_from_conf():
495
500
  # {0: (0, 1, 3, 7), 1: (3, 4, 32, 33), 2: (4, 5, 26, 27), 3: (7, 6, 19, 20),
496
501
  # 4: (3, 7, 8, 9), 5: (7, 8, 9, 10), 6: (8, 9, 10, 18), 7: (18, 10, 11, 12),
497
502
  # 8: (10, 11, 12, 17), 9: (17, 12, 13, 14), 10: (12, 13, 14, 15), 11: (36, 35, 34, 32)}
498
- frag, frag_ijkl = create_torsion_fragment(ref_conf.rdmol, ta[6])
503
+ frag, frag_ijkl, frag_created, wbo_filtered = create_torsion_fragment(ref_conf.rdmol, ta[6])
499
504
  assert frag_ijkl == (5, 6, 7, 12)
505
+ assert frag_created == True
506
+ assert wbo_filtered == True
500
507
 
501
508
  ref_conf = ref_conf.torsion_energies(calculator='MMFF94', torsion_key=6, interval=15)
502
509
 
@@ -505,10 +512,12 @@ def test_torsion_fragment_from_conf():
505
512
  ta2 = ref_conf2.torsion_atoms()
506
513
  # {0: (5, 4, 3, 1)}
507
514
  assert len(ta2) == 1
508
- frag, frag_ijkl = create_torsion_fragment(ref_conf2.rdmol, ta2[0])
515
+ frag, frag_ijkl, frag_created, wbo_filtered = create_torsion_fragment(ref_conf2.rdmol, ta2[0])
509
516
  # expects no fragmentation
510
517
  assert frag == ref_conf2.rdmol
511
518
  assert frag_ijkl == ta2[0]
519
+ assert frag_created == False
520
+ assert wbo_filtered == False
512
521
 
513
522
  ref_conf2 = ref_conf2.torsion_energies(calculator='MMFF94', interval=15)
514
523
  ref_conf3 = ref_conf2.torsion_energies_one(calculator='MMFF94', indices=frag_ijkl)
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
File without changes
File without changes
File without changes
File without changes