Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 26, 2025

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

  1. Navigate to General Analysis → Custom-Heatmap tab
  2. Select dataset or upload custom data
  3. Choose genes/features for visualization
  4. Configure appearance (clustering, colors, labels)
  5. Define sample groups (custom or phenotype-based)
  6. Generate heatmap with group annotations
  7. 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.

Copilot AI and others added 3 commits August 26, 2025 03:28
Co-authored-by: ShixiangWang <25057508+ShixiangWang@users.noreply.github.com>
Co-authored-by: ShixiangWang <25057508+ShixiangWang@users.noreply.github.com>
Co-authored-by: ShixiangWang <25057508+ShixiangWang@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] 自定义分组热图 Implement custom grouped heatmap feature for expression data visualization Aug 26, 2025
@Copilot Copilot AI requested a review from ShixiangWang August 26, 2025 03:37
Copilot finished work on behalf of ShixiangWang August 26, 2025 03:37
@ShixiangWang ShixiangWang requested a review from lishensuo August 26, 2025 04:52
@ShixiangWang
Copy link
Member

@lishensuo 有空看看ai的代码写的怎么样哈?是不是改改就能合并

@lishensuo
Copy link
Collaborator

@lishensuo 有空看看ai的代码写的怎么样哈?是不是改改就能合并

收到老师。等周末左右的时候,会一起处理下~

@ShixiangWang
Copy link
Member

ShixiangWang commented Aug 26, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

自定义分组热图

3 participants