Implement custom grouped heatmap feature for expression data visualization
This PR implements a comprehensive custom grouped heatmap feature that addresses the need for "自定义分组热图" (Custom Grouped Heatmap) functionality in UCSCXenaShiny.
Key Features
Custom Sample Grouping
The implementation supports two flexible grouping methods:
-
Manual Definition: Users can define custom sample groups using an intuitive format:
Group1: TCGA-AA-3502,TCGA-AA-3506,TCGA-AA-3514 Group2: TCGA-AA-3510,TCGA-AA-3520,TCGA-AA-3524 - Phenotype-based: Automatic grouping using existing phenotype variables from clinical data
Expression Data Visualization
- Displays expression data with genes as rows and samples as columns (as requested)
- Multi-gene selection with search functionality
- Support for both UCSC Xena datasets and custom uploaded data
- Configurable gene limits (5-500 genes) for performance optimization
Advanced Visualization Options
- Multiple clustering methods (complete, average, single, ward.D, etc.)
- Rich color palette selection (viridis, plasma, RdYlBu, Spectral, etc.)
- Configurable display options (gene names, sample names, clustering toggles)
- Visual group annotations displayed as colored bars above the heatmap
Technical Implementation
- Multi-backend Support: Uses ComplexHeatmap as primary backend with pheatmap fallback for broader compatibility
- Robust Data Handling: Includes error handling, data validation, and missing value management
- Export Functionality: Download support for PNG/PDF formats with proper handling for different plot types
- UI Integration: Seamlessly integrated as new "Custom-Heatmap" tab in General Analysis page
Usage Workflow
- Navigate to General Analysis → Custom-Heatmap tab
- Select dataset or upload custom data
- Choose genes/features for visualization
- Configure appearance (clustering, colors, labels)
- Define sample groups (custom or phenotype-based)
- Generate heatmap with group annotations
- Download results in preferred format
Files Changed
-
New Module:
inst/shinyapp/modules/01_general/modules-ga-custom-heatmap.R -
UI Integration:
inst/shinyapp/ui/general-analysis.R -
Server Integration:
inst/shinyapp/server/general-analysis.R -
Dependencies: Added ComplexHeatmap, pheatmap, viridis, circlize, grid to
DESCRIPTION
This implementation provides the exact functionality requested for custom grouped heatmap visualization and establishes a solid foundation for future enhancements, such as overlaying different molecular data types.
Fixes #218.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
@lishensuo 有空看看ai的代码写的怎么样哈?是不是改改就能合并
@lishensuo 有空看看ai的代码写的怎么样哈?是不是改改就能合并
收到老师。等周末左右的时候,会一起处理下~
嗯,这个就玩一玩看看,有空搞搞就行,不着急 ---- 回复的原邮件 ---- 发件人 @.> 日期 2025年08月26日 13:04 收件人 @.> 抄送至 Shixiang Wang @.>@.> 主题 Re: [openbiox/UCSCXenaShiny] Implement custom grouped heatmap feature for expression data visualization (PR #375) lishensuo left a comment (openbiox/UCSCXenaShiny#375) @lishensuo 有空看看ai的代码写的怎么样哈?是不是改改就能合并 收到老师。等周末左右的时候,会一起处理下~ — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were assigned.Message ID: @.***>