analyze-r-package
Analyze an R/Bioconductor package to understand its structure, purpose, and key characteristics.
Usage
Invoke this skill when you want to understand an R package's architecture:
- "Analyze this R package"
- "Tell me about this package structure"
Prerequisites
- Working directory is an R package root (contains DESCRIPTION file)
- Package has standard R structure (R/, NAMESPACE, etc.)
Process
- Read Package Metadata: Analyze
DESCRIPTION for name, purpose, version, dependencies, and classify its type (Data, Analysis, Infrastructure, Utility) based on biocViews.
- Identify Exports: Parse
NAMESPACE for exported functions and (if present) S4 classes/methods. Categorize exports broadly (Data access, Processing, Visualization, Utility).
- Examine Directory Structure: Note the presence of
data/, inst/extdata/, vignettes/, tests/testthat/, and src/.
- Detect Data Access Patterns: Search
R/ source files for remote data access (ExperimentHub, AnnotationHub, DuckDB, AWS S3, HuggingFace, etc.) vs local data access.
- Identify Classes: List R class definitions (S3, S4, R6, S7) and their properties/slots/fields.
- Read README: Extract high-level purpose and key features.
- Analyze Testing: Check
tests/testthat/ structure, file count, and remote vs local test data.
- List Vignettes: Check
vignettes/ for .Rmd files, extracting titles and purposes.
Output Format
Produce a structured markdown summary:
## Package Analysis: [Package Name]
### Classification
- **Type**: [Data/Analysis/Infrastructure/Utility]
- **Purpose**: [1-2 sentence summary]
- **Version**: [version number]
### Key Exports ([count] total)
- **Data Access Functions**: [list]
- **Data Processing Functions**: [list]
- **Utility Functions**: [list]
### Data Access Pattern
- **Type**: [None / Local Only / Remote / Hybrid]
- **Technologies**: [e.g., ExperimentHub, DuckDB]
### Classes
- [ClassName] - [Type: S3/S4/R6/S7] - [description]
### Documentation & Testing
- **Vignettes**: [List with titles]
- **Testing**: [Framework, count, data types]
### Special Characteristics
[List notable patterns that should be documented]
### Dependencies of Note
[List key Bioconductor or specialized packages]
Examples
Example: Data Package Analysis
User: "Analyze this R package"
Agent: (Analyzes parkinsonsMetagenomicData repository)
## Package Analysis: parkinsonsMetagenomicData
### Classification
- **Type**: Data Package
- **Purpose**: Provides uniformly processed gut microbiome data via remote parquet files accessed through DuckDB.
- **Version**: 0.99.0
### Key Exports (18 total)
**Data Access Functions** (5):
- `returnSamples()` - Main high-level data retrieval function
- `loadParquetData()` - Load filtered data from DuckDB connection
**Discovery Functions** (5):
- `parquet_colinfo()` - Inspect column structure
- `biobakery_files()` - List available data types
### Data Access Pattern
- **Type**: Hybrid (Remote primary, Local for testing)
- **Technologies**: DuckDB for remote parquet access, TreeSummarizedExperiment output
### Documentation & Testing
**Vignettes** (4):
1. codebook.Rmd - Data Codebook
2. full-workflow.Rmd - Comprehensive tutorial
**Testing**:
- Framework: testthat (3 files)
- Test data: inst/extdata/ (parquet, TSV, RDS)
### Special Characteristics
- Uses DuckDB for efficient remote parquet file querying without full download
Integration
This analysis output is consumed by create-package-instructions and update-package-instructions.
See also: create-package-instructions
1---2name: analyze-r-package3description: Analyze R/Bioconductor package structure to extract key information about its purpose, exports, and characteristics4---56# analyze-r-package78Analyze an R/Bioconductor package to understand its structure, purpose, and key characteristics.910## Usage1112Invoke this skill when you want to understand an R package's architecture:13- "Analyze this R package"14- "Tell me about this package structure"1516## Prerequisites1718- Working directory is an R package root (contains DESCRIPTION file)19- Package has standard R structure (R/, NAMESPACE, etc.)2021## Process22231. **Read Package Metadata**: Analyze `DESCRIPTION` for name, purpose, version, dependencies, and classify its type (Data, Analysis, Infrastructure, Utility) based on `biocViews`.242. **Identify Exports**: Parse `NAMESPACE` for exported functions and (if present) S4 classes/methods. Categorize exports broadly (Data access, Processing, Visualization, Utility).253. **Examine Directory Structure**: Note the presence of `data/`, `inst/extdata/`, `vignettes/`, `tests/testthat/`, and `src/`.264. **Detect Data Access Patterns**: Search `R/` source files for remote data access (ExperimentHub, AnnotationHub, DuckDB, AWS S3, HuggingFace, etc.) vs local data access.275. **Identify Classes**: List R class definitions (S3, S4, R6, S7) and their properties/slots/fields.286. **Read README**: Extract high-level purpose and key features.297. **Analyze Testing**: Check `tests/testthat/` structure, file count, and remote vs local test data.308. **List Vignettes**: Check `vignettes/` for `.Rmd` files, extracting titles and purposes.3132## Output Format3334Produce a structured markdown summary:3536```markdown37## Package Analysis: [Package Name]3839### Classification40- **Type**: [Data/Analysis/Infrastructure/Utility]41- **Purpose**: [1-2 sentence summary]42- **Version**: [version number]4344### Key Exports ([count] total)45- **Data Access Functions**: [list]46- **Data Processing Functions**: [list]47- **Utility Functions**: [list]4849### Data Access Pattern50- **Type**: [None / Local Only / Remote / Hybrid]51- **Technologies**: [e.g., ExperimentHub, DuckDB]5253### Classes54- [ClassName] - [Type: S3/S4/R6/S7] - [description]5556### Documentation & Testing57- **Vignettes**: [List with titles]58- **Testing**: [Framework, count, data types]5960### Special Characteristics61[List notable patterns that should be documented]6263### Dependencies of Note64[List key Bioconductor or specialized packages]65```6667## Examples6869### Example: Data Package Analysis7071**User**: "Analyze this R package"7273**Agent**: (Analyzes `parkinsonsMetagenomicData` repository)7475```markdown76## Package Analysis: parkinsonsMetagenomicData7778### Classification79- **Type**: Data Package80- **Purpose**: Provides uniformly processed gut microbiome data via remote parquet files accessed through DuckDB.81- **Version**: 0.99.08283### Key Exports (18 total)84**Data Access Functions** (5):85- `returnSamples()` - Main high-level data retrieval function86- `loadParquetData()` - Load filtered data from DuckDB connection8788**Discovery Functions** (5):89- `parquet_colinfo()` - Inspect column structure90- `biobakery_files()` - List available data types9192### Data Access Pattern93- **Type**: Hybrid (Remote primary, Local for testing)94- **Technologies**: DuckDB for remote parquet access, TreeSummarizedExperiment output9596### Documentation & Testing97**Vignettes** (4):981. codebook.Rmd - Data Codebook992. full-workflow.Rmd - Comprehensive tutorial100101**Testing**:102- Framework: testthat (3 files)103- Test data: inst/extdata/ (parquet, TSV, RDS)104105### Special Characteristics106- Uses DuckDB for efficient remote parquet file querying without full download107```108109## Integration110111This analysis output is consumed by `create-package-instructions` and `update-package-instructions`.112113---114115**See also**: [create-package-instructions](../create-package-instructions/SKILL.md)