Differential Gene Expression Analysis (RNA-seq)

# Differential Gene Expression Analysis (RNA-seq) OpenCLAW Skill for bioinformatics data analysis. ## License MIT-0 ## Description This skill performs differential gene analysis using DESeq2 with simulated expression data. ## Input input/count_matrix.csv ## Output - output/volcano.png - output/pca.png - output/heatmap.png - output/diff_genes_significant.csv ## Code ```r # ============================== # OpenCLAW Skill Run Code # ============================== if (!require("BiocManager", quietly = TRUE)) { install.packages("BiocManager", repos = "https://cloud.r-project.org/") } BiocManager::install(c("DESeq2", "ggplot2", "pheatmap"), update = FALSE, ask = FALSE) library(DESeq2) library(ggplot2) library(pheatmap) if (!dir.exists("output")) dir.create("output") # Read input count_df <- read.csv("input/count_matrix.csv", row.names = 1) count_matrix <- as.matrix(count_df) group <- factor(c("Control","Control","Control","Treat","Treat","Treat")) colData <- data.frame(group = group) # DESeq2 dds <- DESeqDataSetFromMatrix(round(count_matrix), colData, ~ group) dds <- dds[rowSums(counts(dds)) > 3, ] dds <- DESeq(dds) res <- results(dds, contrast = c("group", "Treat", "Control")) res_sig <- subset(res, padj < 0.05 & abs(log2FoldChange) > 1) write.csv(as.data.frame(res_sig), "output/diff_genes_significant.csv") # Volcano res_df <- as.data.frame(res) res_df$sig <- ifelse(res_df$padj < 0.05 & abs(res_df$log2FoldChange) > 1, "Sig", "NS") p <- ggplot(res_df, aes(log2FoldChange, -log10(padj))) + geom_point(aes(color=sig)) + theme_bw() ggsave("output/volcano.png", p, dpi=300) # PCA vsd <- vst(dds, blind=FALSE) p_pca <- plotPCA(vsd, intgroup="group") + theme_bw() ggsave("output/pca.png", p_pca) # Heatmap if(nrow(res_sig) > 0) { top <- head(rownames(res_sig), 10) mat <- t(scale(t(assay(vsd)[top,]))) png("output/heatmap.png", width=800, height=600) pheatmap(mat, annotation_col=data.frame(group)) dev.off() } cat("✅ Skill run successfully\n")

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Differential Gene Expression Analysis (RNA-seq)" with this command: npx skills add differential-gene-analysis-rna-seq

Differential Gene Expression Analysis (RNA-seq)

OpenCLAW Skill for bioinformatics data analysis.

License

MIT-0

Description

This skill performs differential gene analysis using DESeq2 with simulated expression data.

Input

input/count_matrix.csv

Output

  • output/volcano.png
  • output/pca.png
  • output/heatmap.png
  • output/diff_genes_significant.csv

Code

# ==============================
# OpenCLAW Skill Run Code
# ==============================

if (!require("BiocManager", quietly = TRUE)) {
  install.packages("BiocManager", repos = "https://cloud.r-project.org/")
}

BiocManager::install(c("DESeq2", "ggplot2", "pheatmap"), update = FALSE, ask = FALSE)

library(DESeq2)
library(ggplot2)
library(pheatmap)

if (!dir.exists("output")) dir.create("output")

# Read input
count_df <- read.csv("input/count_matrix.csv", row.names = 1)
count_matrix <- as.matrix(count_df)
group <- factor(c("Control","Control","Control","Treat","Treat","Treat"))
colData <- data.frame(group = group)

# DESeq2
dds <- DESeqDataSetFromMatrix(round(count_matrix), colData, ~ group)
dds <- dds[rowSums(counts(dds)) > 3, ]
dds <- DESeq(dds)
res <- results(dds, contrast = c("group", "Treat", "Control"))
res_sig <- subset(res, padj < 0.05 & abs(log2FoldChange) > 1)
write.csv(as.data.frame(res_sig), "output/diff_genes_significant.csv")

# Volcano
res_df <- as.data.frame(res)
res_df$sig <- ifelse(res_df$padj < 0.05 & abs(res_df$log2FoldChange) > 1, "Sig", "NS")
p <- ggplot(res_df, aes(log2FoldChange, -log10(padj))) + geom_point(aes(color=sig)) + theme_bw()
ggsave("output/volcano.png", p, dpi=300)

# PCA
vsd <- vst(dds, blind=FALSE)
p_pca <- plotPCA(vsd, intgroup="group") + theme_bw()
ggsave("output/pca.png", p_pca)

# Heatmap
if(nrow(res_sig) > 0) {
  top <- head(rownames(res_sig), 10)
  mat <- t(scale(t(assay(vsd)[top,])))
  png("output/heatmap.png", width=800, height=600)
  pheatmap(mat, annotation_col=data.frame(group))
  dev.off()
}

cat("✅ Skill run successfully\n")

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Research

Differential Gene Expression Analysis (RNA-seq)

Performs differential gene expression analysis on RNA-seq count data using DESeq2 and outputs significant genes, volcano plot, PCA, and heatmap.

Registry Source
2140Profile unavailable
Research

Protein Key Fragment Analysis

蛋白质关键序列片段预测分析。对任意蛋白质家族的多物种FASTA序列执行完整分析流程,提取共识序列并识别关键功能片段、统计氨基酸组成、预测片段主要功能。适用于:(1)用户提到"提取蛋白关键序列/片段"、"分析蛋白保守区"、"预测蛋白功能片段"时,(2)对新物种/类群运行完整分析流程,(3)从已有FASTA序列提取共...

Registry SourceRecently Updated
3770Profile unavailable
Research

It is designed for scenarios that require direct operating system application and in-depth data analysis. [Forced trigger scenario]: - User mentions reading/writing/manipulating Excel, WPS, Word, TXT, Markdown, RTZ, etc. - User wants to "grab", "extract", and "get" data from any application - User needs to perform "in-depth analysis", "trend research", "anomaly detection", and "prediction" on the data - User requests to generate "charts", "visualizations", "dashboards", "data reports" - users say, "Help me see in this document..." Analyze this data...", "Make a chart presentation..." - Any task involving cross-application data flow [Core Competencies]: System interface calls × Data in-depth analysis × Professional visualization IMPORTANT: As long as it involves any of the file operations, data analysis, and visualization, this skill must be used. Don't skip tasks just because they "look simple" - there are many pitfalls in the underlying interface calls, and there are pitfall avoidance guides in the skills.

专为需要直接操作系统应用并进行深度数据分析的场景设计。 【强制触发场景】: - 用户提及 Excel、WPS、Word、TXT、Markdown、RTZ 等文件的读取/写入/操控 - 用户想从任何应用中「抓取」「提取」「获取」数据 - 用户需要对数据进行「深度分析」「趋势研究」「异常检测」「预测」 - 用户要求生...

Registry SourceRecently Updated
1.4K0Profile unavailable
Research

Novel Character Graph

Professional long-form novel analysis and character relationship mapping + theme song generation. Automatically handles GBK/UTF-8 encoding, multi-GB file chu...

Registry SourceRecently Updated
1270Profile unavailable