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.
65
82%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
.rds databases.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."
scripts/main.Rfr, curve, diamond, triangle, square| Situation | File to Read | Purpose |
|---|---|---|
| Need algorithm details | references/algorithm.md | Statistical methods, Dorothea database, network analysis algorithms |
| Need to run analysis | scripts/main.R | Execute: Rscript scripts/main.R --gene ... --species ... |
| Encounter errors | references/troubleshooting.md | Common errors and solutions |
| Need CLI examples | references/cli-guide.md | Detailed CLI usage examples |
| Need test data | tests/data/ | Sample gene lists for testing |
# 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")For faster analysis and offline use, generate local database files:
Rscript database/database-get.RThis creates database/dorothea_hs.rds (human) and database/dorothea_mm.rds (mouse) in the skill root directory.
Rscript scripts/main.R --helpRscript scripts/main.R \
--gene "TP53,MYC,EGFR" \
--species human \
--output_dir ./TF_Result \
--seed 42Note: Either --gene or --gene_file must be provided (at least one is required).
| Short | Long | Type | Default | Description |
|---|---|---|---|---|
-g | --gene | character | NULL | Comma-separated gene list (e.g., "TP53,MYC,EGFR") — required if --gene_file not provided |
-f | --gene_file | character | NULL | File with gene names (txt or csv, one per line or comma-separated) — required if --gene not provided |
-s | --species | character | human | Species: human or mouse |
-o | --output_dir | character | TF_Result | Output directory name |
--db_path | character | NULL | Local .rds database file path. If not specified, auto-searches default paths | |
-d | --dir | character | NULL | Working root directory (advanced) |
--seed | integer | 42 | Random seed for reproducibility | |
--title | character | "" | 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).
Two ways to provide input genes:
--gene "TP53,MYC,EGFR" (comma-separated)--gene_file genes.txt (one gene per line or comma-separated)human: Human genes (Homo sapiens)mouse: Mouse genes (Mus musculus)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.
| File | Description |
|---|---|
TF_Network_Plot.pdf | TF-target network visualization |
tf_network.xlsx | Network data (edges and nodes worksheets) |
TF_Target_Filtered_Core_<species>.xlsx | Complete TF-target relationships table |
session_info.txt | R session and package version info |
tf.Rdata | R environment data |
Outputs are organized under TF_Result/ in data/, plot/, and table/ subdirectories.
--db_path, getwd()/database/, script_dir/database/, dirname(script_dir)/database/fr (force-directed), circle, grid, sphere.rds files for faster analysis and offline useRscript scripts/main.R \
-g "TP53,MYC,EGFR" \
-s human \
-o ./TF_ResultRscript scripts/main.R \
-f gene_list.txt \
-s human \
-o ./TF_ResultRscript scripts/main.R \
-g "Tp53,Myc,Egfr" \
-s mouse \
-o ./Mouse_TF_ResultRscript 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_PlotRscript scripts/main.R \
-g "TP53,MYC,EGFR" \
-s human \
--db_path database/dorothea_hs.rds \
-o ./LocalDB_Result| Error Code | Cause | Solution |
|---|---|---|
SKILL_FILE_NOT_FOUND | Input gene file does not exist | Check file path and permissions |
SKILL_NO_INPUT_GENES | Empty gene list or file | Provide genes using --gene or --gene_file |
SKILL_INVALID_SPECIES | Species not human or mouse | Use human or mouse only |
SKILL_INVALID_PARAMETER | Invalid layout, shape, line, or legend value | Use supported values shown by Rscript scripts/main.R --help |
SKILL_EMPTY_RESULTS | No TF-target relationships found for input genes | Check gene symbols and species; try broadening confidence levels |
SKILL_DEPENDENCY_MISSING | Missing dplyr, dorothea, tidygraph, etc. | Install missing packages (see Installation section) |
| Code | Meaning |
|---|---|
0 | Success |
1 | Execution error (see error code for details) |
2 | SKILL_EMPTY_RESULTS — no TF-target matches found for the input genes |
IF error persists, READ: references/troubleshooting.md
# 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.
| File | Purpose |
|---|---|
references/algorithm.md | Statistical methods and Dorothea database details |
references/troubleshooting.md | Common errors and solutions |
references/cli-guide.md | CLI usage examples |
references/visualization-parameters.md | Complete visualization parameter list |
686e09d
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.