Exemplo n.º 1
0
    def get_delivery_report_from_hk(hk_api: HousekeeperAPI, case_id: str) -> str:
        delivery_report_tag_name = "delivery-report"
        version_obj = hk_api.last_version(case_id)
        uploaded_delivery_report_files = hk_api.get_files(
            bundle=case_id,
            tags=[delivery_report_tag_name],
            version=version_obj.id,
        )

        if uploaded_delivery_report_files.count() == 0:
            raise FileNotFoundError(f"No delivery report was found in housekeeper for {case_id}")

        return uploaded_delivery_report_files[0].full_path
Exemplo n.º 2
0
def _get_multiqc_latest_file(hk_api: HousekeeperAPI, case_name: str) -> str:
    """Get latest multiqc_data.json path for a case_name
    Args:
        case_name(str): onemite
    Returns:
        multiqc_data_path(str): /path/to/multiqc.json
    """
    version_obj = hk_api.last_version(case_name)
    multiqc_json_file = hk_api.get_files(
        bundle=case_name, tags=["multiqc-json"], version=version_obj.id
    )

    if len(list(multiqc_json_file)) == 0:
        raise FileNotFoundError(f"No multiqc.json was found in housekeeper for {case_name}")

    return multiqc_json_file[0].full_path