This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Coos Baakman
committed
Mar 31, 2021
1 parent
66184e7
commit 0f6bb59
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |