def test_exists(self): hla_database = FakeHlaDatabase() self.assertTrue( hla_database.exists( MhcAllele(gene="DPB1", group="104", protein="01"))) self.assertFalse( hla_database.exists( MhcAllele(gene="DPB1", group="10", protein="401"))) self.assertTrue( hla_database.exists(MhcAllele(gene="B", group="15", protein="228"))) self.assertFalse( hla_database.exists(MhcAllele(gene="B", group="152", protein="28"))) # badly formed HLA alleles self.assertFalse( hla_database.exists(MhcAllele(gene="B", group="15", protein=None))) self.assertFalse( hla_database.exists(MhcAllele(gene="B", group=None, protein="228"))) self.assertFalse( hla_database.exists(MhcAllele(gene=None, group="15", protein="228"))) self.assertFalse( hla_database.exists(MhcAllele(gene="Z", group="15", protein="228")))
def test_hla_database(self): hla_database = FakeHlaDatabase() self.assertIsNotNone(hla_database) self.assertIsNotNone(hla_database.alleles) self.assertTrue(len(hla_database.alleles) > 1000) self.assertTrue("DPB1*104:01" in hla_database.alleles) self.assertFalse("DPB1*10:401" in hla_database.alleles) self.assertTrue("B*15:228" in hla_database.alleles) self.assertFalse("B*152:28" in hla_database.alleles)
def setUp(self) -> None: faker = Faker() self.patient_provider = PatientProvider(faker, [ "HLA-A*01:01", "HLA-A*01:02", "HLA-A*01:03", "HLA-B*01:01", "HLA-B*01:02", "HLA-B*01:03", "HLA-C*01:01", "HLA-C*01:02", "HLA-C*01:03" ], [ "DRB10101", "DRB10102", "DRB10103", "DRB10104", "HLA-DPA10101-DPB10101", "HLA-DPA10102-DPB10102", "HLA-DPA10103-DPB10103", "HLA-DPA10104-DPB10104" "HLA-DQA10101-DQB10101", "HLA-DQA10102-DQB10102", "HLA-DQA10103-DQB10103", "HLA-DQA10104-DQB10104" ], FakeHlaDatabase()) self.neoantigen_provider = NeoantigenProvider( faker, proteome_fasta=pkg_resources.resource_filename( neofox.tests.__name__, "resources/proteome_test.fa"))
def setUp(self) -> None: self.hla_database = FakeHlaDatabase()
def setUp(self) -> None: self.mhc_parser = MhcParser.get_mhc_parser(FakeHlaDatabase())