Skip to content

Commit

Permalink
Add tests comparing output to foldseek gold standard
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Nov 25, 2023
1 parent 532a767 commit 4446861
Show file tree
Hide file tree
Showing 4 changed files with 12,660 additions and 0 deletions.
61 changes: 61 additions & 0 deletions tests/__init__.py
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",
)
Loading

0 comments on commit 4446861

Please sign in to comment.