Skip to content

mecfs_bio.build_system.task.osf_retrieve_task

A task that fetches GWAS data from the Open Science data store

Classes:

  • OSFRetrievalTask

    A task that fetches GWAS data from the Open Science data store

OSFRetrievalTask

Bases: GeneratingTask

A task that fetches GWAS data from the Open Science data store

Methods:

Attributes:

deps property

deps: list[Task]

md5_hash class-attribute instance-attribute

md5_hash: str | None = None

meta property

meta: GWASSummaryDataFileMeta

osf_project_id instance-attribute

osf_project_id: str

execute

execute(
    scratch_dir: Path, fetch: Fetch, wf: WF
) -> FileAsset
Source code in mecfs_bio/build_system/task/osf_retrieve_task.py
def execute(self, scratch_dir: Path, fetch: Fetch, wf: WF) -> FileAsset:
    tmp_dst = scratch_dir / "tmp"

    @invoke.task
    def fetch_osf(c):
        c.run(
            f"pixi r osf -p {self.osf_project_id} fetch {str(shlex.quote(str(self._meta.project_path)))} {str(tmp_dst)}"
        )

    fetch_osf(invoke.Context())
    verify_hash(tmp_dst, self.md5_hash)

    return FileAsset(
        tmp_dst,
    )