Skip to content

Commit 7c33808

Browse files
committed
Create a dummy residue with a single CA atom
1 parent 616befd commit 7c33808

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lightdock/structure/residue.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Module to package a complex residue representation and operations"""
22

33
from lightdock.error.lightdock_errors import ResidueNonStandardError, SideChainError, BackboneError
4+
from lightdock.structure.atom import Atom
45

56

67
backbone = ["N", "CA", "C", "O"]
@@ -114,6 +115,11 @@ def mutate_side_chain(self, rotamer):
114115
"""Moves this residue's side chain using the rotamer angles"""
115116
pass
116117

118+
@staticmethod
119+
def dummy(x=0., y=0., z=0.):
120+
atom = Atom(atom_name='CA', residue_name='DUM', x=x, y=y, z=z)
121+
return Residue(residue_name='DUM', residue_number=0, atoms=[atom])
122+
117123
def __str__ (self):
118124
if len(self.atoms):
119125
representation = []

lightdock/test/structure/test_residue.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ def test_backbone_sidechain(self):
6464
assert 'CB' == residue.sidechain[0].name
6565
assert 4 == len(residue.backbone)
6666

67+
def test_dummy_residue(self):
68+
dummy = Residue.dummy(1.0, 2.0, 3.0)
69+
70+
assert 1 == len(dummy.atoms)
71+
assert 'CA' == dummy.atoms[0].name
72+
assert " CA 1.000 2.000 3.000" == str(dummy.atoms[0])
73+
6774

6875
class TestAminoAcid:
6976

0 commit comments

Comments
 (0)