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 instance-attribute

meta: GWASSummaryDataFileMeta

osf_project_id instance-attribute

osf_project_id: str

run_command class-attribute instance-attribute

run_command: Callable[[list[str]], str] = (
    execute_command_with_retries
)

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"
    self.run_command(
        [
            "pixi",
            "r",
            "osf",
            "-p",
            self.osf_project_id,
            "fetch",
            "--force",
            shlex.quote(str(self.meta.project_path)),
            shlex.quote(str(tmp_dst)),
        ]
    )
    verify_hash(tmp_dst, self.md5_hash)

    return FileAsset(
        tmp_dst,
    )