@@ -314,6 +314,10 @@ def test_fake_cna():
314314 fake_gene_one_query_suite (annotations , True )
315315
316316
317+ def assert_treatments_equal (actual , expected ):
318+ assert set (actual .split (',' )) == set (expected .split (',' ))
319+
320+
317321def check_brca2_s1882_without_cancertype (annotation , genomic_query = False ):
318322 assert len (annotation ) == NUMBER_OF_GC_ANNOTATION_COLUMNS if genomic_query else NUMBER_OF_ANNOTATION_COLUMNS
319323 assert annotation [(
@@ -322,12 +326,18 @@ def check_brca2_s1882_without_cancertype(annotation, genomic_query=False):
322326 NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + ONCOGENIC_INDEX ) if genomic_query else ONCOGENIC_INDEX ] == 'Likely Oncogenic'
323327 assert annotation [(
324328 NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + HIGHEST_LEVEL_INDEX ) if genomic_query else HIGHEST_LEVEL_INDEX ] == 'LEVEL_1'
325- assert annotation [(
326- NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_1_INDEX ) if genomic_query else LEVEL_1_INDEX ] == 'Olaparib,Olaparib+Bevacizumab,Rucaparib,Olaparib+Abiraterone+Prednisone,Niraparib,Talazoparib+Enzalutamide,Niraparib+Abiraterone Acetate+Prednisone'
327- assert annotation [(
328- NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_2_INDEX ) if genomic_query else LEVEL_2_INDEX ] == 'Olaparib,Rucaparib,Niraparib'
329- assert annotation [(
330- NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_3A_INDEX ) if genomic_query else LEVEL_3A_INDEX ] == 'Olaparib,Talazoparib'
329+ assert_treatments_equal (
330+ annotation [(NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_1_INDEX ) if genomic_query else LEVEL_1_INDEX ],
331+ 'Olaparib,Olaparib+Bevacizumab,Rucaparib,Olaparib+Abiraterone+Prednisone,Niraparib,Talazoparib+Enzalutamide,Niraparib+Abiraterone Acetate+Prednisone'
332+ )
333+ assert_treatments_equal (
334+ annotation [(NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_2_INDEX ) if genomic_query else LEVEL_2_INDEX ],
335+ 'Olaparib,Rucaparib,Niraparib'
336+ )
337+ assert_treatments_equal (
338+ annotation [(NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_3A_INDEX ) if genomic_query else LEVEL_3A_INDEX ],
339+ 'Olaparib,Talazoparib'
340+ )
331341
332342
333343@pytest .mark .skipif (ONCOKB_API_TOKEN in (None , '' ), reason = "oncokb api token required" )
0 commit comments