跳到正文
cccskills
免费在 GitHub 公开

tf-target-gene-regulatory-network

Analyze human or mouse gene lists to find upstream transcription factors using curated Dorothea relationships. The workflow produces an exportable TF-target table, an Excel network data file, and a PDF visualization, with options for local database files and reproducible session details.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Use when analyzing transcription factor (TF) regulatory networks using Dorothea database. Input gene list, identify regulating transcription factors, generate TF-Target network visualization. For: transcription factor enrichment analysis, gene regulatory network research.

集成工具Excel

实测评分 未实测

查看安装方法

适用场景

  • Finding transcription factors linked to a gene list
  • Creating a TF-target network PDF
  • Exporting network relationships to Excel
  • Analyzing human or mouse gene symbols

包含的文件(43)

  • SKILL.md10.1 KB
  • database/database-get.R294 B
  • database/dorothea_hs.rds1.7 MB
  • database/dorothea_mm.rds1.4 MB
  • DESCRIPTION882 B
  • eval_report_tf-target-gene-regulatory-network_result.json17.0 KB
  • references/algorithm.md5.2 KB
  • references/cli-guide.md6.0 KB
  • references/troubleshooting.md5.7 KB
  • references/visualization-parameters.md4.4 KB
  • scripts/functions.R9.0 KB
  • scripts/main.R7.2 KB
  • scripts/run_analysis.R2.5 KB
  • scripts/utils.R7.6 KB
  • scripts/visualization.R4.1 KB
  • tests/audit_v2_case_aliases/data/tf.Rdata18.6 KB
  • tests/audit_v2_case_aliases/session_info.txt2.3 KB
  • tests/audit_v2_case_aliases/table/tf_network.xlsx8.2 KB
  • tests/audit_v2_case_aliases/table/TF_Target_Filtered_Core_human.xlsx6.6 KB
  • tests/audit_v2_case_canonical/data/tf.Rdata18.7 KB
  • tests/audit_v2_case_canonical/session_info.txt2.3 KB
  • tests/audit_v2_case_canonical/table/tf_network.xlsx9.9 KB
  • tests/audit_v2_case_canonical/table/TF_Target_Filtered_Core_human.xlsx8.2 KB
  • tests/audit_v2_case_custom/data/tf.Rdata18.6 KB
  • tests/audit_v2_case_custom/session_info.txt2.3 KB
  • tests/audit_v2_case_custom/table/tf_network.xlsx8.2 KB
  • tests/audit_v2_case_custom/table/TF_Target_Filtered_Core_human.xlsx6.6 KB
  • tests/audit_v2_case_file/data/tf.Rdata18.6 KB
  • tests/audit_v2_case_file/session_info.txt2.3 KB
  • tests/audit_v2_case_file/table/tf_network.xlsx10.9 KB
  • tests/audit_v2_case_file/table/TF_Target_Filtered_Core_human.xlsx9.3 KB
  • tests/audit_v2_case_mouse/data/tf.Rdata18.6 KB
  • tests/audit_v2_case_mouse/session_info.txt2.3 KB
  • tests/audit_v2_case_mouse/table/tf_network.xlsx9.5 KB
  • tests/audit_v2_case_mouse/table/TF_Target_Filtered_Core_mouse.xlsx7.8 KB
  • tests/data/human_genes.csv24 B
  • tests/data/human_genes.txt49 B
  • tests/data/mouse_genes.txt49 B
  • tests/test.R5.7 KB
  • tests/verify_legacy_aliases/data/tf.Rdata18.6 KB
  • tests/verify_legacy_aliases/session_info.txt2.3 KB
  • tests/verify_legacy_aliases/table/tf_network.xlsx8.2 KB
  • tests/verify_legacy_aliases/table/TF_Target_Filtered_Core_human.xlsx6.6 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Transcription Factor (TF) Regulatory Network Analysis

When to Use

  • Use this skill when you have a human or mouse gene list and want to identify upstream TFs from the Dorothea database.
  • Use it when you need a ready-to-export TF-target network table plus a publication-ready PDF network plot.
  • Use it for reproducible CLI execution with saved session information and optional local Dorothea .rds databases.

When Not to Use

  • Do not use this skill for differential expression, pathway enrichment, cell type annotation, or survival analysis.
  • Do not use it to infer causal direction beyond curated Dorothea TF-target relationships.
  • Do not use it when your input genes are aliases or mixed-species symbols that have not been normalized first.

Input Validation

This skill accepts: a human or mouse gene list (HGNC symbols for human, first-letter-uppercase for mouse) for TF regulatory network analysis using Dorothea.

If the user's request does not involve identifying upstream transcription factors from a gene list — for example, asking to run differential expression, pathway enrichment, cell type annotation, or multi-omics integration — do not proceed with the workflow. Instead respond:

"tf-target-gene-regulatory-network is designed to identify upstream transcription factors from a gene list using the Dorothea database and generate a TF-target network visualization. Your request appears to be outside this scope. Please provide a gene list for TF regulatory analysis, or use a more appropriate tool for your task."

Entry Point

  • Primary CLI entry point: scripts/main.R
  • Canonical visualization values: English tokens fr, curve, diamond, triangle, square

When to Read External Files

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdStatistical methods, Dorothea database, network analysis algorithms
Need to run analysisscripts/main.RExecute: Rscript scripts/main.R --gene ... --species ...
Encounter errorsreferences/troubleshooting.mdCommon errors and solutions
Need CLI examplesreferences/cli-guide.mdDetailed CLI usage examples
Need test datatests/data/Sample gene lists for testing

Installation

R Package Dependencies

# CRAN packages
install.packages(c("optparse", "dplyr", "openxlsx", "tidyverse", "tidygraph", "ggraph", "showtext"))

# Bioconductor packages (optional if using local database files)
if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("dorothea")

Local Database Files (Recommended)

For faster analysis and offline use, generate local database files:

Rscript database/database-get.R

This creates database/dorothea_hs.rds (human) and database/dorothea_mm.rds (mouse) in the skill root directory.

Verification

Rscript scripts/main.R --help

Usage

Rscript scripts/main.R \
  --gene "TP53,MYC,EGFR" \
  --species human \
  --output_dir ./TF_Result \
  --seed 42

Arguments

Note: Either --gene or --gene_file must be provided (at least one is required).

ShortLongTypeDefaultDescription
-g--genecharacterNULLComma-separated gene list (e.g., "TP53,MYC,EGFR") — required if --gene_file not provided
-f--gene_filecharacterNULLFile with gene names (txt or csv, one per line or comma-separated) — required if --gene not provided
-s--speciescharacterhumanSpecies: human or mouse
-o--output_dircharacterTF_ResultOutput directory name
--db_pathcharacterNULLLocal .rds database file path. If not specified, auto-searches default paths
-d--dircharacterNULLWorking root directory (advanced)
--seedinteger42Random seed for reproducibility
--titlecharacter""Main plot title

Visualization Parameters: For complete list (plot dimensions, colors, labels, layout, edge styles), see references/visualization-parameters.md. Canonical values are English tokens: fr (force-directed layout), curve (curved edges), diamond / triangle / square (node shapes).


Input Format

Gene List Input

Two ways to provide input genes:

  1. Command line: --gene "TP53,MYC,EGFR" (comma-separated)
  2. File input: --gene_file genes.txt (one gene per line or comma-separated)

Gene Naming Convention

  • Human genes: All uppercase symbols (e.g., TP53, MYC, EGFR)
  • Mouse genes: First letter uppercase only (e.g., Tp53, Myc, Egfr)
  • Use official gene symbols, not aliases
  • Case-sensitive for species matching

Species Support

  • human: Human genes (Homo sapiens)
  • mouse: Mouse genes (Mus musculus)

Performance Guidance

For large gene lists (> 500 genes), Dorothea database queries may take several minutes. Use a local .rds database (--db_path) for substantially faster lookups. There is currently no --timeout_seconds parameter; monitor progress with verbose logging if available.


Output Files

FileDescription
TF_Network_Plot.pdfTF-target network visualization
tf_network.xlsxNetwork data (edges and nodes worksheets)
TF_Target_Filtered_Core_<species>.xlsxComplete TF-target relationships table
session_info.txtR session and package version info
tf.RdataR environment data

Outputs are organized under TF_Result/ in data/, plot/, and table/ subdirectories.


Workflow

Step 1: Load Database

  • Priority search for local database files (.rds format) in: --db_path, getwd()/database/, script_dir/database/, dirname(script_dir)/database/
  • If no local file found, load from Dorothea R package
  • Filter for high-confidence interactions (confidence levels A, B, C)

Step 2: Identify Regulating TFs

  • Match input genes against target genes in Dorothea database
  • Extract transcription factors regulating these targets
  • Compute TF frequency (number of targets regulated)

Step 3: Generate Network Data

  • Create edge list (TF → Target relationships)
  • Create node list with types (TF or Target)
  • Save to Excel format for downstream analysis

Step 4: Visualize Network

  • Generate network graph using tidygraph and ggraph
  • Apply visual customization (layout, colors, shapes)
  • Save as PDF publication-ready figure

Methods

Dorothea Database

Network Analysis

  • Graph construction: TF-target relationships as directed edges
  • Layout algorithms: Multiple options including fr (force-directed), circle, grid, sphere
  • Visual customization: Full control over colors, shapes, sizes

Local Database Feature

  • Option to use pre-saved .rds files for faster analysis and offline use
  • Priority search paths for local database files (see Step 1 above)
  • Fallback to Dorothea R package if no local file found

Examples

Basic Usage (Human Genes)

Rscript scripts/main.R \
  -g "TP53,MYC,EGFR" \
  -s human \
  -o ./TF_Result

File Input

Rscript scripts/main.R \
  -f gene_list.txt \
  -s human \
  -o ./TF_Result

Mouse Genes

Rscript scripts/main.R \
  -g "Tp53,Myc,Egfr" \
  -s mouse \
  -o ./Mouse_TF_Result

Custom Styling

Rscript scripts/main.R \
  -g "PTPRC,FOXP3,CD4" \
  -s human \
  --style_layout "fr" \
  --style_line "curve" \
  --point_shape "diamond,triangle" \
  --line_color "#E64B35" \
  --title "Immune TF Network" \
  -o ./Custom_Plot

Using Local Database

Rscript scripts/main.R \
  -g "TP53,MYC,EGFR" \
  -s human \
  --db_path database/dorothea_hs.rds \
  -o ./LocalDB_Result

Error Handling

Common Errors

Error CodeCauseSolution
SKILL_FILE_NOT_FOUNDInput gene file does not existCheck file path and permissions
SKILL_NO_INPUT_GENESEmpty gene list or fileProvide genes using --gene or --gene_file
SKILL_INVALID_SPECIESSpecies not human or mouseUse human or mouse only
SKILL_INVALID_PARAMETERInvalid layout, shape, line, or legend valueUse supported values shown by Rscript scripts/main.R --help
SKILL_EMPTY_RESULTSNo TF-target relationships found for input genesCheck gene symbols and species; try broadening confidence levels
SKILL_DEPENDENCY_MISSINGMissing dplyr, dorothea, tidygraph, etc.Install missing packages (see Installation section)

Exit Status Codes

CodeMeaning
0Success
1Execution error (see error code for details)
2SKILL_EMPTY_RESULTS — no TF-target matches found for the input genes

IF error persists, READ: references/troubleshooting.md


Testing

Test with Sample Data

# Check help
Rscript scripts/main.R --help

# Run with sample human genes
Rscript scripts/main.R \
  -g "TP53,MYC,EGFR" \
  -s human \
  -o tests/output_human/

# Run with sample mouse genes
Rscript scripts/main.R \
  -g "Tp53,Myc,Egfr" \
  -s mouse \
  -o tests/output_mouse/

After running, verify tests/output_human/plot/TF_Network_Plot.pdf and tests/output_human/table/tf_network.xlsx exist and are non-empty.

Reference Files

FilePurpose
references/algorithm.mdStatistical methods and Dorothea database details
references/troubleshooting.mdCommon errors and solutions
references/cli-guide.mdCLI usage examples
references/visualization-parameters.mdComplete visualization parameter list

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Condense an academic paper into a structured abstract of up to 250 words, organized by background, objective, methods, results, and conclusion. It aims to retain key quantitative findings and supports papers from several research fields; figures and charts are not interpreted.

中文简介正在准备中。当前显示英语简介。

  • Creating a concise abstract from a research paper
  • Summarizing empirical studies while retaining key statistics
  • Preparing structured summaries across multiple papers
aipoch/medical-research-skills19802026年9月17日 更新

Trim English academic abstracts to a target word count while preserving key findings, statistics, and the background-to-conclusion structure. Choose conservative, balanced, or aggressive compression, check word counts, and review the edited text for readability and accuracy.

中文简介正在准备中。当前显示英语简介。

  • Cutting an abstract to meet a journal word limit
  • Preparing a conference abstract with a strict word count
  • Checking an abstract's word count before submission
aipoch/medical-research-skills19802026年9月17日 更新

Refines long medical drafts, reports, or literature notes into formal, single-paragraph Chinese and English abstracts in an SCI journal style. It can place both abstracts in a Markdown report while keeping claims grounded in the source text.

中文简介正在准备中。当前显示英语简介。

  • Condensing a medical study report into bilingual abstracts
  • Preparing unstructured abstracts from literature notes
  • Creating a Markdown report with Chinese and English abstracts
aipoch/medical-research-skills19802026年9月17日 更新

Creates three to five concise English Highlights for journal submission from manuscript text or supported files. It adapts bullets to the article type, keeps each within 85 characters, and grounds every claim in the supplied source without inventing results.

中文简介正在准备中。当前显示英语简介。

  • Draft journal Highlights from an abstract or manuscript
  • Summarize a meta-analysis or review for submission
  • Extract key findings from a supported PDF or DOCX
aipoch/medical-research-skills19802026年9月17日 更新

Design comparative drug safety studies using FAERS, the FDA’s adverse event reporting database, within one defined safety area. The plan compares drugs or classes, lays out workload options and analysis steps, and distinguishes detected signals from conclusions the data cannot support.

中文简介正在准备中。当前显示英语简介。

  • Comparing drug classes within one adverse event area
  • Planning a FAERS study with active comparators
  • Adding declared subgroup or onset characterization
aipoch/medical-research-skills19802026年9月17日 更新

Predicts absorption, distribution, metabolism, and excretion properties for small molecules from their structures. Use the results to compare compounds, screen libraries, and review drug-likeness scores in structured outputs. Predictions support prioritization and need experimental validation.

中文简介正在准备中。当前显示英语简介。

  • Compare predicted ADME profiles for small-molecule candidates
  • Screen a compound library for drug-likeness
  • Rank candidates against target property ranges
aipoch/medical-research-skills19802026年9月17日 更新

查看 aipoch 的全部技能

报告此技能的问题