@@ -74,10 +74,10 @@ def detect_target_repo_comment(comments: List[Comment]) -> Comment:
7474
7575def is_assay_for_target_repo (assay : Assay , target_repo : str ) -> bool :
7676 """
77- Defines whether the assays is meant for the target repository.
77+ Defines whether the assays are meant for the target repository.
7878
7979 Args:
80- assay_dict (Dict[str, str] ): Dictionary representation of an assay .
80+ assay (Assay ): Assay model .
8181 target_repo (TargetRepository): Target repository as a constant.
8282
8383 Returns:
@@ -484,6 +484,7 @@ def update_isa_json(isa_json: IsaJson, repo_response: RepositoryResponse) -> Isa
484484
485485 add_accession_to_data_file_node (updated_node , accession .value )
486486 else :
487+ # Add study accession to study comments
487488 updated_study = apply_filter (study_filter , investigation .studies )
488489
489490 study_accession_comment : Comment = Comment (
@@ -492,6 +493,20 @@ def update_isa_json(isa_json: IsaJson, repo_response: RepositoryResponse) -> Isa
492493 )
493494 updated_study .comments .append (study_accession_comment )
494495
496+ # Add study accession to assay comments
497+ updated_assay = next (
498+ filter (
499+ lambda assay : is_assay_for_target_repo (assay , target_repository ),
500+ updated_study .assays ,
501+ ),
502+ None ,
503+ )
504+ if updated_assay :
505+ assay_accession_comment : Comment = Comment (
506+ name = f"{ target_repository } _{ target_level } _accession" ,
507+ value = accession .value ,
508+ )
509+ updated_assay .comments .append (assay_accession_comment )
495510 isa_json .investigation = investigation
496511 return isa_json
497512
0 commit comments