Skip to content

Commit

Permalink
v4.0.2 (#50)
Browse files Browse the repository at this point in the history
* Avoid crashing when no residues are built

* Updated version
  • Loading branch information
paulsbond authored Oct 24, 2024
1 parent 22c80d0 commit d426909
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org).

## [4.0.2] - 2024-10-24

### Fixed

- Crash when no residues are built.

## [4.0.1] - 2024-05-14

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion modelcraft/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.0.1"
__version__ = "4.0.2"

from .cell import max_distortion as max_cell_distortion
from .cell import remove_scale
Expand Down
10 changes: 8 additions & 2 deletions modelcraft/modelcraftxray.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def run_cycle(self):
def run_buccaneer_and_nautilus(self):
buccaneer = self.buccaneer()
nautilus = self.nautilus()
if buccaneer is None and nautilus is None:
self.terminate(reason="No residues built")
if buccaneer is None or nautilus is None:
self.update_current_from_refmac_result(buccaneer or nautilus)
else:
Expand All @@ -132,7 +134,7 @@ def run_buccaneer_and_nautilus(self):

def buccaneer(self):
if not self.args.contents.proteins:
return
return None
result = Buccaneer(
contents=self.args.contents,
fsigf=self.args.fmean,
Expand All @@ -147,12 +149,14 @@ def buccaneer(self):
cycles=3 if self.cycle == 1 else 2,
threads=self.args.threads,
).run(self)
if result.structure is None or ModelStats(result.structure).residues == 0:
return None
write_mmcif(self.path("current.cif"), result.structure)
return self.run_refmac(result.structure, cycles=10)

def nautilus(self):
if not (self.args.contents.rnas or self.args.contents.dnas):
return
return None
result = Nautilus(
contents=self.args.contents,
fsigf=self.args.fmean,
Expand All @@ -161,6 +165,8 @@ def nautilus(self):
freer=self.args.freer,
structure=self.current_structure,
).run(self)
if result.structure is None or ModelStats(result.structure).residues == 0:
return None
write_mmcif(self.path("current.cif"), result.structure)
return self.run_refmac(result.structure, cycles=10)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="modelcraft",
version="4.0.1",
version="4.0.2",
author="Paul Bond",
author_email="paul.bond@york.ac.uk",
description="Automated model building pipeline for X-ray crystallography",
Expand Down

0 comments on commit d426909

Please sign in to comment.