Skip to content

Commit

Permalink
Merge branch 'master' into missing-terminal-parsing
Browse files Browse the repository at this point in the history
# Conflicts:
#	DockerMakefiles/DockerMake.yml
#	DockerMakefiles/Moldesign.yml
#	DockerMakefiles/buildfiles/moldesign/moldesign.yml
  • Loading branch information
avirshup committed Oct 11, 2017
2 parents b687fc4 + 061a5a7 commit 2e170b0
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 65 deletions.
12 changes: 3 additions & 9 deletions DockerMakefiles/CLI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,13 @@ ambertools:
- miniconda
build: |
RUN apt-get update \
&& apt-get install --no-install-recommends -y libgfortran3 \
&& apt-get -y clean && apt-get autoremove -y --purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
&& apt-get install --no-install-recommends -y \
libgfortran3 gcc gfortran libfftw3-dev libnetcdf-dev \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN python -c "print('name = molecular-design-toolkit-builder\ninstitution = Autodesk\ncity = San Francisco\nstate or province = CA\ncountry = USA')" > /root/.amberrc
RUN conda install -qy -c ambermd ambertools=16.21.1
ENV AMBERHOME=/opt/conda/
nucleic_acid_builder:
requires:
- ambertools
build: |
RUN apt-get update \
&& apt-get install --no-install-recommends -y gcc gfortran libfftw3-dev libnetcdf-dev \
&& apt-get -y clean && apt-get autoremove -y --purge && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
dssp:
Expand Down
1 change: 0 additions & 1 deletion DockerMakefiles/DockerMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ _ALL_:
- moldesign_minimal
- moldesign_minimal_py2
- moldesign_notebook
- nucleic_acid_builder
- nwchem_build
- openblas
- pyscf_build
Expand Down
22 changes: 0 additions & 22 deletions DockerMakefiles/Dockerfile.build_environment

This file was deleted.

10 changes: 6 additions & 4 deletions DockerMakefiles/Moldesign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,19 @@ moldesign_notebook:
RUN python -m nbmolviz activate --user
USER root
RUN python -m moldesign copyexamples
RUN chmod -R a+rw .
moldesign_stack:
description: An extra-large image with everything needed to run the example notebooks
build_directory: buildfiles/moldesign
requires:
- moldesign_notebook
- opsin
- symmol_base
- nucleic_acid_builder
- ambertools
- moldesign_notebook
build: |
USER nbuser
RUN mkdir -p ~/.moldesign
ADD moldesign.yml ~/.moldesign/moldesign.yml
RUN mkdir -p /home/nbuser/.moldesign
ADD moldesign.yml /home/nbuser/.moldesign/moldesign.yml
3 changes: 3 additions & 0 deletions DockerMakefiles/PythonTools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ chem_python_conda:
- deploy_requirements
description: All of the external python chemistry libraries in one place
build: |
RUN apt-get update \
&& apt-get install -y libpng12-dev \
&& cleanapt
RUN conda install -qy -c openbabel openbabel=2.4.1
RUN conda install -qy -c omnia \
biopython=1.68 \
Expand Down
2 changes: 1 addition & 1 deletion DockerMakefiles/buildfiles/moldesign/moldesign.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run_local:
nab.exe: true
nab: true
opsin: true
symmol: true
3 changes: 2 additions & 1 deletion DockerMakefiles/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DockerMake >= 0.5.6
DockerMake >= 0.6.0rc2

8 changes: 4 additions & 4 deletions codeship-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ docker_make:
publisher:
encrypted_env_file: deployment/tokens.crypt
build:
context: ./deployment
dockerfile: ./moldesign-complete-cache.dockerfile
context: . # this one builds at the root of the repository
dockerfile: ./deployment/moldesign-complete-cache.dockerfile
add_docker: true
working_dir: /opt/molecular-design-toolkit
volumes:
Expand Down Expand Up @@ -50,8 +50,8 @@ test_moldesign_minimal_py2:
test_moldesign_complete:
encrypted_env_file: deployment/tokens.crypt
build:
context: ./deployment
dockerfile: moldesign-complete-cache.dockerfile
context: ./ # this one builds at the root of the repository
dockerfile: ./deployment/moldesign-complete-cache.dockerfile
cached: false # do not cache this! It gets built before the cache is triggered
working_dir: /opt/molecular-design-toolkit/
add_docker: true
Expand Down
33 changes: 17 additions & 16 deletions codeship-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
service: docker_make
type: serial
steps:
- command:
docker-make -p -n --dockerfile-dir /makefiles
nwchem_build
pyscf_build
deploybase
python_deploy_base
python_deploy_base_py2
- command: docker-make -p -n --dockerfile-dir /makefiles nwchem_build pyscf_build deploybase python_deploy_base python_deploy_base_py2
name: write_dockerfiles
- command: cp buildfiles/deploybase/cleanapt buildfiles/notebook/run_notebook.sh /makefiles
name: copy_contexts
Expand Down Expand Up @@ -70,15 +64,22 @@
steps:
- command: deployment/print_environment.sh

- type: serial
name: complete_tests
services:
- test_moldesign_complete
- test_moldesign_complete_py2
- test_moldesign_minimal
- test_moldesign_minimal_py2
steps:
- command: deployment/codeship_runtests.sh
- service: test_moldesign_complete
name: test_moldesign_complete
command: deployment/codeship_runtests.sh

- service: test_moldesign_complete_py2
name: test_moldesign_complete_py2
command: deployment/codeship_runtests.sh

- service: test_moldesign_minimal
name: test_moldesign_minimal
command: deployment/codeship_runtests.sh

- service: test_moldesign_minimal_py2
name: test_moldesign_minimal_py2
command: deployment/codeship_runtests.sh


- name: publish
service: publisher
Expand Down
5 changes: 4 additions & 1 deletion deployment/moldesign-complete-cache.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# this is meant to built at the ROOT of the repository

FROM moldesign_complete:dev
ADD requirements.txt provision_testrunner_image.sh /tmp/
ADD DockerMakefiles /opt/molecular-design-toolkit/DockerMakefiles
ADD deployment/requirements.txt deployment/provision_testrunner_image.sh /tmp/
RUN cd /tmp && ./provision_testrunner_image.sh
RUN pip install twine
WORKDIR /opt/molecular-design-toolkit
Expand Down
18 changes: 18 additions & 0 deletions moldesign/_tests/test_pdbfixer_xface.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import moldesign as mdt
from moldesign import units as u
from .helpers import get_data_path

import pytest

Expand Down Expand Up @@ -91,6 +92,23 @@ def test_mutation_nomenclature_string_only(pdb3aid):
assert len(mut25) == 2
assert [r.resname for r in mut25] == ['MET', 'MET']

def test_mutation_topology(pdb1yu8):
""" Test the topology of the backbone atoms for a mutated molecule. """
molecule = pdb1yu8
mutation_residues = ["X.13G"]
mutated_molecule = mdt.mutate_residues(molecule, mutation_residues)
# Check that the number of bonds for backbone atoms match.
for res, mut_res in zip(molecule.residues, mutated_molecule.residues):
if not res.backbone:
continue
for atom in res.backbone:
bonds = [bond for bond in molecule.bond_graph[atom] if bond.name in res.backbone]
mut_atom = mutated_molecule.chains["X"].residues[mut_res.name].atoms[atom.name]
mut_bonds = mutated_molecule.bond_graph[mut_atom]
mut_bonds = [bond for bond in mutated_molecule.bond_graph[mut_atom] \
if bond.name in mut_res.backbone]
assert len(bonds) == len(mut_bonds)


@pytest.mark.screening
def test_multiple_mutations(pdb3aid):
Expand Down
12 changes: 10 additions & 2 deletions moldesign/compute/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,19 @@ def init_config():

for pkg, do_remote in list(config.run_remote.items()):
if do_remote:
getattr(packages, pkg).force_remote = True
try:
getattr(packages, pkg).force_remote = True
except AttributeError:
print('WARNING: unknown key "%s" in %s' % (pkg, path),
file=sys.stderr)

for pkg, do_local in list(config.run_local.items()):
if do_local:
getattr(packages, pkg).run_local = True
try:
getattr(packages, pkg).run_local = True
except AttributeError:
print('WARNING: unknown key "%s" in %s' % (pkg, path),
file=sys.stderr)


def _check_override(tagname, expected, path):
Expand Down
2 changes: 1 addition & 1 deletion moldesign/compute/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def make_job(self, **kwargs):

nwchem = InterfacedExecutable('nwchem.exe', None, 'nwchem', version_flag=None)
opsin = InterfacedExecutable('opsin', None, 'opsin', version_flag=None)
nab = InterfacedExecutable('nab', '16', 'nucleic_acid_builder', version_flag=None)
nab = InterfacedExecutable('nab', '16', 'ambertools', version_flag=None)
symmol = InterfacedExecutable('symmol', None, 'symmol', version_flag=None)
tleap = InterfacedExecutable('tleap', '16', 'ambertools', version_flag=None)
antechamber = InterfacedExecutable('antechamber', '16', 'ambertools', version_flag=None)
Expand Down
33 changes: 30 additions & 3 deletions moldesign/interfaces/pdbfixer_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,48 @@ def mutate_residues(mol, residue_map):
# into an MDT structure
assert temp_mutant.num_residues == mol.num_residues # shouldn't change number of residues
residues_to_copy = []
old_residue_map = {}
for oldres, mutant_res in zip(mol.residues, temp_mutant.residues):
if oldres in residue_map:
residues_to_copy.append(mutant_res)
mutant_res.mol = None
mutant_res.chain = oldres.chain
old_residue_map[oldres] = mutant_res
else:
residues_to_copy.append(oldres)

# Bonds between original and mutated backbone atoms will be removed when
# creating the new mutant molecule because the original and mutated atoms
# reference different molecules.
#
# Make a list of bonds referencing atoms in the original molecule that
# is used later to recreate bonds between original and mutated backbone
# atoms.
orig_bonds = []
for res in residues_to_copy:
if not res.backbone:
continue
for atom in res.backbone:
for bond_atom in atom.bond_graph:
if bond_atom.residue in residue_map:
mutant_res = old_residue_map[bond_atom.residue]
mutant_atom = mutant_res.atoms[bond_atom.name]
orig_bonds.append((atom,mutant_atom,atom.bond_graph[bond_atom]))

metadata = {'origin': mol.metadata.copy(),
'mutations': mutation_strs}

return mdt.Molecule(residues_to_copy,
name='Mutant of "%s"' % mol,
metadata=metadata)
mutant_mol = mdt.Molecule(residues_to_copy, name='Mutant of "%s"' % mol, metadata=metadata)

# Add bonds between the original and mutated backbone atoms.
for atom,mut_atom,order in orig_bonds:
chainID = atom.chain.name
residues = mutant_mol.chains[chainID].residues
new_atom = residues[atom.residue.name].atoms[atom.name]
new_mut_atom = residues[mut_atom.residue.name].atoms[mut_atom.name]
new_atom.bond_to(new_mut_atom, order)

return mutant_mol

def _pdbfixer_chainnames_to_letter(pdbfixermol):
for chain in pdbfixermol.chains:
Expand Down

0 comments on commit 2e170b0

Please sign in to comment.