Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
use this object to select a mutant
Browse files Browse the repository at this point in the history
  • Loading branch information
Coos Baakman committed Mar 31, 2021
1 parent 66184e7 commit 0f6bb59
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
33 changes: 33 additions & 0 deletions deeprank/models/mutant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@


class PdbMutantSelection:
"""Refers to a mutant in a pdb file.
Args:
pdb_path (str): on disk file path to the pdb file
chain_id (str): chain within the pdb file, where the mutant is
residue_number (int): the identifying number of the residue within the protein chain
mutant_amino_acid (str): one letter code of the amino acid to place at this position
"""

def __init__(self, pdb_path, chain_id, residue_number, mutant_amino_acid):
self._pdb_path = pdb_path
self._chain_id = chain_id
self._residue_number = residue_number
self._mutant_amino_acid = mutant_amino_acid

@property
def pdb_path(self):
return self._pdb_path

@property
def chain_id(self):
return self._chain_id

@property
def residue_number(self):
return self._residue_number

@property
def mutant_amino_acid(self):
return self._mutant_amino_acid
21 changes: 21 additions & 0 deletions test/models/test_mutant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from nose.tools import eq_

from deeprank.models.mutant import PdbMutantSelection


def test_instance():

pdb_path = "1AK4/decoys/1AK4_cm-it0_745.pdb"
chain_id = "A"
residue_number = 10
mutant_amino_acid = "Q"

selection = PdbMutantSelection(pdb_path, chain_id, residue_number, mutant_amino_acid)

eq_(selection.chain_id, chain_id)

eq_(selection.residue_number, residue_number)

eq_(selection.pdb_path, pdb_path)

eq_(selection.mutant_amino_acid, mutant_amino_acid)

0 comments on commit 0f6bb59

Please sign in to comment.