modelcraft 3.6.0__py3-none-any.whl → 4.0.1__py3-none-any.whl

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.
modelcraft/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "3.6.0"
1
+ __version__ = "4.0.1"
2
2
 
3
3
  from .cell import max_distortion as max_cell_distortion
4
4
  from .cell import remove_scale
@@ -11,7 +11,6 @@ from .jobs.buccaneer import Buccaneer
11
11
  from .jobs.comit import Comit
12
12
  from .jobs.coot import FixSideChains
13
13
  from .jobs.coot import Prune
14
- from .jobs.coot import RsrMorph
15
14
  from .jobs.ctruncate import CTruncate
16
15
  from .jobs.emda import EmdaMapMask
17
16
  from .jobs.findwaters import FindWaters
@@ -71,7 +70,6 @@ __all__ = [
71
70
  "remove_residues",
72
71
  "remove_scale",
73
72
  "rmsz",
74
- "RsrMorph",
75
73
  "run",
76
74
  "ServalcatNemap",
77
75
  "ServalcatRefine",
modelcraft/jobs/coot.py CHANGED
@@ -29,7 +29,6 @@ class Coot(Job):
29
29
  " COOT1 = False\n",
30
30
  " if COOT1:\n",
31
31
  " from coot import *\n",
32
- " from fitting import fit_protein_make_specs\n",
33
32
  " turn_off_backup(0)\n",
34
33
  ]
35
34
  for i, structure in enumerate(self.structures):
@@ -103,12 +102,3 @@ class FixSideChains(Coot):
103
102
  super().__init__(
104
103
  script=script, structures=[structure], fphis=[fphi_best, fphi_diff]
105
104
  )
106
-
107
-
108
- class RsrMorph(Coot):
109
- def __init__(self, structure: gemmi.Structure, fphi_best: DataItem):
110
- path = os.path.join(os.path.dirname(__file__), "..", "coot", "morph.py")
111
- with open(path) as stream:
112
- script = stream.read()
113
- script += "rsr_morph(IMOL0, IMAP0)\n"
114
- super().__init__(script=script, structures=[structure], fphis=[fphi_best])
modelcraft/monlib.py CHANGED
@@ -29,10 +29,12 @@ def in_library(code: str) -> bool:
29
29
 
30
30
  @functools.lru_cache(maxsize=None)
31
31
  def group(code: str) -> gemmi.ChemComp.Group:
32
- doc = gemmi.cif.read(_path(code))
33
- monlib = gemmi.MonLib()
34
- monlib.read_monomer_doc(doc)
35
- return monlib.monomers[code].group
32
+ if in_library(code):
33
+ doc = gemmi.cif.read(_path(code))
34
+ monlib = gemmi.MonLib()
35
+ monlib.read_monomer_doc(doc)
36
+ return monlib.monomers[code].group
37
+ return None
36
38
 
37
39
 
38
40
  @functools.lru_cache(maxsize=None)
@@ -1,4 +1,4 @@
1
- from modelcraft.jobs.coot import Prune, FixSideChains, RsrMorph
1
+ from modelcraft.jobs.coot import Prune, FixSideChains
2
2
  from modelcraft.structure import ModelStats
3
3
  from . import insulin_refmac
4
4
 
@@ -27,15 +27,3 @@ def test_insulin_fix_side_chains():
27
27
  stats_in = ModelStats(refmac.structure)
28
28
  stats_out = ModelStats(coot.structure)
29
29
  assert stats_out.residues == stats_in.residues
30
-
31
-
32
- def test_insulin_rsr_morph():
33
- refmac = insulin_refmac()
34
- refmac.structure.remove_alternative_conformations()
35
- coot = RsrMorph(
36
- structure=refmac.structure,
37
- fphi_best=refmac.fphi_best,
38
- ).run()
39
- stats_in = ModelStats(refmac.structure)
40
- stats_out = ModelStats(coot.structure)
41
- assert stats_out.residues == stats_in.residues
@@ -26,6 +26,7 @@ def test_in_library():
26
26
  assert in_library(code)
27
27
  for code in RNA_CODES.values():
28
28
  assert in_library(code)
29
+ assert not in_library("NOT_IN_MONLIB")
29
30
 
30
31
 
31
32
  def test_group():
@@ -36,6 +37,7 @@ def test_group():
36
37
  assert group("U") == gemmi.ChemComp.Group.Rna
37
38
  assert group("DT") == gemmi.ChemComp.Group.Dna
38
39
  assert group("HOH") == gemmi.ChemComp.Group.NonPolymer
40
+ assert group("NOT_IN_MONLIB") is None
39
41
 
40
42
 
41
43
  def test_protein():
@@ -46,6 +48,7 @@ def test_protein():
46
48
  assert not is_protein("U")
47
49
  assert not is_protein("DT")
48
50
  assert not is_protein("HOH")
51
+ assert not is_protein("NOT_IN_MONLIB")
49
52
 
50
53
 
51
54
  def test_nucleic():
@@ -55,3 +58,4 @@ def test_nucleic():
55
58
  assert is_nucleic("U")
56
59
  assert is_nucleic("DT")
57
60
  assert not is_nucleic("HOH")
61
+ assert not is_nucleic("NOT_IN_MONLIB")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modelcraft
3
- Version: 3.6.0
3
+ Version: 4.0.1
4
4
  Summary: Automated model building pipeline for X-ray crystallography
5
5
  Home-page: https://github.com/paulsbond/modelcraft
6
6
  Author: Paul Bond
@@ -1,4 +1,4 @@
1
- modelcraft/__init__.py,sha256=xhMhS18BADwNwceT6stbLcp1ZochelcRfTs_v3RfBj8,2233
1
+ modelcraft/__init__.py,sha256=EShQrPLQTgeHMytTnuJwRw8JFkGsBYMVe-iHAMoy66w,2185
2
2
  modelcraft/__main__.py,sha256=0D-TbVRrb0ipPCS-NnUvifaG2kAsBn6mXtWLjyExOXM,77
3
3
  modelcraft/arguments.py,sha256=DChFhzk09Fwpsb4ycZ4OBfXxsFJLNiQiao4ZoErB5wA,14606
4
4
  modelcraft/cell.py,sha256=mqoQfODyXd43MhLYnGwXxTag42Fx9l2wMH3s-ouXpr0,2057
@@ -10,13 +10,12 @@ modelcraft/job.py,sha256=RpM8UfIPH0uNf_yuwBTq4GLp2aY-4_yvJEQd7r3aL4o,4104
10
10
  modelcraft/maps.py,sha256=Lyv3YjKNdUgi6vaLmQ8CcZFKq39EPL4NDC5qO_kCd0A,354
11
11
  modelcraft/modelcraftem.py,sha256=x2o2b_uD91mr-gJHK9CrODVAdp9FCJF9kIC1GrofMLI,5133
12
12
  modelcraft/modelcraftxray.py,sha256=l73CSdLkEjgf1MdEZgp6tJnTwtkTvp5lvkxSA-mCSWU,12791
13
- modelcraft/monlib.py,sha256=WZqfxPMv9kygvOipTsDNFBR87khpYGTUVNYjbw3JVRE,1425
13
+ modelcraft/monlib.py,sha256=cEiYHKGEKpBlv-fJbKYJ91aZyMu9iAtmwdyuWeZj2F0,1482
14
14
  modelcraft/pipeline.py,sha256=2fUmFcCyUG6EmAOxSHtcG91zRHHZmwjRkmJy5Y7Raus,2030
15
15
  modelcraft/reflections.py,sha256=w8iV5NBcghUlufXWvxXLtbW8oNHR5Jx9ELKhgKThvkw,6274
16
16
  modelcraft/solvent.py,sha256=beGtewZXoXzEdaadG4d0vu3hAL61XZdVue62Xldkw4k,6772
17
17
  modelcraft/structure.py,sha256=A0KX9L1hI8Xbk-0dx82BfID3ot_FX2qRBCnWjjL3yko,4122
18
18
  modelcraft/utils.py,sha256=1ljfNB-gIdfGjM1-o_U5jrjJc4f0E1213kpAFEVt5qw,192
19
- modelcraft/coot/morph.py,sha256=rUTQseTBrxriDWYAl4cQdF-7h1cAGuDvdyHWfr0mXPs,754
20
19
  modelcraft/coot/prune.py,sha256=-iGv3w8bubRuzZ9JeaSj5JoAiTwMPAZJrCqNLWwrC7g,35851
21
20
  modelcraft/coot/sidechains.py,sha256=aOj8MHRGzs90VXsi2LdqUT4KcUDHB0yvSRLFvOuYqnY,1847
22
21
  modelcraft/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -24,7 +23,7 @@ modelcraft/jobs/acedrg.py,sha256=nnf1Pe7U5hzY2GJVIluCjmbmQ5V6BayRmZQZD9vMZrs,984
24
23
  modelcraft/jobs/acorn.py,sha256=wYyQMY6XoYejCvcIT0rBD0SyBcQ5Ewi01Bjb9totp5E,2465
25
24
  modelcraft/jobs/buccaneer.py,sha256=7SintYeB4m4-C_yy5oj7rMwBirugF_ghVjSKCKVPslY,5533
26
25
  modelcraft/jobs/comit.py,sha256=peQ5McTlPplTOSqXgkv_W1oB-X9HJ2B3zZQiudx9Ckg,1047
27
- modelcraft/jobs/coot.py,sha256=XsTdpcMtc-nlNXyW1wMbkVOZ8dS_w4i7CcqMZ8Cg_Hg,4026
26
+ modelcraft/jobs/coot.py,sha256=GPWggYA2CUzVHY0ThsHDiCodyI9Hh8FmgycTWIG6vBI,3581
28
27
  modelcraft/jobs/ctruncate.py,sha256=D-aXd6JY2F-XSZOW1Hj8gk1L-BhoRCxbqnUB34wjSVI,1659
29
28
  modelcraft/jobs/emda.py,sha256=33Yr_quk-CDne8vkHrjjIUSCCeoRUlBVnhRZFO8wOXA,988
30
29
  modelcraft/jobs/findwaters.py,sha256=nh0dRFAYYyBYi-8waLByBlV9xmuMog9kqJ5oSUxj2lQ,1700
@@ -49,7 +48,7 @@ modelcraft/tests/ccp4/test_buccaneer.py,sha256=cNf40Nf_yzqdaaGN_jVBGQIwDxl2kXgNB
49
48
  modelcraft/tests/ccp4/test_cell.py,sha256=YrEIxzmUDkYsE1lJRAemBiSQtykhI4XDqMwFSCzhqKE,1057
50
49
  modelcraft/tests/ccp4/test_comit.py,sha256=77TQK5-cAK_LCPnhj7sbWQbNXLg_YxuBa-soldURYcs,533
51
50
  modelcraft/tests/ccp4/test_contents.py,sha256=da0blxz6SUao2hE5cE1e5aPPHPHkldAxYObujhjTIwQ,6801
52
- modelcraft/tests/ccp4/test_coot.py,sha256=AZFVOJGtvTo6PE16RnwOFyomc068eXh_TfbDKb-ViPQ,1295
51
+ modelcraft/tests/ccp4/test_coot.py,sha256=59wzv62P2s9oUcmrnhZZmntJrCEwG0kRcrPaanqEkz8,924
53
52
  modelcraft/tests/ccp4/test_copies.py,sha256=mU8qMzM0UFN19ASMUX5HWX1yOc5QPhtoEfbuzzj9MOc,315
54
53
  modelcraft/tests/ccp4/test_ctruncate.py,sha256=q0QewF2v5-DfEYNrKq2oRluCYi1MDd41rNGFiiTwwlE,2277
55
54
  modelcraft/tests/ccp4/test_findwaters.py,sha256=IEzazZXjt0uccLcUSJnacEeJZDrl1c_UmrcQaUJMgCI,1583
@@ -57,7 +56,7 @@ modelcraft/tests/ccp4/test_freerflag.py,sha256=2Z4nRka3VbXSx89qj-vIbAZ9m12Tl_O2s
57
56
  modelcraft/tests/ccp4/test_geometry.py,sha256=LFeCGHqALgWoiP5X2p1oRbsK8Mbk8p5ICk4CDbGAbKI,556
58
57
  modelcraft/tests/ccp4/test_libg.py,sha256=JHGOeg3jSriWUH96H8aAVd3K9SrrE3qwHPMjpmv3vJg,256
59
58
  modelcraft/tests/ccp4/test_molrep.py,sha256=ooyYNXtN5sNkpF-j59vJzRD4f1CEQkMQkVdatzIhA10,1318
60
- modelcraft/tests/ccp4/test_monlib.py,sha256=Ov1RMXMHZShaMefzRTWz2r0H30HT_wQPji_-5VGILrI,1621
59
+ modelcraft/tests/ccp4/test_monlib.py,sha256=vuU0EMNVBGqegF6JinUhw3FPJ6KB1Zdik8NV2p0gbJ0,1792
61
60
  modelcraft/tests/ccp4/test_nautilus.py,sha256=rytNdr27fAtXajZk52fs3eYVi1_8WJbubeXnWd2XXOw,1946
62
61
  modelcraft/tests/ccp4/test_parrot.py,sha256=0Qug6Q3UjH54DokA3C_vKyur7UiLyhyGK3w7Cfjfpxs,792
63
62
  modelcraft/tests/ccp4/test_phasematch.py,sha256=mSWA2eBsipDe3xWyj5iRn7Yj8Gpav0Iva1DaGOHWYa8,1143
@@ -75,9 +74,9 @@ modelcraft/tests/ccpem/test_servalcat.py,sha256=3FQVpo-Vf9MStV-dZD-ZVzGin7YefgTG
75
74
  modelcraft/tests/unittests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
75
  modelcraft/tests/unittests/test_contents.py,sha256=aAHha4pQYMyKes7OiOZ11_-9z-BVqh4OSmAL8gRUX_Y,3153
77
76
  modelcraft/tests/unittests/test_reflections.py,sha256=xshb_2QcAko2l98-Pd1LuEjMZAVv-O7LkhtzGRnrbM4,3674
78
- modelcraft-3.6.0.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
79
- modelcraft-3.6.0.dist-info/METADATA,sha256=wO2e_1HY5G1PYX4pQ8n9N8K5xJt241fzQ3cFNH_4Xxk,1893
80
- modelcraft-3.6.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
81
- modelcraft-3.6.0.dist-info/entry_points.txt,sha256=bWef3WSAihTv1fI39wScTAmrKtn5mOYZ3SEeBpM4RrU,172
82
- modelcraft-3.6.0.dist-info/top_level.txt,sha256=My5973x4fvPrlRfQOuuFxqultnVzrg_aamczcSijdlQ,11
83
- modelcraft-3.6.0.dist-info/RECORD,,
77
+ modelcraft-4.0.1.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
78
+ modelcraft-4.0.1.dist-info/METADATA,sha256=j5FQa_9CFRpNtBwStccDGNGzfuruNJgw2lgxTzmAHtc,1893
79
+ modelcraft-4.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
80
+ modelcraft-4.0.1.dist-info/entry_points.txt,sha256=bWef3WSAihTv1fI39wScTAmrKtn5mOYZ3SEeBpM4RrU,172
81
+ modelcraft-4.0.1.dist-info/top_level.txt,sha256=My5973x4fvPrlRfQOuuFxqultnVzrg_aamczcSijdlQ,11
82
+ modelcraft-4.0.1.dist-info/RECORD,,
modelcraft/coot/morph.py DELETED
@@ -1,16 +0,0 @@
1
- def rsr_morph(imol, imap, local_radius=5, gm_alpha=0.05, blur_b_factor=88):
2
- generate_self_restraints(imol, local_radius)
3
- set_show_extra_restraints(imol, 0) # too confusing
4
- set_refinement_geman_mcclure_alpha(gm_alpha)
5
- set_draw_moving_atoms_restraints(1) # not useful for non-graphics mode
6
- rmsd = map_sigma_py(imap)
7
- if rmsd is not None:
8
- imap_blurred = sharpen_blur_map(imap, blur_b_factor)
9
- set_imol_refinement_map(imap_blurred)
10
- set_matrix(15.0 / rmsd)
11
- residues = fit_protein_make_specs(imol, "all-chains")
12
- if COOT1:
13
- coot_utils.with_auto_accept([refine_residues_py, imol, residues])
14
- else:
15
- with AutoAccept():
16
- refine_residues_py(imol, residues)