Skip to content

Commit

Permalink
Version 3.4.0 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsbond authored Sep 21, 2023
1 parent 10574bf commit 51f330b
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 7 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).

## [3.4.0] - 2023-09-21

### Added

- Option --mask to provide a custom mask in EM mode instead of using EMDA mapmask

## [3.3.0] - 2023-08-01

### Changed
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__ = "3.3.0"
__version__ = "3.4.0"

from .cell import max_distortion as max_cell_distortion
from .cell import remove_scale
Expand Down
14 changes: 11 additions & 3 deletions modelcraft/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,20 @@
metavar="X",
help=(
"Either two half-maps or a single map in MRC format. "
"Input maps will be trimmed using Servalcat "
"and a mask calculated by EMDA mapmask. "
"Input maps will be trimmed using Servalcat. "
"If two half-maps are provided then Servalcat will be used to calculate "
"a normalised expected (NE) map for model building."
),
)
_GROUP.add_argument(
"--mask",
metavar="X",
help=(
"Mask with the same grid size and dimensions as the input map(s). "
"Servalcat will use this mask when trimming the maps. "
"If a mask is not provided then EMDA mapmask will be used to create one."
),
)
_GROUP.add_argument(
"--resolution",
type=float,
Expand Down Expand Up @@ -289,7 +297,7 @@ def _basic_check(args: argparse.Namespace):


def _check_paths(args: argparse.Namespace):
for arg in ("contents", "data", "map", "model", "restraints"):
for arg in ("contents", "data", "map", "mask", "model", "restraints"):
if hasattr(args, arg):
attr = getattr(args, arg)
if isinstance(attr, str):
Expand Down
5 changes: 4 additions & 1 deletion modelcraft/modelcraftem.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def run(self):

def _process_input_maps(self):
maps = [read_map(path) for path in self.args.map]
mask = EmdaMapMask(maps[0]).run(self).mask
if self.args.mask is not None:
mask = read_map(self.args.mask)
else:
mask = EmdaMapMask(maps[0]).run(self).mask
trimmed = ServalcatTrim(mask, maps).run(self)
self.args.map = trimmed.maps
if len(maps) == 2:
Expand Down
9 changes: 9 additions & 0 deletions modelcraft/tests/ccp4/test_buccaneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ def test_insulin():
freer=freer,
cycles=1,
).run()
assert buccaneer.completeness_res > 0
assert buccaneer.completeness_chn > 0
assert buccaneer.chains_built > 0
assert buccaneer.fragments_built > 0
assert buccaneer.residues_built > 0
assert buccaneer.residues_sequenced > 0
assert buccaneer.residues_unique > 0
assert buccaneer.longest_fragment > 0
assert buccaneer.seconds > 0
stats = ModelStats(buccaneer.structure)
assert stats.residues > 0

Expand Down
10 changes: 9 additions & 1 deletion modelcraft/tests/ccpem/test_em.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
import pytest
from modelcraft.scripts.modelcraft import main
from ..ccp4 import in_temp_directory
from . import density_path, sequence_path, halfmap1_path, halfmap2_path, structure_path
from . import (
density_path,
halfmap1_path,
halfmap2_path,
mask_path,
sequence_path,
structure_path,
)


@in_temp_directory
Expand All @@ -29,6 +36,7 @@ def test_3488_halfmaps():
args = ["em"]
args += ["--contents", sequence_path()]
args += ["--map", halfmap1_path(), halfmap2_path()]
args += ["--mask", mask_path()]
args += ["--resolution", "3.2"]
args += ["--cycles", "1"]
with pytest.raises(SystemExit):
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="3.3.0",
version="3.4.0",
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 51f330b

Please sign in to comment.