可复现 R 科研分析工作流
简介
基于 R 语言的可复现科研分析工作流,整合统计建模、生物信息学与出版级可视化,适合学术研究与数据科学项目。
原始描述
Set up a reproducible R research workspace, install required packages, run statistical or bioinformatics analysis, and generate publication-ready reports and...
通过你的 Agent 添加
安装目录:creating-r-research-projects/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
本Skill专为R语言科研分析场景设计,通过结构化项目模板快速搭建可复现的研究工作流。激活后,Skill将自动创建包含data/、scripts/、results/、reports/的标准目录结构,并初始化renv环境以实现依赖隔离。用户可直接获得预配置的分析脚本模板,涵盖数据加载清洗、统计建模、可视化及报告生成全链路,支持CRAN与Bioconductor双源包管理,特别适配基因表达、微生物组等生物信息学分析场景。
显著优点
生态整合深度:原生集成tidyverse数据处理、ggplot2可视化、DESeq2差异表达等R语言核心工具链,避免多语言切换成本。可复现性保障:通过renv锁定依赖版本,配合R Markdown/Quarto文档化分析流程,确保研究结果6个月甚至数年后仍可完全复现。领域适配精准:针对生物信息学场景预置PCA、火山图等专用可视化模板,大幅降低组学数据下游分析门槛。输出标准化:直接生成HTML/PDF格式学术报告,图表符合期刊投稿规范,减少后期格式调整工作量。
潜在缺点与局限性
语言绑定限制:纯R生态设计,Python、Julia等用户需额外学习成本;与scikit-learn、scanpy等Python工具链无法直接互通。环境依赖较重:Bioconductor包体积庞大,初次安装可能耗时数十分钟且对网络条件敏感。交互性牺牲:Skill强调脚本化批处理,探索性数据分析(EDA)的即时反馈体验弱于Jupyter Notebook。版本兼容风险:R 4.x与3.x及Bioconductor版本存在断层,跨版本迁移可能引发依赖冲突。
适合的目标群体
生物信息学研究者:从事RNA-seq、ChIP-seq、单细胞测序等组学数据分析的科研人员。生物统计学者:需要规范假设检验、生存分析、混合效应模型等统计建模流程的用户。可复现性倡导者:重视研究透明化、受NIH数据管理政策或期刊数据共享要求约束的课题组。R语言迁移者:从SPSS/GraphPad转向代码驱动分析、希望建立标准化分析范式的新用户。
使用风险
性能风险:大型单细胞数据集(matrix达数十万细胞×数万个基因)可能触发R内存瓶颈,建议提前评估服务器配置。依赖脆弱性:Bioconductor包更新频繁,非renv锁定的环境可能因版本漂移导致分析中断。执行权限:生成的R脚本涉及本地文件系统读写,需在受控环境运行以避免误删数据。结果验证:Skill提供分析框架而非领域知识,统计方法选择、p值校正等关键决策仍需用户专业判断,盲目套用模板可能导致错误结论。
技能正文
name: creating-r-research-projects
description: Set up a reproducible R research workspace, install required packages, run statistical or bioinformatics analysis, and generate publication-ready reports and visualizations.
Creating R Research Projects
This skill helps create and manage a complete R-based research analysis workflow. It is designed for scientific computing, statistical modeling, bioinformatics, and data visualization tasks.
Use this skill when the user wants to:
- Analyze datasets using R
- Perform statistical tests or modeling
- Run bioinformatics or omics analysis in R
- Generate plots, figures, or reports
- Create a reproducible R project structure
- Install and manage R package dependencies
What This Skill Does
When activated, this skill will:
-
Create a structured R project
data/for raw and processed datascripts/for analysis coderesults/for outputsreports/for R Markdown or Quarto reports
-
Set up environment
- Initialize
.Rproj(if using RStudio) - Create
renvenvironment for reproducibility - Install required CRAN/Bioconductor packages
- Initialize
-
Generate analysis scripts
- Data loading and cleaning
- Statistical analysis or modeling
- Visualization with
ggplot2 - Save outputs (CSV, plots, model summaries)
-
Create a report
- R Markdown / Quarto document
- Includes methods, results, and figures
- Render to HTML or PDF
Example User Requests That Should Trigger This Skill
- "Use R to analyze this CSV and generate plots"
- "Run differential expression analysis in R"
- "Create a statistical report for this dataset"
- "Build an R project for microbiome analysis"
- "Fit a regression model in R and summarize results"
Example Workflow
User: Analyze this gene expression dataset and produce figures.
Skill actions:
- Create project structure
- Install
tidyverse,DESeq2,ggplot2 - Write analysis script
- Generate PCA plot and volcano plot
- Produce an HTML report
Tools & Packages Commonly Used
Purpose
R Packages
Data wrangling
tidyverse, data.table
Visualization
ggplot2, patchwork
Statistics
stats, lme4, survival
Bioinformatics
Bioconductor packages (DESeq2, edgeR, limma)
Reporting
rmarkdown, quarto
Reproducibility
renv
Notes
- Prefer reproducible workflows (
renv, scripted analysis)
- Avoid interactive-only steps unless requested
- All outputs should be saved to files, not just printed to console
| Purpose | R Packages |
|---|---|
| Data wrangling | tidyverse, data.table |
| Visualization | ggplot2, patchwork |
| Statistics | stats, lme4, survival |
| Bioinformatics | Bioconductor packages (DESeq2, edgeR, limma) |
| Reporting | rmarkdown, quarto |
| Reproducibility | renv |
- Prefer reproducible workflows (
renv, scripted analysis) - Avoid interactive-only steps unless requested
- All outputs should be saved to files, not just printed to console
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。