跳到主要内容
知仓学习社ZHICANG

bio-reporting-rmarkdown-reports

bio-reporting-rmarkdown-reports,来自 FreedomIntelligence/OpenClaw-Medical-Skills 的 agent 技能。

不碰外部(只输出文字)无严重或高危命中FreedomIntelligence/OpenClaw-Medical-Skills

它会碰到什么

扫了多少2 个文本文件,8 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

<!--

COPYRIGHT NOTICE

This file is part of the "Universal Biomedical Skills" project.

Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>

All Rights Reserved.

#

This code is proprietary and confidential.

Unauthorized copying of this file, via any medium is strictly prohibited.

#

Provenance: Authenticated by MD BABU MIA

-->


name: bio-reporting-rmarkdown-reports

description: Create reproducible bioinformatics analysis reports with R Markdown including code, results, and visualizations in HTML, PDF, or Word format. Use when generating analysis reports with RMarkdown.

tool_type: r

primary_tool: rmarkdown

measurable_outcome: Execute skill workflow successfully with valid output within 15 minutes.

allowed-tools:

  • read_file
  • run_shell_command

R Markdown Reports

Basic Document Structure

---
title: "RNA-seq Analysis Report"
author: "Your Name"
date: "`r Sys.Date()`"
output:
  html_document:
    toc: true
    toc_float: true
    code_folding: hide
    theme: cosmo
---

Setup Chunk

knitr::opts_chunk$set(

echo = TRUE,

message = FALSE,

warning = FALSE,

fig.width = 10,

fig.height = 6,

fig.align = 'center'

)

library(tidyverse)

library(DESeq2)

library(pheatmap)

Code Chunk Options

echo: show code

results: 'hide', 'asis', 'markup'

include: FALSE hides chunk entirely

eval: FALSE shows code but doesn't run

cache: TRUE caches results

Parameterized Reports

---
title: "Sample Report"
params:
  sample_id: "sample1"
  count_file: "counts.csv"
  fdr_threshold: 0.05
---

counts <- read.csv(params$count_file)

sample <- params$sample_id

fdr <- params$fdr_threshold

# Render with parameters
rmarkdown::render('report.Rmd', params = list(sample_id = 'sample2', fdr_threshold = 0.01))

# Batch render
samples <- c('sample1', 'sample2', 'sample3')
for (s in samples) {
    rmarkdown::render('report.Rmd', params = list(sample_id = s),
                       output_file = paste0(s, '_report.html'))
}

Tables

Basic kable table

knitr::kable(head(results), caption = 'Top DE genes')

Interactive table with DT

library(DT)

datatable(results, filter = 'top', options = list(pageLength = 10))

Formatted table with kableExtra

library(kableExtra)

results %>%

head(10) %>%

kable() %>%

kable_styling(bootstrap_options = c('striped', 'hover')) %>%

row_spec(which(results$padj < 0.01), bold = TRUE, color = 'red')

Figures

ggplot(results, aes(log2FoldChange, -log10(pvalue))) +

geom_point(aes(color = padj < 0.05)) +

theme_minimal()

Inline Code

We identified `r sum(res$padj < 0.05, na.rm=TRUE)` significantly
DE genes (FDR < 0.05) out of `r nrow(res)` tested.

Child Documents

---
title: "Main Report"
---

PDF Output

---
output:
  pdf_document:
    toc: true
    number_sections: true
    fig_caption: true
    latex_engine: xelatex
---

HTML with Tabs

## Results {.tabset}

### PCA Plot

plotPCA(vsd, intgroup = 'condition')


### Heatmap

pheatmap(assay(vsd)[top_genes, ])

Caching Long Computations

Cached unless counts.csv changes

dds <- DESeqDataSetFromMatrix(counts, metadata, ~ condition)

dds <- DESeq(dds)

Re-runs when deseq-analysis cache changes

res <- results(dds)

Custom CSS

---
output:
  html_document:
    css: custom.css
---
/* custom.css */
body { font-family: 'Helvetica', sans-serif; }
h1 { color: #2c3e50; }
.figure { margin: 20px auto; }

Complete Report Template

---
title: "RNA-seq Analysis Report"
author: "Bioinformatics Core"
date: "`r Sys.Date()`"
output:
  html_document:
    toc: true
    toc_float: true
    code_folding: hide
params:
  count_file: "counts.csv"
  metadata_file: "metadata.csv"
---

knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)

library(DESeq2)

library(tidyverse)

library(pheatmap)

library(DT)


## Data Overview

counts <- read.csv(params$count_file, row.names = 1)

metadata <- read.csv(params$metadata_file, row.names = 1)


Loaded `r nrow(counts)` genes across `r ncol(counts)` samples.

## Differential Expression

dds <- DESeqDataSetFromMatrix(counts, metadata, ~ condition)

dds <- DESeq(dds)

res <- results(dds) %>% as.data.frame() %>% arrange(padj)


## Results

datatable(res %>% filter(padj < 0.05), options = list(pageLength = 10))

Related Skills

  • reporting/quarto-reports - Modern alternative
  • data-visualization/ggplot2-fundamentals - Figure creation
  • differential-expression/de-visualization - Analysis plots

<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 3,010
本站分层T1
该仓技能数897
原文件路径skills/bio-reporting-rmarkdown-reports/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 897 个技能