Skip to content

Commit

Permalink
Squashed 'modules/pmi/' changes from 6473c8307f..d722206661
Browse files Browse the repository at this point in the history
d722206661 Only make things flexible if asked for
10646dc022 Work around cmake 3.18.3 bug
625dca7985 Migrate to travis-ci.com

git-subtree-dir: modules/pmi
git-subtree-split: d7222066612e0a8bb11726345a88bf24a89e15a8
  • Loading branch information
benmwebb committed Nov 17, 2020
1 parent 295ebe9 commit 2d18e25
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
4 changes: 4 additions & 0 deletions modules/pmi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_policy(SET CMP0058 NEW)
endif(POLICY CMP0058)

if(POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
endif(POLICY CMP0053)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/tools)

set(SWIG_EXECUTABLE swig CACHE STRING "Swig program")
Expand Down
2 changes: 1 addition & 1 deletion modules/pmi/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\brief Python classes to represent, score, sample and analyze models.

[![Build Status](https://travis-ci.org/salilab/pmi.svg?branch=develop)](https://travis-ci.org/salilab/pmi)
[![Build Status](https://travis-ci.com/salilab/pmi.svg?branch=develop)](https://travis-ci.com/salilab/pmi)
[![codecov](https://codecov.io/gh/salilab/pmi/branch/develop/graph/badge.svg)](https://codecov.io/gh/salilab/pmi)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bcced071b3f541449d723a774ea09026)](https://www.codacy.com/app/salilab/pmi?utm_source=github.com&utm_medium=referral&utm_content=salilab/pmi&utm_campaign=Badge_Grade)

Expand Down
15 changes: 7 additions & 8 deletions modules/pmi/pyext/src/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,15 +757,14 @@ def execute_macro(self, max_rb_trans=4.0, max_rb_rot=0.04, max_bead_trans=4.0, m
if dname not in domains_in_rbs:
if domain.pdb_file != "BEADS":
warnings.warn(
"Making %s flexible. This will likely distort "
"the structure. It is strongly recommended to "
"make PDB domains rigid, or use BEADS instead "
"of a PDB file for flexible regions." % dname,
IMP.pmi.StructureWarning)
# Make both "atomic" (i.e. initialized from a PDB file)
# and "non-atomic" (i.e. beads) regions flexible
"No rigid bodies set for %s. Residues read from "
"the PDB file will not be sampled - only regions "
"missing from the PDB will be treated flexibly. "
"To sample the entire sequence, use BEADS instead "
"of a PDB file name" % dname,
IMP.pmi.StructureWarning)
self.dof.create_flexible_beads(
self._domain_res[nstate][dname],
self._domain_res[nstate][dname][1],
max_trans=max_bead_trans)

# add super rigid bodies
Expand Down
12 changes: 5 additions & 7 deletions modules/pmi/test/test_topology_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,15 @@ def test_flexible(self):
with warnings.catch_warnings(record=True) as cw:
warnings.simplefilter("always")
root_hier, dof = bs.execute_macro()
# Both domains (one a PDB, one beads) should be flexible
# There should be 12 flexible beads:
# Residues 1, 2, 5, 6 (taken from the PDB file)
# Both domains (missing regions from PDB, one beads) should be flexible
# There should be 6 flexible beads:
# Beads 3, 4, 7, 8, 9, 10
# Resolution=10 fragments 1-2, 5-6
self.assertEqual(len(dof.get_movers()), 12)
self.assertEqual(len(dof.get_movers()), 6)
self.assertEqual(len(dof.get_rigid_bodies()), 0)
self.assertEqual(len(dof.get_flexible_beads()), 12)
self.assertEqual(len(dof.get_flexible_beads()), 6)
# One warning should be emitted, for the PDB domain
w, = cw
self.assertIn("Making Prot1..0 flexible. This will likely distort",
self.assertIn("No rigid bodies set for Prot1..0.",
str(w.message))
self.assertIs(w.category, IMP.pmi.StructureWarning)

Expand Down

0 comments on commit 2d18e25

Please sign in to comment.