modelcraft 4.0.0__py3-none-any.whl → 4.0.2__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__ = "4.0.0"
1
+ __version__ = "4.0.2"
2
2
 
3
3
  from .cell import max_distortion as max_cell_distortion
4
4
  from .cell import remove_scale
@@ -123,6 +123,8 @@ class ModelCraftXray(Pipeline):
123
123
  def run_buccaneer_and_nautilus(self):
124
124
  buccaneer = self.buccaneer()
125
125
  nautilus = self.nautilus()
126
+ if buccaneer is None and nautilus is None:
127
+ self.terminate(reason="No residues built")
126
128
  if buccaneer is None or nautilus is None:
127
129
  self.update_current_from_refmac_result(buccaneer or nautilus)
128
130
  else:
@@ -132,7 +134,7 @@ class ModelCraftXray(Pipeline):
132
134
 
133
135
  def buccaneer(self):
134
136
  if not self.args.contents.proteins:
135
- return
137
+ return None
136
138
  result = Buccaneer(
137
139
  contents=self.args.contents,
138
140
  fsigf=self.args.fmean,
@@ -147,12 +149,14 @@ class ModelCraftXray(Pipeline):
147
149
  cycles=3 if self.cycle == 1 else 2,
148
150
  threads=self.args.threads,
149
151
  ).run(self)
152
+ if result.structure is None or ModelStats(result.structure).residues == 0:
153
+ return None
150
154
  write_mmcif(self.path("current.cif"), result.structure)
151
155
  return self.run_refmac(result.structure, cycles=10)
152
156
 
153
157
  def nautilus(self):
154
158
  if not (self.args.contents.rnas or self.args.contents.dnas):
155
- return
159
+ return None
156
160
  result = Nautilus(
157
161
  contents=self.args.contents,
158
162
  fsigf=self.args.fmean,
@@ -161,6 +165,8 @@ class ModelCraftXray(Pipeline):
161
165
  freer=self.args.freer,
162
166
  structure=self.current_structure,
163
167
  ).run(self)
168
+ if result.structure is None or ModelStats(result.structure).residues == 0:
169
+ return None
164
170
  write_mmcif(self.path("current.cif"), result.structure)
165
171
  return self.run_refmac(result.structure, cycles=10)
166
172
 
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)
@@ -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: 4.0.0
3
+ Version: 4.0.2
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
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.9
16
16
  Requires-Python: ~=3.7
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: gemmi >=0.5.4
19
+ Requires-Dist: gemmi>=0.5.4
20
20
  Requires-Dist: numpy
21
21
  Requires-Dist: pandas
22
22
  Requires-Dist: requests
@@ -1,4 +1,4 @@
1
- modelcraft/__init__.py,sha256=MzPNDe7aO3iAb2tZ58zt84wAOx2RUiY-q-E2aBtUemM,2185
1
+ modelcraft/__init__.py,sha256=b6kF56OszYiw4E6RCSy1Ezv0CChodB7w0N3DmWJrgu8,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
@@ -9,8 +9,8 @@ modelcraft/geometry.py,sha256=ofgIgZ4G2W56vofldJVrkTjuxAbDhzOtsJckv-kCP_A,1218
9
9
  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
- modelcraft/modelcraftxray.py,sha256=l73CSdLkEjgf1MdEZgp6tJnTwtkTvp5lvkxSA-mCSWU,12791
13
- modelcraft/monlib.py,sha256=WZqfxPMv9kygvOipTsDNFBR87khpYGTUVNYjbw3JVRE,1425
12
+ modelcraft/modelcraftxray.py,sha256=tRzxvhcC5opUiy24GeQaMLG2ZT_qvlcdq6ObFpA9nnM,13121
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
@@ -56,7 +56,7 @@ modelcraft/tests/ccp4/test_freerflag.py,sha256=2Z4nRka3VbXSx89qj-vIbAZ9m12Tl_O2s
56
56
  modelcraft/tests/ccp4/test_geometry.py,sha256=LFeCGHqALgWoiP5X2p1oRbsK8Mbk8p5ICk4CDbGAbKI,556
57
57
  modelcraft/tests/ccp4/test_libg.py,sha256=JHGOeg3jSriWUH96H8aAVd3K9SrrE3qwHPMjpmv3vJg,256
58
58
  modelcraft/tests/ccp4/test_molrep.py,sha256=ooyYNXtN5sNkpF-j59vJzRD4f1CEQkMQkVdatzIhA10,1318
59
- modelcraft/tests/ccp4/test_monlib.py,sha256=Ov1RMXMHZShaMefzRTWz2r0H30HT_wQPji_-5VGILrI,1621
59
+ modelcraft/tests/ccp4/test_monlib.py,sha256=vuU0EMNVBGqegF6JinUhw3FPJ6KB1Zdik8NV2p0gbJ0,1792
60
60
  modelcraft/tests/ccp4/test_nautilus.py,sha256=rytNdr27fAtXajZk52fs3eYVi1_8WJbubeXnWd2XXOw,1946
61
61
  modelcraft/tests/ccp4/test_parrot.py,sha256=0Qug6Q3UjH54DokA3C_vKyur7UiLyhyGK3w7Cfjfpxs,792
62
62
  modelcraft/tests/ccp4/test_phasematch.py,sha256=mSWA2eBsipDe3xWyj5iRn7Yj8Gpav0Iva1DaGOHWYa8,1143
@@ -74,9 +74,9 @@ modelcraft/tests/ccpem/test_servalcat.py,sha256=3FQVpo-Vf9MStV-dZD-ZVzGin7YefgTG
74
74
  modelcraft/tests/unittests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
75
  modelcraft/tests/unittests/test_contents.py,sha256=aAHha4pQYMyKes7OiOZ11_-9z-BVqh4OSmAL8gRUX_Y,3153
76
76
  modelcraft/tests/unittests/test_reflections.py,sha256=xshb_2QcAko2l98-Pd1LuEjMZAVv-O7LkhtzGRnrbM4,3674
77
- modelcraft-4.0.0.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
78
- modelcraft-4.0.0.dist-info/METADATA,sha256=LEhWmHIc3N46f3vqGzxpIv2sF1IjzrqCBmF4U-8WIKY,1893
79
- modelcraft-4.0.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
80
- modelcraft-4.0.0.dist-info/entry_points.txt,sha256=bWef3WSAihTv1fI39wScTAmrKtn5mOYZ3SEeBpM4RrU,172
81
- modelcraft-4.0.0.dist-info/top_level.txt,sha256=My5973x4fvPrlRfQOuuFxqultnVzrg_aamczcSijdlQ,11
82
- modelcraft-4.0.0.dist-info/RECORD,,
77
+ modelcraft-4.0.2.dist-info/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
78
+ modelcraft-4.0.2.dist-info/METADATA,sha256=MHumkhjTRqsPqeRIq6f2VRVnDl1ij3TxHQUgReCUocU,1892
79
+ modelcraft-4.0.2.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
80
+ modelcraft-4.0.2.dist-info/entry_points.txt,sha256=bWef3WSAihTv1fI39wScTAmrKtn5mOYZ3SEeBpM4RrU,172
81
+ modelcraft-4.0.2.dist-info/top_level.txt,sha256=My5973x4fvPrlRfQOuuFxqultnVzrg_aamczcSijdlQ,11
82
+ modelcraft-4.0.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (75.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5