def test_bad_is_rna_available(self): ModelValidator.validate_patient( Patient(identifier="123", is_rna_available=True), ORGANISM_HOMO_SAPIENS) ModelValidator.validate_patient( Patient(identifier="123", is_rna_available=False), ORGANISM_HOMO_SAPIENS) self.assertRaises(NeofoxDataValidationException, ModelValidator.validate_patient, Patient(identifier="123", is_rna_available="False"), ORGANISM_HOMO_SAPIENS)
def test_empty_patient_identifier(self): patient = Patient(identifier=None) self.assertRaises(NeofoxDataValidationException, ModelValidator.validate_patient, patient, ORGANISM_HOMO_SAPIENS) patient = Patient(identifier="") self.assertRaises(NeofoxDataValidationException, ModelValidator.validate_patient, patient, ORGANISM_HOMO_SAPIENS) patient = Patient(identifier=" ") self.assertRaises(NeofoxDataValidationException, ModelValidator.validate_patient, patient, ORGANISM_HOMO_SAPIENS)
def test_valid_hla_i_genotype(self): self._assert_valid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.A, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele("HLA-A01:01"), self.hla_parser.parse_mhc_allele("HLA-A01:02"), ], ), Mhc1( name=Mhc1Name.B, zygosity=Zygosity.HOMOZYGOUS, alleles=[self.hla_parser.parse_mhc_allele("HLA-B01:01")], ), Mhc1( name=Mhc1Name.C, zygosity=Zygosity.HEMIZYGOUS, alleles=[self.hla_parser.parse_mhc_allele("HLA-C01:01")], ), ], ), organism=ORGANISM_HOMO_SAPIENS)
def test_bad_type_raises_exception(self): self.assertRaises( NeofoxDataValidationException, ModelValidator.validate, Neoantigen( patient_identifier= 1234, # this should be a string instead of an integer rna_expression=0.45, ), ) self.assertRaises( NeofoxDataValidationException, ModelValidator.validate, Neoantigen(patient_identifier="1234", rna_expression="0.45"), ) # this should be a float) self.assertRaises( NeofoxDataValidationException, ModelValidator.validate, Patient(identifier="1234", is_rna_available="Richtig"), ) # this should be a boolean) # TODO: make validation capture this data types errors! ModelValidator.validate( Neoantigen( patient_identifier=[ "12345" ], # this should be a string instead of a list of strings rna_expression=0.45, ))
def validate_patient(patient: Patient, organism=ORGANISM_HOMO_SAPIENS): # checks format consistency first ModelValidator.validate(patient) try: # checks that patient id is not empty considering white spaces patient_id = patient.identifier.strip() if patient.identifier else patient.identifier assert patient_id is not None and patient_id != "", "A patient identifier is missing" assert patient.identifier == patient.identifier.strip(), \ "Patient identifier contains white spaces at start or end: {}".format(patient.identifier) # checks MHC I if patient.mhc1: for m in patient.mhc1: ModelValidator._validate_mhc1(m, organism=organism) # checks MHC II if patient.mhc2: for m in patient.mhc2: ModelValidator._validate_mhc2(m, organism=organism) except AssertionError as e: logger.error(patient.to_json(indent=3)) raise NeofoxDataValidationException(e)
def test_valid_h2_i_genotype(self): self._assert_valid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.H2D, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Dd"), self.h2_parser.parse_mhc_allele("H2Da"), ], ), Mhc1( name=Mhc1Name.H2L, zygosity=Zygosity.HOMOZYGOUS, alleles=[self.h2_parser.parse_mhc_allele("H2Ld")], ), Mhc1( name=Mhc1Name.H2K, zygosity=Zygosity.HEMIZYGOUS, alleles=[self.h2_parser.parse_mhc_allele("H2Kk")], ), ], ), organism=ORGANISM_MUS_MUSCULUS)
def annotate_neoantigen(neoantigen: Neoantigen, patient: Patient, reference_folder: ReferenceFolder, configuration: DependenciesConfiguration, tcell_predictor: TcellPrediction, self_similarity: SelfSimilarityCalculator, log_file_name: str, affinity_threshold=AFFINITY_THRESHOLD_DEFAULT): # the logs need to be initialised inside every dask job NeoFox._initialise_logs(log_file_name) logger.info("Starting neoantigen annotation with peptide={}".format( neoantigen.mutation.mutated_xmer)) start = time.time() try: annotated_neoantigen = NeoantigenAnnotator( reference_folder, configuration, tcell_predictor=tcell_predictor, self_similarity=self_similarity, affinity_threshold=affinity_threshold).get_annotation( neoantigen, patient) except Exception as e: logger.error("Error processing neoantigen {}".format( neoantigen.to_dict())) logger.error("Error processing patient {}".format( patient.to_dict())) raise e end = time.time() logger.info( "Elapsed time for annotating neoantigen for peptide={}: {} seconds" .format(neoantigen.mutation.mutated_xmer, int(end - start))) return annotated_neoantigen
def test_good_data_does_not_raise_exceptions(self): neoantigen = Neoantigen(patient_identifier="1234", rna_expression=0.45) ModelValidator.validate(neoantigen) patient = Patient(identifier="1234", is_rna_available=True) ModelValidator.validate(patient)
def test_valid_h2_ii_genotype(self): patient = Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.H2A_molecule, genes=[ Mhc2Gene( name=Mhc2GeneName.H2A, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Ad"), self.h2_parser.parse_mhc_allele("H2Ap"), ], ) ], isoforms=[ self.h2_parser.parse_mhc2_isoform("H2Ad"), self.h2_parser.parse_mhc2_isoform("H2Ap"), ], ) ], ) self._assert_valid_patient(patient=patient, organism=ORGANISM_MUS_MUSCULUS) patient2 = Patient( identifier="123", mhc2=[ Mhc2(name=Mhc2Name.H2E_molecule, genes=[ Mhc2Gene( name=Mhc2GeneName.H2E, zygosity=Zygosity.HOMOZYGOUS, alleles=[self.h2_parser.parse_mhc_allele("H2Ed")]) ], isoforms=[self.h2_parser.parse_mhc2_isoform("H2Ed")]) ]) self._assert_valid_patient(patient=patient2, organism=ORGANISM_MUS_MUSCULUS)
def build_patient(identifier, is_rna_available=False, tumor_type=None, mhc_alleles: List = [], mhc2_alleles: List = [], mhc_database: MhcDatabase = None): patient = Patient( identifier=identifier, is_rna_available=is_rna_available, tumor_type=tumor_type, mhc1=MhcFactory.build_mhc1_alleles(mhc_alleles, mhc_database), mhc2=MhcFactory.build_mhc2_alleles(mhc2_alleles, mhc_database)) ModelValidator.validate_patient(patient=patient, organism=mhc_database.organism) return patient
def test_neoantigen_no_wt_failing(self): patient_identifier = "12345" neoantigen = Neoantigen( mutation=Mutation(mutated_xmer="SPSFPLEPDDEVFTAIAKAMEEMVEDS"), patient_identifier=patient_identifier) patient = Patient( identifier=patient_identifier, mhc1=MhcFactory.build_mhc1_alleles( [ "HLA-A*02:24", "HLA-A*36:04", "HLA-B*58:25", "HLA-B*35:102", "HLA-C*02:30", "HLA-C*07:139" ], mhc_database=self.references.get_mhc_database()), ) annotations = NeoFox( neoantigens=[neoantigen], patients=[patient], num_cpus=1, ).get_annotations() # it does not crash even though there are no best 9mers self.assertIsNotNone(annotations)
def patient(self) -> Patient: patient = None found = False while not found: dr_isoforms = self.random_elements(self.get_hla_ii_alleles_by_gene(Mhc2Name.DR), unique=True, length=2) dp_isoforms = self.random_elements(self.get_hla_ii_alleles_by_gene(Mhc2Name.DP), unique=True, length=2) dq_isoforms = self.random_elements(self.get_hla_ii_alleles_by_gene(Mhc2Name.DQ), unique=True, length=2) # NOTE: for some reason some DP alleles are malformed and cause a validation error, most do not. # thus I retry until I get a valid combination of HLA alleles, will clarify in another reincarnation try: patient = Patient( identifier=self.generator.unique.uuid4(), is_rna_available=True, tumor_type=self.random_elements(self.available_tumor_types, length=1)[0], # by setting unique=True we enforce that all patients are heterozygous mhc1=MhcFactory.build_mhc1_alleles( self.random_elements(self.get_hla_i_alleles_by_gene(Mhc1Name.A), unique=True, length=2) + self.random_elements(self.get_hla_i_alleles_by_gene(Mhc1Name.B), unique=True, length=2) + self.random_elements(self.get_hla_i_alleles_by_gene(Mhc1Name.C), unique=True, length=2), self.hla_database ), mhc2=MhcFactory.build_mhc2_alleles( [i.alpha_chain.name for i in dp_isoforms] + [i.beta_chain.name for i in dp_isoforms] + [i.alpha_chain.name for i in dq_isoforms] + [i.beta_chain.name for i in dq_isoforms] + [i.beta_chain.name for i in dr_isoforms], self.hla_database ) ) ModelValidator.validate_patient(patient) except NeofoxDataValidationException: continue found = True return patient
def test_neoantigen_failing(self): patient_identifier = "12345" neoantigen = Neoantigen(mutation=Mutation( wild_type_xmer="ARPDMFCLFHGKRYFPGESWHPYLEPQ", mutated_xmer="ARPDMFCLFHGKRHFPGESWHPYLEPQ"), patient_identifier=patient_identifier) patient = Patient( identifier=patient_identifier, mhc1=MhcFactory.build_mhc1_alleles( [ "HLA-A*03:01", "HLA-A*29:02", "HLA-B*07:02", "HLA-B*44:03", "HLA-C*07:02", "HLA-C*16:01" ], mhc_database=self.references.get_mhc_database()), ) annotations = NeoFox( neoantigens=[neoantigen], patients=[patient], num_cpus=1, ).get_annotations() # it does not crash even though there are no best 9mers self.assertIsNotNone(annotations)
def test_invalid_hla_i_genotype(self): # 3 alleles for gene A self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.A, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele("HLA-A01:01"), self.hla_parser.parse_mhc_allele("HLA-A01:02"), self.hla_parser.parse_mhc_allele("HLA-A01:03"), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # 2 alleles for homozygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.A, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele("HLA-A01:01"), self.hla_parser.parse_mhc_allele("HLA-A01:02"), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # 1 alleles for heterozygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.A, zygosity=Zygosity.HETEROZYGOUS, alleles=[self.hla_parser.parse_mhc_allele("HLA-A01:01")], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # 1 alleles for hemizygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.A, zygosity=Zygosity.HEMIZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele("HLA-A01:01"), self.hla_parser.parse_mhc_allele("HLA-A01:02"), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # alleles referring to a different gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.A, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele("HLA-B01:01"), self.hla_parser.parse_mhc_allele("HLA-B01:02"), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS)
def test_invalid_h2_i_genotype(self): # 3 alleles for gene A self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.H2D, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Dd"), self.h2_parser.parse_mhc_allele("H2Dk"), self.h2_parser.parse_mhc_allele("H2Dp"), ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # 2 alleles for homozygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.H2D, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Dd"), self.h2_parser.parse_mhc_allele("H2Dk"), ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # 1 alleles for heterozygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.H2D, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Dd"), ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # 2 alleles for hemizygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.H2D, zygosity=Zygosity.HEMIZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Dd"), self.h2_parser.parse_mhc_allele("H2Dk"), ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # alleles referring to a different gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc1=[ Mhc1( name=Mhc1Name.H2D, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Kd"), self.h2_parser.parse_mhc_allele("H2Kk"), ], ) ], ), organism=ORGANISM_MUS_MUSCULUS)
def test_valid_hla_ii_genotype(self): patient = Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DQ, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01"), self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:02"), ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01") ], ), ], isoforms=[ self.hla_parser.parse_mhc2_isoform( "HLA-DQA1*01:01-DQB1*01:01"), self.hla_parser.parse_mhc2_isoform( "HLA-DQA1*01:02-DQB1*01:01"), ], ) ], ) self._assert_valid_patient(patient=patient, organism=ORGANISM_HOMO_SAPIENS) patient2 = Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DR, genes=[ Mhc2Gene( name=Mhc2GeneName.DRB1, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DRB1*01:01") ], ) ], isoforms=[ self.hla_parser.parse_mhc2_isoform("HLA-DRB1*01:01") ], ) ], ) self._assert_valid_patient(patient=patient2, organism=ORGANISM_HOMO_SAPIENS) patient3 = Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DQ, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01"), self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:02"), ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01") ], ), ], isoforms=[ self.hla_parser.parse_mhc2_isoform( "HLA-DQA1*01:01-DQB1*01:01"), self.hla_parser.parse_mhc2_isoform( "HLA-DQA1*01:02-DQB1*01:01"), ], ) ], ) self._assert_valid_patient(patient=patient3, organism=ORGANISM_HOMO_SAPIENS)
def test_invalid_h2_ii_genotype(self): # 3 alleles for gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.H2E_molecule, genes=[ Mhc2Gene( name=Mhc2GeneName.H2E, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Ea"), self.h2_parser.parse_mhc_allele("H2Eb"), self.h2_parser.parse_mhc_allele("H2Ec"), ], ) ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # 2 alleles for homozygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.H2A_molecule, genes=[ Mhc2Gene( name=Mhc2GeneName.H2A, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.h2_parser.parse_mhc_allele("H2Aa"), self.h2_parser.parse_mhc_allele("H2Ab"), ], ), ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # 1 alleles for heterozygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.H2A_molecule, genes=[ Mhc2Gene( name=Mhc2GeneName.H2A, zygosity=Zygosity.HETEROZYGOUS, alleles=[self.h2_parser.parse_mhc_allele("H2Aa")], ) ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # 1 alleles for hemizygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.H2A_molecule, genes=[ Mhc2Gene( name=Mhc2GeneName.H2A, zygosity=Zygosity.HETEROZYGOUS, alleles=[self.h2_parser.parse_mhc_allele("H2Aa")], ) ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # alleles referring to a different gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.H2A_molecule, genes=[ Mhc2Gene( name=Mhc2GeneName.H2A, zygosity=Zygosity.HETEROZYGOUS, alleles=[self.h2_parser.parse_mhc_allele("H2Ea")], ), ], ) ], ), organism=ORGANISM_MUS_MUSCULUS) # MHC and gene referring to different entities self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.H2A_molecule, genes=[ Mhc2Gene( name=Mhc2GeneName.H2E, zygosity=Zygosity.HETEROZYGOUS, alleles=[self.h2_parser.parse_mhc_allele("H2Ea")], ), ], ) ], ), organism=ORGANISM_MUS_MUSCULUS)
def test_invalid_hla_ii_genotype(self): # 3 alleles for gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DQ, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01"), self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:02"), self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:03"), ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01") ], ), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # 2 alleles for homozygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DQ, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01"), self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:02"), ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01"), self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:02"), ], ), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # 1 alleles for heterozygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DQ, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01") ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01") ], ), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # 1 alleles for hemizygous gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DQ, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01") ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HEMIZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01") ], ), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # alleles referring to a different gene self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DQ, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01") ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HEMIZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01") ], ), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # MHC and gene referring to different entities self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DP, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01") ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HEMIZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01") ], ), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS) # Molecules refer to alleles not in the MHC self._assert_invalid_patient(patient=Patient( identifier="123", mhc2=[ Mhc2( name=Mhc2Name.DQ, genes=[ Mhc2Gene( name=Mhc2GeneName.DQA1, zygosity=Zygosity.HETEROZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:01"), self.hla_parser.parse_mhc_allele( "HLA-DQA1*01:02"), ], ), Mhc2Gene( name=Mhc2GeneName.DQB1, zygosity=Zygosity.HOMOZYGOUS, alleles=[ self.hla_parser.parse_mhc_allele( "HLA-DQB1*01:01") ], ), ], isoforms=[ Mhc2Isoform(name="HLA-DQA1*01:04-DQB1*01:01"), Mhc2Isoform(name="HLA-DQA1*01:08-DQB1*01:01"), ], ) ], ), organism=ORGANISM_HOMO_SAPIENS)
def _get_test_patient(self): return Patient(identifier="12345", is_rna_available=True)