How alleninstitute/scrattch works
Project type and purpose
• This is an R “umbrella” package (modeled after the tidyverse) that bundles installation, update, and helper functions for a suite of downstream scrattch.* packages.
File structure
• Top-level metadata: DESCRIPTION, NAMESPACE, README.md, LICENSE, CONTRIBUTION.
• R/: contains core function definitions:
• dependencies.R (declare child-package dependencies)
• install.R (functions: install_scrattch(), install_bioc_deps(), install_github_deps(), install_scrattch_deps())
• inst/: supporting scripts & data shipped in the package:
• generate_function_table.R (script to build function lookup)
• scrattch_function_list.csv (generated table of exported functions)
• man/: autogenerated documentation for each exported function.
• Build metadata: .Rbuildignore, .gitignore, scrattch.Rproj.
• No “runtime” services or web server; it’s a library/package.
README for additional insights
• Emphasis on using Docker/Singularity to install the full suite.
• References to external repositories (child packages) and Docker Hub.
• Historical branches (scrattch_2023, archive).
Main components & interactions
a. Components:
1. User environment (R session or HPC via Singularity)
2. Umbrella package “scrattch”:
• Core R functions (install, dependency management, palettes)
• Inst scripts and function lookup table
• Man pages
3. External package registries:
• CRAN/Bioconductor (for Bioconductor dependencies)
• GitHub (for child scrattch.* repos)
4. Docker Hub / Singularity (optional runtime environment)
5. Child packages (not part of this repo but orchestrated):
• scrattch.taxonomy, scrattch.mapping, scrattch.hicat, etc.
b. Relationships & data flow:
• User invokes scrattch::install_scrattch()
→ install_scrattch calls install_bioc_deps() to fetch Bioconductor packages
→ install_github_deps() to fetch child repos from GitHub
→ (optionally) instructs Docker client or Singularity to pull/run container
→ Returns: child packages installed & ready in user’s R library.
c. Architectural patterns / design principles:
• “Facade” pattern: provides a single interface (scrattch) to a complex subsystem of child packages.
• Modular layering: Core functions separated (R/) from shipped scripts/data (inst/) and docs (man/).
• Convention over configuration: standard R package structure.
d. Key technologies / frameworks:
• R (base, devtools)
• Bioconductor
• GitHub API (via usethis/devtools)
• Docker / Singularity
• Roxygen2 (doc generation)
Elements
• “User R Session”
• “Bioconductor registry”
• “GitHub repos”
• “Docker Hub / Singularity runtime”
• User → scrattch::install_scrattch()
• scrattch → Bioconductor
• scrattch → GitHub
• scrattch → Docker/Singularity (optional)
Final recommendations
• Be exhaustive: represent each folder’s role (R/, inst/, man/).
• Orchestration logic flow — this is the heart of the umbrella pattern.