From 659fd679f03d873ceec64ee4a4cfe44401def6a8 Mon Sep 17 00:00:00 2001 From: Luke Sargent Date: Thu, 23 Jul 2026 12:41:16 -0700 Subject: [PATCH] rearch and rename --- .github/workflows/ci.yml | 18 ++++---- .github/workflows/containers.yml | 33 +++++++-------- .shed.yml | 4 +- cli_tools/{gacdi_manifest => mcdi}/Dockerfile | 8 ++-- cli_tools/{gacdi_manifest => mcdi}/LICENSE | 0 cli_tools/{gacdi_manifest => mcdi}/README.md | 29 ++++++------- .../gacdi_manifest => mcdi/mcdi}/__init__.py | 12 +++--- cli_tools/mcdi/mcdi/cli.py | 42 +++++++++++++++++++ .../mcdi}/download/__init__.py | 0 .../mcdi}/download/cli.py | 39 +++++------------ .../mcdi}/download/config.py | 0 .../mcdi}/download/engine.py | 2 +- .../mcdi}/download/sources/__init__.py | 0 .../mcdi}/download/sources/base.py | 0 .../mcdi}/download/sources/gdc.py | 0 .../mcdi}/download/sources/pdc.py | 0 .../gacdi_manifest => mcdi/mcdi}/errors.py | 0 .../mcdi}/manifest/__init__.py | 0 .../mcdi}/manifest/cbioportal.py | 2 +- .../mcdi}/manifest/cli.py | 39 ++++++----------- .../mcdi}/manifest/enrich.py | 0 .../mcdi}/manifest/filters.py | 0 .../mcdi}/manifest/gdc.py | 2 +- .../mcdi}/manifest/io.py | 2 +- .../mcdi}/manifest/join.py | 0 .../mcdi}/manifest/model.py | 0 .../gacdi_manifest => mcdi/mcdi}/net.py | 0 .../{gacdi_manifest => mcdi}/pyproject.toml | 13 +++--- .../tests/conftest.py | 2 +- .../tests/test_cli.py | 8 ++-- .../tests/test_download_cli.py | 8 +++- .../tests/test_download_gdc_network.py | 6 +-- .../tests/test_download_pdc_network.py | 6 +-- .../tests/test_download_sources.py | 8 ++-- .../tests/test_filters.py | 4 +- .../tests/test_gdc_cbio.py | 4 +- .../tests/test_importer_contract.py | 8 ++-- .../tests/test_io_enrich.py | 22 +++++----- .../tests/test_join.py | 4 +- .../tests/test_model.py | 2 +- .../manifest_downloader.xml | 15 +++++-- tools/manifest_gdc/gacdi_manifest_gdc.xml | 2 +- tools/manifest_gdc/macros.xml | 8 ++-- 43 files changed, 187 insertions(+), 165 deletions(-) rename cli_tools/{gacdi_manifest => mcdi}/Dockerfile (57%) rename cli_tools/{gacdi_manifest => mcdi}/LICENSE (100%) rename cli_tools/{gacdi_manifest => mcdi}/README.md (87%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/__init__.py (75%) create mode 100644 cli_tools/mcdi/mcdi/cli.py rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/download/__init__.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/download/cli.py (67%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/download/config.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/download/engine.py (98%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/download/sources/__init__.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/download/sources/base.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/download/sources/gdc.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/download/sources/pdc.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/errors.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/__init__.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/cbioportal.py (98%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/cli.py (88%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/enrich.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/filters.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/gdc.py (98%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/io.py (99%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/join.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/manifest/model.py (100%) rename cli_tools/{gacdi_manifest/gacdi_manifest => mcdi/mcdi}/net.py (100%) rename cli_tools/{gacdi_manifest => mcdi}/pyproject.toml (61%) rename cli_tools/{gacdi_manifest => mcdi}/tests/conftest.py (95%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_cli.py (91%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_download_cli.py (95%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_download_gdc_network.py (92%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_download_pdc_network.py (96%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_download_sources.py (94%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_filters.py (91%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_gdc_cbio.py (96%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_importer_contract.py (92%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_io_enrich.py (87%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_join.py (92%) rename cli_tools/{gacdi_manifest => mcdi}/tests/test_model.py (97%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40cc5b9..f6f60e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,11 +7,11 @@ on: jobs: pytest: - name: Unit tests (gacdi_manifest) + name: Unit tests (mcdi) runs-on: ubuntu-latest defaults: run: - working-directory: cli_tools/gacdi_manifest + working-directory: cli_tools/mcdi strategy: matrix: python-version: ["3.9", "3.11"] @@ -36,9 +36,9 @@ jobs: - name: Install planemo run: python -m pip install planemo - name: Lint manifest_gdc - run: planemo lint --skip citations tools/manifest_gdc + run: planemo lint tools/manifest_gdc - name: Lint manifest_downloader - run: planemo lint --skip citations tools/manifest_downloader + run: planemo lint tools/manifest_downloader planemo-test-manifest-downloader: name: Test Galaxy tool (manifest_downloader) @@ -54,19 +54,19 @@ jobs: - name: Read version from package __init__.py id: version run: | - VERSION=$(grep -m1 '^__version__' cli_tools/gacdi_manifest/gacdi_manifest/__init__.py | sed -E 's/__version__ = "(.*)"/\1/') + VERSION=$(grep -m1 '^__version__' cli_tools/mcdi/mcdi/__init__.py | sed -E 's/__version__ = "(.*)"/\1/') echo "version=${VERSION}" >> "$GITHUB_OUTPUT" # Built locally and never pushed: this only has to exist for this job's # own `planemo test --docker` step to resolve the tag manifest_downloader.xml # references. The real, published image is built and pushed by # containers.yml, only on merge to main. - - name: Build gacdi-manifest image (local only, not pushed) + - name: Build mcdi image (local only, not pushed) run: | docker build \ - --build-arg GACDI_BUILD=${{ github.sha }} \ - -t quay.io/goeckslab/gacdi-manifest:${{ steps.version.outputs.version }} \ - cli_tools/gacdi_manifest + --build-arg MCDI_BUILD=${{ github.sha }} \ + -t quay.io/goeckslab/mcdi:${{ steps.version.outputs.version }} \ + cli_tools/mcdi - name: Test run: planemo test --docker tools/manifest_downloader diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 30c271a..1e2c9d5 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -1,25 +1,24 @@ -name: Build and push manifest container - -# Builds the manifest-builder image and pushes it to Quay whenever -# cli_tools/gacdi_manifest changes on main, or manually. The image tag is -# always taken from gacdi_manifest/__init__.py's __version__ (the single -# source of truth for versioning; pyproject.toml's version is derived from it -# via hatchling) and the job refuses to overwrite a tag that already exists on -# Quay, so a forgotten version bump fails the build instead of silently -# clobbering the published image. Requires repository secrets QUAY_USERNAME -# and QUAY_TOKEN (Quay robot account). +name: Build and push mcdi container + +# Builds the mcdi image and pushes it to Quay whenever cli_tools/mcdi changes +# on main, or manually. The image tag is always taken from mcdi/__init__.py's +# __version__ (the single source of truth for versioning; pyproject.toml's +# version is derived from it via hatchling) and the job refuses to overwrite +# a tag that already exists on Quay, so a forgotten version bump fails the +# build instead of silently clobbering the published image. Requires +# repository secrets QUAY_USERNAME and QUAY_TOKEN (Quay robot account). on: push: branches: ["main"] paths: - - "cli_tools/gacdi_manifest/**" + - "cli_tools/mcdi/**" workflow_dispatch: env: REGISTRY: quay.io # Must match the namespace in tools/manifest_gdc/macros.xml. ORG: goeckslab - IMAGE: gacdi-manifest + IMAGE: mcdi jobs: manifest: @@ -30,7 +29,7 @@ jobs: - name: Read version from package __init__.py id: version run: | - VERSION=$(grep -m1 '^__version__' cli_tools/gacdi_manifest/gacdi_manifest/__init__.py | sed -E 's/__version__ = "(.*)"/\1/') + VERSION=$(grep -m1 '^__version__' cli_tools/mcdi/mcdi/__init__.py | sed -E 's/__version__ = "(.*)"/\1/') echo "version=${VERSION}" >> "$GITHUB_OUTPUT" - uses: docker/setup-buildx-action@v3 @@ -46,16 +45,16 @@ jobs: IMAGE_REF="${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:${{ steps.version.outputs.version }}" if docker buildx imagetools inspect "$IMAGE_REF" >/dev/null 2>&1; then echo "Tag ${{ steps.version.outputs.version }} already exists at $IMAGE_REF." >&2 - echo "Bump __version__ in gacdi_manifest/__init__.py before pushing again." >&2 + echo "Bump __version__ in mcdi/__init__.py before pushing again." >&2 exit 1 fi - name: Build & push uses: docker/build-push-action@v6 with: - context: cli_tools/gacdi_manifest - file: cli_tools/gacdi_manifest/Dockerfile + context: cli_tools/mcdi + file: cli_tools/mcdi/Dockerfile push: true build-args: | - GACDI_BUILD=${{ github.sha }} + MCDI_BUILD=${{ github.sha }} tags: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:${{ steps.version.outputs.version }} diff --git a/.shed.yml b/.shed.yml index 760b585..9dac798 100644 --- a/.shed.yml +++ b/.shed.yml @@ -7,8 +7,8 @@ long_description: | ready for gdc-client or the GaCDI GDC importer, together with an enriched metadata table that joins sample barcodes and clinical/molecular annotations (GDC fields, cBioPortal subtypes, and optional user-uploaded annotations) plus a match/precision report. -homepage_url: https://github.com/paulocilasjr/GaCDI -remote_repository_url: https://github.com/paulocilasjr/GaCDI +homepage_url: https://github.com/goeckslab/GaCDI +remote_repository_url: https://github.com/goeckslab/GaCDI type: unrestricted categories: - Data Source diff --git a/cli_tools/gacdi_manifest/Dockerfile b/cli_tools/mcdi/Dockerfile similarity index 57% rename from cli_tools/gacdi_manifest/Dockerfile rename to cli_tools/mcdi/Dockerfile index a663fd5..24c16f5 100644 --- a/cli_tools/gacdi_manifest/Dockerfile +++ b/cli_tools/mcdi/Dockerfile @@ -1,9 +1,9 @@ FROM python:3.12-alpine WORKDIR /app -# build from gacdi parent directory +# build from the mcdi parent directory COPY . . RUN pip install --no-cache-dir . # Build identifier (e.g. git SHA) so a run can report exactly which code it used. -ARG GACDI_BUILD=local -ENV GACDI_BUILD=${GACDI_BUILD} -CMD ["gacdi-manifest", "--help"] \ No newline at end of file +ARG MCDI_BUILD=local +ENV MCDI_BUILD=${MCDI_BUILD} +CMD ["mcdi", "--help"] diff --git a/cli_tools/gacdi_manifest/LICENSE b/cli_tools/mcdi/LICENSE similarity index 100% rename from cli_tools/gacdi_manifest/LICENSE rename to cli_tools/mcdi/LICENSE diff --git a/cli_tools/gacdi_manifest/README.md b/cli_tools/mcdi/README.md similarity index 87% rename from cli_tools/gacdi_manifest/README.md rename to cli_tools/mcdi/README.md index 2449636..ecdc1bf 100644 --- a/cli_tools/gacdi_manifest/README.md +++ b/cli_tools/mcdi/README.md @@ -2,9 +2,10 @@ Galaxy Cancer Data Importers (GaCDI) provides Galaxy tools for importing cancer datasets from major public and controlled-access cancer data repositories into -Galaxy histories. This package provides two commands: `gacdi-manifest` builds -a manifest from filters, and `gacdi-download` downloads the files a GDC or PDC -manifest lists (whether built here or exported from a portal). +Galaxy histories. This package provides one command, `mcdi` (Multi-Commons Data +Importer), with two subcommands: `mcdi manifest` builds a manifest from +filters, and `mcdi download` downloads the files a GDC or PDC manifest lists +(whether built here or exported from a portal). ## Manifest Builder (this branch) @@ -33,11 +34,11 @@ table, which is joined back to the downloaded files by barcode afterwards. ```bash # Preview how many files match before building -gacdi-manifest gdc --project TCGA-BRCA --data-type "Slide Image" --count-only \ +mcdi manifest gdc --project TCGA-BRCA --data-type "Slide Image" --count-only \ --manifest-out m.txt --metadata-out meta.tsv --report-out report.tsv # Build a slide-image manifest enriched with cBioPortal subtypes + a custom table -gacdi-manifest gdc \ +mcdi manifest gdc \ --project TCGA-BRCA --data-type "Slide Image" --access open \ --cbioportal-study brca_tcga_pan_can_atlas_2018 \ --cbioportal-attrs SUBTYPE,ER_STATUS_BY_IHC,PR_STATUS_BY_IHC,HER2_STATUS \ @@ -46,7 +47,7 @@ gacdi-manifest gdc \ --manifest-out gdc_manifest.txt --metadata-out metadata.tsv --report-out report.tsv # Discover a study's cBioPortal attribute ids -gacdi-manifest gdc --cbioportal-study brca_tcga_pan_can_atlas_2018 \ +mcdi manifest gdc --cbioportal-study brca_tcga_pan_can_atlas_2018 \ --cbioportal-list-attrs --manifest-out m.txt --metadata-out meta.tsv --report-out report.tsv ``` @@ -88,8 +89,8 @@ annotations (e.g. labels for an image ML model). ## Downloading files from a manifest -`gacdi-download` fetches the files listed in a GDC or PDC manifest — either -one built by `gacdi-manifest gdc` above, or one exported directly from a +`mcdi download` fetches the files listed in a GDC or PDC manifest — either +one built by `mcdi manifest gdc` above, or one exported directly from a portal: - **GDC**: build a file cart in the [GDC portal](https://portal.gdc.cancer.gov) @@ -101,8 +102,8 @@ portal: re-export if downloads start failing. ```bash -gacdi-download --manifest gdc_manifest.txt --output-dir downloads/ -gacdi-download --manifest pdc_manifest.csv --output-dir downloads/ --verify-checksum +mcdi download --manifest gdc_manifest.txt --output-dir downloads/ +mcdi download --manifest pdc_manifest.csv --output-dir downloads/ --verify-checksum ``` The data commons is auto-detected from the manifest's header row; pass @@ -123,7 +124,7 @@ environment variable or `--token-file`: ```bash export GDC_TOKEN="$(cat gdc-user-token.txt)" -gacdi-download --manifest gdc_manifest.txt --output-dir downloads/ +mcdi download --manifest gdc_manifest.txt --output-dir downloads/ ``` PDC downloads use pre-signed URLs embedded in the manifest and need no token. @@ -139,15 +140,15 @@ interrupted runs can simply be re-run. ## Runtime environment -The tool ships a pinned container (`quay.io//gacdi-manifest`) referenced from +The tool ships a pinned container (`quay.io//mcdi`) referenced from the wrapper, with Python + `requests` Conda requirements as a fallback. The Quay namespace (`paulocilasjr`) is a placeholder — update `@QUAY_ORG@` in `tools/manifest_gdc/macros.xml`, `containers/Dockerfile.manifest`, and the workflow before publishing. ```bash -docker build -f containers/Dockerfile.manifest -t gacdi-manifest:dev . -docker run --rm gacdi-manifest:dev gacdi-manifest gdc --help +docker build -f containers/Dockerfile.manifest -t mcdi:dev . +docker run --rm mcdi:dev mcdi manifest gdc --help ``` ## Development diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/__init__.py b/cli_tools/mcdi/mcdi/__init__.py similarity index 75% rename from cli_tools/gacdi_manifest/gacdi_manifest/__init__.py rename to cli_tools/mcdi/mcdi/__init__.py index 5079884..1428e26 100644 --- a/cli_tools/gacdi_manifest/gacdi_manifest/__init__.py +++ b/cli_tools/mcdi/mcdi/__init__.py @@ -1,26 +1,26 @@ -"""GaCDI Manifest Builder + Downloader. +"""MCDI — Multi-Commons Data Importer. -Two commands sharing one package: +One command, two subcommands: -- ``gacdi-manifest`` (:mod:`gacdi_manifest.manifest`): filter-driven generation of +- ``mcdi manifest`` (:mod:`mcdi.manifest`): filter-driven generation of download manifests (and enriched metadata tables) for NIH/NCI cancer data repositories, starting with the NCI Genomic Data Commons (GDC). The builder emits a deliberate *two-file split*: a lean, CLI/importer-ready manifest (``id/filename/md5/size/state``) and a rich metadata table joining clinical/molecular annotations by barcode, plus a match report so selections and joins are never silently wrong. -- ``gacdi-download`` (:mod:`gacdi_manifest.download`): downloads the files listed +- ``mcdi download`` (:mod:`mcdi.download`): downloads the files listed in a GDC or PDC manifest, auto-detecting which commons it came from. """ import os -__version__ = "0.2.0" +__version__ = "0.3.0" # Build identifier baked into the container image at build time (e.g. the git # commit SHA). Lets you confirm the exact code a run used, even when the version # number hasn't changed. Empty for local/editable installs. -BUILD = os.environ.get("GACDI_BUILD", "").strip() +BUILD = os.environ.get("MCDI_BUILD", "").strip() def version_string() -> str: diff --git a/cli_tools/mcdi/mcdi/cli.py b/cli_tools/mcdi/mcdi/cli.py new file mode 100644 index 0000000..3bfdc15 --- /dev/null +++ b/cli_tools/mcdi/mcdi/cli.py @@ -0,0 +1,42 @@ +"""``mcdi`` — Multi-Commons Data Importer: single entry point for the ``manifest`` and ``download`` subcommands.""" + +from __future__ import annotations + +import argparse +import logging +import sys + +from . import version_string +from .download import cli as download_cli +from .errors import ManifestError +from .manifest import cli as manifest_cli + +log = logging.getLogger("mcdi") + + +def build_parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser(prog="mcdi", description="MCDI: Multi-Commons Data Importer.") + parser.add_argument("--version", action="version", version=f"mcdi {version_string()}") + sub = parser.add_subparsers(dest="command", required=True, metavar="COMMAND") + manifest_cli.add_arguments(sub) + download_cli.add_arguments(sub) + return parser + + +def main(argv: list[str] | None = None) -> int: + args = build_parser().parse_args(argv) + logging.basicConfig( + level=logging.DEBUG if getattr(args, "verbose", False) else logging.INFO, + format="%(levelname)s %(name)s: %(message)s", + ) + # Emit the running version to the job log so it is visible in Galaxy's job info. + log.info("mcdi %s", version_string()) + try: + return args.func(args) + except ManifestError as exc: + log.error("%s", exc) + return exc.exit_code + + +if __name__ == "__main__": # pragma: no cover + sys.exit(main()) diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/download/__init__.py b/cli_tools/mcdi/mcdi/download/__init__.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/download/__init__.py rename to cli_tools/mcdi/mcdi/download/__init__.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/download/cli.py b/cli_tools/mcdi/mcdi/download/cli.py similarity index 67% rename from cli_tools/gacdi_manifest/gacdi_manifest/download/cli.py rename to cli_tools/mcdi/mcdi/download/cli.py index c3e5d42..f600002 100644 --- a/cli_tools/gacdi_manifest/gacdi_manifest/download/cli.py +++ b/cli_tools/mcdi/mcdi/download/cli.py @@ -1,26 +1,24 @@ -"""CLI: ``gacdi-download`` — download the files listed in a GDC or PDC manifest.""" +"""``mcdi download`` — download the files listed in a GDC or PDC manifest.""" from __future__ import annotations import argparse import logging -import sys from pathlib import Path -from .. import version_string -from ..errors import InputError, ManifestError +from ..errors import InputError from . import config, engine from .sources import SOURCES, detect_source -log = logging.getLogger("gacdi_manifest.download") +log = logging.getLogger("mcdi.download") -def build_parser() -> argparse.ArgumentParser: - parser = argparse.ArgumentParser( - prog="gacdi-download", - description="Download files listed in a GDC or PDC manifest.", +def add_arguments(subparsers: argparse._SubParsersAction) -> argparse.ArgumentParser: + """Attach the ``download`` subcommand to ``subparsers``.""" + parser = subparsers.add_parser( + "download", + help="Download files listed in a GDC or PDC manifest.", ) - parser.add_argument("--version", action="version", version=f"gacdi-download {version_string()}") parser.add_argument("--manifest", required=True, type=Path, help="Path to the exported manifest file") parser.add_argument("--output-dir", required=True, type=Path, help="Directory to download files into") parser.add_argument( @@ -39,10 +37,11 @@ def build_parser() -> argparse.ArgumentParser: help="Path to a file containing a GDC auth token (overrides GDC_TOKEN env var)", ) parser.add_argument("--verbose", action="store_true") + parser.set_defaults(func=run) return parser -def _run(args: argparse.Namespace) -> int: +def run(args: argparse.Namespace) -> int: if not args.manifest.is_file(): raise InputError(f"manifest not found: {args.manifest}") @@ -76,21 +75,3 @@ def _run(args: argparse.Namespace) -> int: f"{len(mismatches)} checksum mismatch(es)" ) return 1 if failed or mismatches else 0 - - -def main(argv: list[str] | None = None) -> int: - args = build_parser().parse_args(argv) - logging.basicConfig( - level=logging.DEBUG if args.verbose else logging.INFO, - format="%(levelname)s %(name)s: %(message)s", - ) - log.info("gacdi-download %s", version_string()) - try: - return _run(args) - except ManifestError as exc: - log.error("%s", exc) - return exc.exit_code - - -if __name__ == "__main__": # pragma: no cover - sys.exit(main()) diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/download/config.py b/cli_tools/mcdi/mcdi/download/config.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/download/config.py rename to cli_tools/mcdi/mcdi/download/config.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/download/engine.py b/cli_tools/mcdi/mcdi/download/engine.py similarity index 98% rename from cli_tools/gacdi_manifest/gacdi_manifest/download/engine.py rename to cli_tools/mcdi/mcdi/download/engine.py index 8f625ae..c45afc0 100644 --- a/cli_tools/gacdi_manifest/gacdi_manifest/download/engine.py +++ b/cli_tools/mcdi/mcdi/download/engine.py @@ -24,7 +24,7 @@ def build_session() -> requests.Session: retries=RETRY_TOTAL, backoff=RETRY_BACKOFF, allowed_methods=frozenset({"GET", "HEAD"}), - user_agent=f"gacdi-manifest/{version_string()}", + user_agent=f"mcdi/{version_string()}", ) diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/download/sources/__init__.py b/cli_tools/mcdi/mcdi/download/sources/__init__.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/download/sources/__init__.py rename to cli_tools/mcdi/mcdi/download/sources/__init__.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/download/sources/base.py b/cli_tools/mcdi/mcdi/download/sources/base.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/download/sources/base.py rename to cli_tools/mcdi/mcdi/download/sources/base.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/download/sources/gdc.py b/cli_tools/mcdi/mcdi/download/sources/gdc.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/download/sources/gdc.py rename to cli_tools/mcdi/mcdi/download/sources/gdc.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/download/sources/pdc.py b/cli_tools/mcdi/mcdi/download/sources/pdc.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/download/sources/pdc.py rename to cli_tools/mcdi/mcdi/download/sources/pdc.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/errors.py b/cli_tools/mcdi/mcdi/errors.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/errors.py rename to cli_tools/mcdi/mcdi/errors.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/__init__.py b/cli_tools/mcdi/mcdi/manifest/__init__.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/__init__.py rename to cli_tools/mcdi/mcdi/manifest/__init__.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/cbioportal.py b/cli_tools/mcdi/mcdi/manifest/cbioportal.py similarity index 98% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/cbioportal.py rename to cli_tools/mcdi/mcdi/manifest/cbioportal.py index e3b77fd..44a4ba2 100644 --- a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/cbioportal.py +++ b/cli_tools/mcdi/mcdi/manifest/cbioportal.py @@ -21,7 +21,7 @@ from ..errors import ApiError -log = logging.getLogger("gacdi_manifest.manifest.cbioportal") +log = logging.getLogger("mcdi.manifest.cbioportal") DEFAULT_BASE = "https://www.cbioportal.org/api" diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/cli.py b/cli_tools/mcdi/mcdi/manifest/cli.py similarity index 88% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/cli.py rename to cli_tools/mcdi/mcdi/manifest/cli.py index 2244f19..b73d37c 100644 --- a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/cli.py +++ b/cli_tools/mcdi/mcdi/manifest/cli.py @@ -1,20 +1,18 @@ -"""CLI: ``gacdi-manifest gdc [...]`` — build GDC manifests + enriched metadata.""" +"""``mcdi manifest gdc [...]`` — build GDC manifests + enriched metadata.""" from __future__ import annotations import argparse import json import logging -import sys -from .. import version_string -from ..errors import InputError, ManifestError +from ..errors import InputError from ..net import build_session from . import cbioportal, enrich, gdc, io from .filters import build_filters from .join import join -log = logging.getLogger("gacdi_manifest") +log = logging.getLogger("mcdi.manifest") # Facets summarised in count-only previews. PREVIEW_FACETS = [ @@ -29,9 +27,9 @@ ] -def build_parser() -> argparse.ArgumentParser: - parser = argparse.ArgumentParser(prog="gacdi-manifest", description="GaCDI manifest builder.") - parser.add_argument("--version", action="version", version=f"gacdi-manifest {version_string()}") +def add_arguments(subparsers: argparse._SubParsersAction) -> argparse.ArgumentParser: + """Attach the ``manifest`` subcommand (and its ``gdc`` sub-subcommand) to ``subparsers``.""" + parser = subparsers.add_parser("manifest", help="Build a filtered download manifest.") sub = parser.add_subparsers(dest="database", required=True, metavar="DATABASE") p = sub.add_parser("gdc", help="Build a manifest from the GDC files API.") @@ -79,6 +77,8 @@ def build_parser() -> argparse.ArgumentParser: out.add_argument("--metadata-out", default="metadata.tsv") out.add_argument("--report-out", default="report.tsv") p.add_argument("--verbose", action="store_true") + + parser.set_defaults(func=run) return parser @@ -205,22 +205,7 @@ def _run_gdc(args: argparse.Namespace) -> int: return 0 -def main(argv: list[str] | None = None) -> int: - args = build_parser().parse_args(argv) - logging.basicConfig( - level=logging.DEBUG if getattr(args, "verbose", False) else logging.INFO, - format="%(levelname)s %(name)s: %(message)s", - ) - # Emit the running version to the job log so it is visible in Galaxy's job info. - log.info("gacdi-manifest %s", version_string()) - try: - if args.database == "gdc": - return _run_gdc(args) - raise InputError(f"Unknown database '{args.database}'.") - except ManifestError as exc: - log.error("%s", exc) - return exc.exit_code - - -if __name__ == "__main__": # pragma: no cover - sys.exit(main()) +def run(args: argparse.Namespace) -> int: + if args.database == "gdc": + return _run_gdc(args) + raise InputError(f"Unknown database '{args.database}'.") diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/enrich.py b/cli_tools/mcdi/mcdi/manifest/enrich.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/enrich.py rename to cli_tools/mcdi/mcdi/manifest/enrich.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/filters.py b/cli_tools/mcdi/mcdi/manifest/filters.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/filters.py rename to cli_tools/mcdi/mcdi/manifest/filters.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/gdc.py b/cli_tools/mcdi/mcdi/manifest/gdc.py similarity index 98% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/gdc.py rename to cli_tools/mcdi/mcdi/manifest/gdc.py index 54ed850..794e744 100644 --- a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/gdc.py +++ b/cli_tools/mcdi/mcdi/manifest/gdc.py @@ -16,7 +16,7 @@ from ..errors import ApiError from .model import FileRow -log = logging.getLogger("gacdi_manifest.manifest.gdc") +log = logging.getLogger("mcdi.manifest.gdc") FILES_ENDPOINT = "https://api.gdc.cancer.gov/files" diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/io.py b/cli_tools/mcdi/mcdi/manifest/io.py similarity index 99% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/io.py rename to cli_tools/mcdi/mcdi/manifest/io.py index 11faccf..6c0d419 100644 --- a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/io.py +++ b/cli_tools/mcdi/mcdi/manifest/io.py @@ -103,7 +103,7 @@ def add(category: str, key: str, value) -> None: rows.append((category, key, str(value))) # Version stamp: lets you confirm which build of the tool actually ran. - add("summary", "gacdi_manifest_version", version_string()) + add("summary", "mcdi_version", version_string()) # --- summary ------------------------------------------------------- if database_total is not None: diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/join.py b/cli_tools/mcdi/mcdi/manifest/join.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/join.py rename to cli_tools/mcdi/mcdi/manifest/join.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/manifest/model.py b/cli_tools/mcdi/mcdi/manifest/model.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/manifest/model.py rename to cli_tools/mcdi/mcdi/manifest/model.py diff --git a/cli_tools/gacdi_manifest/gacdi_manifest/net.py b/cli_tools/mcdi/mcdi/net.py similarity index 100% rename from cli_tools/gacdi_manifest/gacdi_manifest/net.py rename to cli_tools/mcdi/mcdi/net.py diff --git a/cli_tools/gacdi_manifest/pyproject.toml b/cli_tools/mcdi/pyproject.toml similarity index 61% rename from cli_tools/gacdi_manifest/pyproject.toml rename to cli_tools/mcdi/pyproject.toml index f2e6f9d..c74fd3e 100644 --- a/cli_tools/gacdi_manifest/pyproject.toml +++ b/cli_tools/mcdi/pyproject.toml @@ -3,9 +3,9 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "gacdi-manifest" +name = "mcdi" dynamic = ["version"] -description = "GaCDI Manifest Builder + Downloader — filter-driven manifest + enriched metadata generation for NIH/NCI cancer data repositories, plus a GDC/PDC manifest downloader." +description = "MCDI (Multi-Commons Data Importer) — filter-driven manifest + enriched metadata generation for NIH/NCI cancer data repositories, plus a GDC/PDC manifest downloader, via `mcdi manifest` and `mcdi download`." readme = "README.md" requires-python = ">=3.9" license = { file = "LICENSE" } @@ -22,17 +22,16 @@ dev = [ ] [project.scripts] -gacdi-manifest = "gacdi_manifest.manifest.cli:main" -gacdi-download = "gacdi_manifest.download.cli:main" +mcdi = "mcdi.cli:main" [project.urls] -Homepage = "https://github.com/paulocilasjr/GaCDI" +Homepage = "https://github.com/goeckslab/GaCDI" [tool.hatch.version] -path = "gacdi_manifest/__init__.py" +path = "mcdi/__init__.py" [tool.hatch.build.targets.wheel] -packages = ["gacdi_manifest"] +packages = ["mcdi"] [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/cli_tools/gacdi_manifest/tests/conftest.py b/cli_tools/mcdi/tests/conftest.py similarity index 95% rename from cli_tools/gacdi_manifest/tests/conftest.py rename to cli_tools/mcdi/tests/conftest.py index d91f238..d080a49 100644 --- a/cli_tools/gacdi_manifest/tests/conftest.py +++ b/cli_tools/mcdi/tests/conftest.py @@ -2,7 +2,7 @@ import pytest -from gacdi_manifest.manifest.gdc import FILES_ENDPOINT +from mcdi.manifest.gdc import FILES_ENDPOINT SAMPLE_TSV = ( "file_id\tfile_name\tmd5sum\tfile_size\tstate\tdata_format\t" diff --git a/cli_tools/gacdi_manifest/tests/test_cli.py b/cli_tools/mcdi/tests/test_cli.py similarity index 91% rename from cli_tools/gacdi_manifest/tests/test_cli.py rename to cli_tools/mcdi/tests/test_cli.py index 65efd93..557b01c 100644 --- a/cli_tools/gacdi_manifest/tests/test_cli.py +++ b/cli_tools/mcdi/tests/test_cli.py @@ -1,9 +1,9 @@ -from gacdi_manifest.manifest.cli import main +from mcdi.cli import main def _args(tmp_path, *extra): return [ - "gdc", "--project", "TCGA-BRCA", "--data-type", "Slide Image", + "manifest", "gdc", "--project", "TCGA-BRCA", "--data-type", "Slide Image", "--manifest-out", str(tmp_path / "m.txt"), "--metadata-out", str(tmp_path / "md.tsv"), "--report-out", str(tmp_path / "r.tsv"), @@ -51,7 +51,7 @@ def test_full_build_with_annotation(tmp_path, gdc_api): def test_no_matches_writes_note(tmp_path, requests_mock): import json - from gacdi_manifest.manifest.gdc import FILES_ENDPOINT + from mcdi.manifest.gdc import FILES_ENDPOINT def callback(request, context): context.status_code = 200 @@ -70,7 +70,7 @@ def callback(request, context): def test_no_filters_exit_code(tmp_path): - rc = main(["gdc", "--manifest-out", str(tmp_path / "m.txt"), + rc = main(["manifest", "gdc", "--manifest-out", str(tmp_path / "m.txt"), "--metadata-out", str(tmp_path / "md.tsv"), "--report-out", str(tmp_path / "r.tsv")]) assert rc == 2 diff --git a/cli_tools/gacdi_manifest/tests/test_download_cli.py b/cli_tools/mcdi/tests/test_download_cli.py similarity index 95% rename from cli_tools/gacdi_manifest/tests/test_download_cli.py rename to cli_tools/mcdi/tests/test_download_cli.py index b3d9353..ebac117 100644 --- a/cli_tools/gacdi_manifest/tests/test_download_cli.py +++ b/cli_tools/mcdi/tests/test_download_cli.py @@ -1,6 +1,6 @@ import hashlib -from gacdi_manifest.download.cli import main +from mcdi.cli import main FILE_A = b"hello world\n" FILE_B = b"second file\n" @@ -19,6 +19,7 @@ def _write_gdc_manifest(path, rows): def test_missing_manifest_exits_input_error(tmp_path): rc = main([ + "download", "--manifest", str(tmp_path / "nope.txt"), "--output-dir", str(tmp_path / "out"), ]) @@ -36,6 +37,7 @@ def test_full_download_with_checksum_verification(tmp_path, requests_mock): output_dir = tmp_path / "out" rc = main([ + "download", "--manifest", str(manifest), "--output-dir", str(output_dir), "--verify-checksum", @@ -50,6 +52,7 @@ def test_full_download_with_checksum_verification(tmp_path, requests_mock): # Re-running should skip already-downloaded, checksum-verified files. rc_again = main([ + "download", "--manifest", str(manifest), "--output-dir", str(output_dir), "--verify-checksum", @@ -64,6 +67,7 @@ def test_checksum_mismatch_reported_as_failure(tmp_path, requests_mock): requests_mock.get("https://api.gdc.cancer.gov/data/uuid1", content=FILE_A) rc = main([ + "download", "--manifest", str(manifest), "--output-dir", str(tmp_path / "out"), "--verify-checksum", @@ -80,6 +84,7 @@ def test_gdc_token_passed_as_header(tmp_path, requests_mock): token_file.write_text("secret-token\n") rc = main([ + "download", "--manifest", str(manifest), "--output-dir", str(tmp_path / "out"), "--token-file", str(token_file), @@ -93,6 +98,7 @@ def test_bad_token_file_exits_input_error(tmp_path): _write_gdc_manifest(manifest, [("uuid1", "a.txt", _md5(FILE_A), len(FILE_A))]) rc = main([ + "download", "--manifest", str(manifest), "--output-dir", str(tmp_path / "out"), "--token-file", str(tmp_path / "missing-token.txt"), diff --git a/cli_tools/gacdi_manifest/tests/test_download_gdc_network.py b/cli_tools/mcdi/tests/test_download_gdc_network.py similarity index 92% rename from cli_tools/gacdi_manifest/tests/test_download_gdc_network.py rename to cli_tools/mcdi/tests/test_download_gdc_network.py index c502adf..a7ed39e 100644 --- a/cli_tools/gacdi_manifest/tests/test_download_gdc_network.py +++ b/cli_tools/mcdi/tests/test_download_gdc_network.py @@ -4,9 +4,9 @@ import pytest -from gacdi_manifest.download import engine -from gacdi_manifest.download.sources import detect_source -from gacdi_manifest.download.sources.gdc import GDCSource +from mcdi.download import engine +from mcdi.download.sources import detect_source +from mcdi.download.sources.gdc import GDCSource # Small, open-access legacy GDC files (~1.5KB each) used purely to exercise # the download pipeline against the real API. Released open-access files and diff --git a/cli_tools/gacdi_manifest/tests/test_download_pdc_network.py b/cli_tools/mcdi/tests/test_download_pdc_network.py similarity index 96% rename from cli_tools/gacdi_manifest/tests/test_download_pdc_network.py rename to cli_tools/mcdi/tests/test_download_pdc_network.py index 3c73bcc..815e523 100644 --- a/cli_tools/gacdi_manifest/tests/test_download_pdc_network.py +++ b/cli_tools/mcdi/tests/test_download_pdc_network.py @@ -6,9 +6,9 @@ import pytest import requests -from gacdi_manifest.download import engine -from gacdi_manifest.download.sources import detect_source -from gacdi_manifest.download.sources.pdc import PDCSource +from mcdi.download import engine +from mcdi.download.sources import detect_source +from mcdi.download.sources.pdc import PDCSource GRAPHQL_URL = "https://pdc.cancer.gov/graphql" diff --git a/cli_tools/gacdi_manifest/tests/test_download_sources.py b/cli_tools/mcdi/tests/test_download_sources.py similarity index 94% rename from cli_tools/gacdi_manifest/tests/test_download_sources.py rename to cli_tools/mcdi/tests/test_download_sources.py index 2ab6f9f..deb580b 100644 --- a/cli_tools/gacdi_manifest/tests/test_download_sources.py +++ b/cli_tools/mcdi/tests/test_download_sources.py @@ -2,10 +2,10 @@ import pytest -from gacdi_manifest.download.sources import detect_source -from gacdi_manifest.download.sources.gdc import GDCSource -from gacdi_manifest.download.sources.pdc import PDCSource -from gacdi_manifest.errors import InputError +from mcdi.download.sources import detect_source +from mcdi.download.sources.gdc import GDCSource +from mcdi.download.sources.pdc import PDCSource +from mcdi.errors import InputError GDC_HEADER = ["id", "filename", "md5", "size", "state"] PDC_HEADER = ["PDC Study ID", "PDC Study Version", "Data Category", "File Type", diff --git a/cli_tools/gacdi_manifest/tests/test_filters.py b/cli_tools/mcdi/tests/test_filters.py similarity index 91% rename from cli_tools/gacdi_manifest/tests/test_filters.py rename to cli_tools/mcdi/tests/test_filters.py index 6cd09c2..7dac69b 100644 --- a/cli_tools/gacdi_manifest/tests/test_filters.py +++ b/cli_tools/mcdi/tests/test_filters.py @@ -1,7 +1,7 @@ import pytest -from gacdi_manifest.errors import InputError -from gacdi_manifest.manifest.filters import build_filters, parse_extra_filter +from mcdi.errors import InputError +from mcdi.manifest.filters import build_filters, parse_extra_filter def test_guided_filters_structure(): diff --git a/cli_tools/gacdi_manifest/tests/test_gdc_cbio.py b/cli_tools/mcdi/tests/test_gdc_cbio.py similarity index 96% rename from cli_tools/gacdi_manifest/tests/test_gdc_cbio.py rename to cli_tools/mcdi/tests/test_gdc_cbio.py index c2aae42..b018cbb 100644 --- a/cli_tools/gacdi_manifest/tests/test_gdc_cbio.py +++ b/cli_tools/mcdi/tests/test_gdc_cbio.py @@ -2,8 +2,8 @@ import requests -from gacdi_manifest.manifest import cbioportal, gdc -from gacdi_manifest.manifest.filters import build_filters +from mcdi.manifest import cbioportal, gdc +from mcdi.manifest.filters import build_filters def test_count_and_query(gdc_api): diff --git a/cli_tools/gacdi_manifest/tests/test_importer_contract.py b/cli_tools/mcdi/tests/test_importer_contract.py similarity index 92% rename from cli_tools/gacdi_manifest/tests/test_importer_contract.py rename to cli_tools/mcdi/tests/test_importer_contract.py index 7bb2102..10dd684 100644 --- a/cli_tools/gacdi_manifest/tests/test_importer_contract.py +++ b/cli_tools/mcdi/tests/test_importer_contract.py @@ -10,8 +10,8 @@ import csv -from gacdi_manifest.manifest.cli import main -from gacdi_manifest.manifest.io import BASE_METADATA_COLUMNS, MANIFEST_COLUMNS +from mcdi.cli import main +from mcdi.manifest.io import BASE_METADATA_COLUMNS, MANIFEST_COLUMNS # --- mirrored from NIH_commons: gacdi/manifest.py and gacdi/history.py --- IMPORTER_REQUIRED_MANIFEST_COLUMNS = {"id", "filename", "md5", "size"} @@ -43,7 +43,7 @@ def test_manifest_columns_match_importer_requirements(): def test_manifest_output_parses_in_importer(tmp_path, gdc_api): args = [ - "gdc", "--project", "TCGA-BRCA", "--data-type", "Slide Image", + "manifest", "gdc", "--project", "TCGA-BRCA", "--data-type", "Slide Image", "--manifest-out", str(tmp_path / "m.txt"), "--metadata-out", str(tmp_path / "md.tsv"), "--report-out", str(tmp_path / "r.tsv"), @@ -58,7 +58,7 @@ def test_manifest_output_parses_in_importer(tmp_path, gdc_api): def test_metadata_joins_to_importer_summary(tmp_path, gdc_api): """metadata leads with file_id/filename, so it joins the importer's summary.""" main([ - "gdc", "--project", "TCGA-BRCA", "--data-type", "Slide Image", + "manifest", "gdc", "--project", "TCGA-BRCA", "--data-type", "Slide Image", "--manifest-out", str(tmp_path / "m.txt"), "--metadata-out", str(tmp_path / "md.tsv"), "--report-out", str(tmp_path / "r.tsv"), diff --git a/cli_tools/gacdi_manifest/tests/test_io_enrich.py b/cli_tools/mcdi/tests/test_io_enrich.py similarity index 87% rename from cli_tools/gacdi_manifest/tests/test_io_enrich.py rename to cli_tools/mcdi/tests/test_io_enrich.py index 0c65c72..e6fdafd 100644 --- a/cli_tools/gacdi_manifest/tests/test_io_enrich.py +++ b/cli_tools/mcdi/tests/test_io_enrich.py @@ -2,9 +2,9 @@ import requests -from gacdi_manifest.manifest import enrich, io -from gacdi_manifest.manifest.join import JoinReport -from gacdi_manifest.manifest.model import FileRow +from mcdi.manifest import enrich, io +from mcdi.manifest.join import JoinReport +from mcdi.manifest.model import FileRow def test_write_manifest_strict_columns(tmp_path): @@ -53,7 +53,7 @@ def test_read_annotation_tsv(tmp_path): def test_collect_merges_sources(tmp_path, requests_mock): - from gacdi_manifest.manifest import cbioportal + from mcdi.manifest import cbioportal study = "brca_tcga" requests_mock.get( @@ -74,7 +74,7 @@ def test_collect_merges_sources(tmp_path, requests_mock): def test_collect_merges_multiple_studies(requests_mock): - from gacdi_manifest.manifest import cbioportal + from mcdi.manifest import cbioportal base = cbioportal.DEFAULT_BASE @@ -112,14 +112,14 @@ def cb(request, context): def test_report_always_has_version_stamp(tmp_path): out = tmp_path / "r.tsv" io.write_report(out, database_total=0) - assert "gacdi_manifest_version" in out.read_text() + assert "mcdi_version" in out.read_text() def test_version_string_includes_build(monkeypatch): - import gacdi_manifest + import mcdi - monkeypatch.setattr(gacdi_manifest, "BUILD", "deadbee") - assert gacdi_manifest.version_string() == f"{gacdi_manifest.__version__}+deadbee" + monkeypatch.setattr(mcdi, "BUILD", "deadbee") + assert mcdi.version_string() == f"{mcdi.__version__}+deadbee" - monkeypatch.setattr(gacdi_manifest, "BUILD", "") - assert gacdi_manifest.version_string() == gacdi_manifest.__version__ + monkeypatch.setattr(mcdi, "BUILD", "") + assert mcdi.version_string() == mcdi.__version__ diff --git a/cli_tools/gacdi_manifest/tests/test_join.py b/cli_tools/mcdi/tests/test_join.py similarity index 92% rename from cli_tools/gacdi_manifest/tests/test_join.py rename to cli_tools/mcdi/tests/test_join.py index addc961..85a00ee 100644 --- a/cli_tools/gacdi_manifest/tests/test_join.py +++ b/cli_tools/mcdi/tests/test_join.py @@ -1,5 +1,5 @@ -from gacdi_manifest.manifest.join import join, normalize_barcode -from gacdi_manifest.manifest.model import FileRow +from mcdi.manifest.join import join, normalize_barcode +from mcdi.manifest.model import FileRow def _filerow(uuid, sample_bc): diff --git a/cli_tools/gacdi_manifest/tests/test_model.py b/cli_tools/mcdi/tests/test_model.py similarity index 97% rename from cli_tools/gacdi_manifest/tests/test_model.py rename to cli_tools/mcdi/tests/test_model.py index 43ebac4..43f71e6 100644 --- a/cli_tools/gacdi_manifest/tests/test_model.py +++ b/cli_tools/mcdi/tests/test_model.py @@ -1,4 +1,4 @@ -from gacdi_manifest.manifest.model import ( +from mcdi.manifest.model import ( case_barcode, disease_type, galaxy_ext, diff --git a/tools/manifest_downloader/manifest_downloader.xml b/tools/manifest_downloader/manifest_downloader.xml index bf6df99..815fcd5 100644 --- a/tools/manifest_downloader/manifest_downloader.xml +++ b/tools/manifest_downloader/manifest_downloader.xml @@ -8,7 +8,7 @@ > Download files listed in a GDC or PDC manifest - quay.io/goeckslab/gacdi-manifest:0.2.0 + quay.io/goeckslab/mcdi:0.3.0 `_ or the `Proteomic Data Commons (PDC) `_, using -``gacdi-download``. The manifest's data commons is auto-detected from its +``mcdi download``. The manifest's data commons is auto-detected from its header row, so the same tool handles either kind of manifest without any extra configuration. @@ -90,4 +90,13 @@ for instructions on adding your GDC token as a credential. A collection containing the files listed in the manifest, as downloaded from the corresponding data commons. ]]> + + + diff --git a/tools/manifest_gdc/gacdi_manifest_gdc.xml b/tools/manifest_gdc/gacdi_manifest_gdc.xml index 953cd55..00d88e5 100644 --- a/tools/manifest_gdc/gacdi_manifest_gdc.xml +++ b/tools/manifest_gdc/gacdi_manifest_gdc.xml @@ -5,7 +5,7 @@ - quay.io/goeckslab/gacdi-manifest:@TOOL_VERSION@ + quay.io/goeckslab/mcdi:@TOOL_VERSION@ @@ -33,7 +33,7 @@ @misc{gacdi, title = {GaCDI: Galaxy Cancer Data Importers}, author = {GaCDI contributors}, - url = {https://github.com/paulocilasjr/GaCDI} + url = {https://github.com/goeckslab/GaCDI} } ]]>