@@ -403,6 +403,73 @@ def mip_rna_analysis_hk_bundle_data(
403
403
}
404
404
405
405
406
+ @pytest .fixture (scope = "function" )
407
+ def tomte_analysis_hk_bundle_data (
408
+ rna_case_id : str ,
409
+ timestamp : datetime ,
410
+ tomte_analysis_dir : Path ,
411
+ rna_sample_son_id : str ,
412
+ rna_sample_daughter_id : str ,
413
+ rna_sample_mother_id : str ,
414
+ rna_sample_father_id : str ,
415
+ ) -> dict :
416
+ """Return MIP RNA bundle data for Housekeeper."""
417
+
418
+ files : list [dict ] = [
419
+ {
420
+ "path" : Path (tomte_analysis_dir , f"{ rna_case_id } .cram" ).as_posix (),
421
+ "archive" : False ,
422
+ "tags" : ["cram" , rna_case_id ],
423
+ },
424
+ {
425
+ "path" : Path (tomte_analysis_dir , f"{ rna_case_id } _report.selected.pdf" ).as_posix (),
426
+ "archive" : False ,
427
+ "tags" : ["fusion" , "pdf" , "clinical" , rna_case_id ],
428
+ },
429
+ {
430
+ "path" : Path (tomte_analysis_dir , f"{ rna_case_id } _report.pdf" ).as_posix (),
431
+ "archive" : False ,
432
+ "tags" : ["fusion" , "pdf" , "research" , rna_case_id ],
433
+ },
434
+ {
435
+ "path" : Path (tomte_analysis_dir , f"{ rna_case_id } _report.pdf" ).as_posix (),
436
+ "archive" : False ,
437
+ "tags" : ["delivery-report" , "rna" , rna_case_id ],
438
+ },
439
+ ]
440
+ for sample_id in [
441
+ rna_sample_son_id ,
442
+ rna_sample_daughter_id ,
443
+ rna_sample_mother_id ,
444
+ rna_sample_father_id ,
445
+ ]:
446
+ files .extend (
447
+ [
448
+ {
449
+ "path" : Path (
450
+ tomte_analysis_dir , f"{ sample_id } _lanes_1_star_sorted_sj.bigWig"
451
+ ).as_posix (),
452
+ "archive" : False ,
453
+ "tags" : ["coverage" , "bigwig" , "scout" , sample_id ],
454
+ },
455
+ {
456
+ "path" : Path (
457
+ tomte_analysis_dir , f"{ sample_id } _lanes_1234_star_sorted_sj.bed.gz.tbi"
458
+ ).as_posix (),
459
+ "archive" : False ,
460
+ "tags" : ["bed" , "scout" , "junction" , sample_id ],
461
+ },
462
+ ]
463
+ )
464
+
465
+ return {
466
+ "name" : rna_case_id ,
467
+ "created" : timestamp ,
468
+ "expires" : timestamp ,
469
+ "files" : files ,
470
+ }
471
+
472
+
406
473
@pytest .fixture (scope = "function" )
407
474
def balsamic_analysis_hk_bundle_data (
408
475
case_id : str ,
@@ -515,6 +582,15 @@ def mip_rna_analysis_hk_api(
515
582
return housekeeper_api
516
583
517
584
585
+ @pytest .fixture
586
+ def tomte_analysis_hk_api (
587
+ housekeeper_api : MockHousekeeperAPI , tomte_analysis_hk_bundle_data : dict , helpers
588
+ ) -> MockHousekeeperAPI :
589
+ """Return a Housekeeper API populated with MIP RNA analysis files."""
590
+ helpers .ensure_hk_version (housekeeper_api , tomte_analysis_hk_bundle_data )
591
+ return housekeeper_api
592
+
593
+
518
594
@pytest .fixture
519
595
def balsamic_analysis_hk_api (
520
596
housekeeper_api : MockHousekeeperAPI , balsamic_analysis_hk_bundle_data : dict , helpers
@@ -706,6 +782,29 @@ def upload_mip_analysis_scout_api(
706
782
)
707
783
708
784
785
+ @pytest .fixture
786
+ def upload_tomte_analysis_scout_api (
787
+ cg_context : CGConfig ,
788
+ scout_api : MockScoutAPI ,
789
+ madeline_api : MockMadelineAPI ,
790
+ lims_samples : list [dict ],
791
+ tomte_analysis_hk_api : MockHousekeeperAPI ,
792
+ store : Store ,
793
+ ) -> Generator [UploadScoutAPI , None , None ]:
794
+ """Return MIP upload Scout API."""
795
+ analysis_mock = MockMipAnalysis (config = cg_context , workflow = Workflow .TOMTE )
796
+ lims_api = MockLimsAPI (samples = lims_samples )
797
+
798
+ yield UploadScoutAPI (
799
+ hk_api = tomte_analysis_hk_api ,
800
+ scout_api = scout_api ,
801
+ madeline_api = madeline_api ,
802
+ analysis_api = analysis_mock ,
803
+ lims_api = lims_api ,
804
+ status_db = store ,
805
+ )
806
+
807
+
709
808
@pytest .fixture
710
809
def upload_balsamic_analysis_scout_api (
711
810
cg_context : CGConfig ,
0 commit comments