-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests comparing output to
foldseek
gold standard
- Loading branch information
Showing
4 changed files
with
12,660 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,61 @@ | ||
import unittest | ||
import importlib.resources | ||
|
||
import Bio.PDB | ||
from mini3di import Encoder | ||
|
||
|
||
class TestEncoder(unittest.TestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
cls.encoder = Encoder() | ||
cls.parser = Bio.PDB.PDBParser(QUIET=True) | ||
|
||
@classmethod | ||
def get_structure(cls, name): | ||
path = importlib.resources.files(__package__).joinpath("data", name).with_suffix(".pdb") | ||
return cls.parser.get_structure(name, path) | ||
|
||
def test_encode_3bww(self): | ||
structure = self.get_structure("3bww") | ||
states = self.encoder.encode_chain(structure[0]["A"]) | ||
sequence = self.encoder.build_sequence(states) | ||
self.assertEqual( | ||
sequence, | ||
"DKDFFEAAEDDLVCLVVLLPPPACPQRQAYEDALVVQVPDDPVSVVSVVNSLVHHAYAYEYEAQQL" | ||
"LDDPQGDVVSLVSVLVCCVVSVPQEYEYENDPPDADALDVVSLVSSLVSQLVSCVSSVGAYAYEDA" | ||
"ADQDHDPRHPDDVLVSRQSNCVSNVHAHAYELVRLVRCCVRPVPDDSLVSLVRHPLQRHQHYEYQV" | ||
"VSVVSVLVNLVDHQAHHYYYHDYPDDVVVNSVVRVVSRVSNVVSCVVVVHYIDMD", | ||
) | ||
|
||
def test_encode_8crb(self): | ||
structure = self.get_structure("8crb") | ||
|
||
states = self.encoder.encode_chain(structure[0]["A"]) | ||
sequence = self.encoder.build_sequence(states) | ||
self.assertEqual( | ||
sequence, | ||
"DWAKDKDWADEDAAQAKTKIKMATPPDLLQDFFKFKWFDAPPDDIDGQAPGACPSPPLADDVHHHH" | ||
"GKGWHDDSVRRMIMIMGGNDDQVVFGKMKMFTADDADPQVVVPDGDDTDDMHDIDTYGHPPDDFFA" | ||
"WDKDKDQDDPVPCPVQKPKIKMKTDDGDDDDKDKAWLVNPGDPQKDDFDWDADPVRGIIDMIIGMD" | ||
"GNVCFQVGFTKIWMAGVVVRDIDIDGGHD", | ||
) | ||
|
||
states = self.encoder.encode_chain(structure[0]["B"]) | ||
sequence = self.encoder.build_sequence(states) | ||
self.assertEqual( | ||
sequence, | ||
"DAAKDFDQQEEEAAQAKDKGWIFAADVPPVPDAFWKWWDAPPDDIDTAADPNQAGDPVDHSQKGWD" | ||
"ADHGITIIMGGRDDNSRQGFIWRAQPDDPDHNGHTDDTHGYYHCPDDQDDKDKDWDDAAVVVLVVL" | ||
"FGKTKIKIDDGDDPPKDKFKDLQNHTDDAQWDWDDWDLDPVRTIMTMIIRRDGVVSCVVSQKMKMW" | ||
"IDDDVHTDIDMDGNVVHD", | ||
) | ||
|
||
states = self.encoder.encode_chain(structure[0]["C"]) | ||
sequence = self.encoder.build_sequence(states) | ||
self.assertEqual( | ||
sequence, | ||
"DPCVLVVLVLQLVLVVLLLVVVVVVLVVCVVVLFKDWQDPVHDWQLACVSPDHDCPDCCSVPGSNN" | ||
"VQQCPKPLDDVTATNQSVQQIDDGDLDHDDDDDTIQGCPPPVRCSVVVVVVSVVSVVVSVVSCVVS" | ||
"VVVVVVD", | ||
) |
Oops, something went wrong.