Panel Merger Engine¶
The merger engine combines data from multiple sources and applies the scoring algorithm to determine final gene inclusion.
Overview¶
The PanelMerger
class implements the core scoring logic:
- Data standardization - Ensures consistent data formats across sources
- Evidence aggregation - Combines evidence from multiple sources per gene
- Scoring algorithm - Applies configurable weights and thresholds
- Decision logic - Determines final gene inclusion with veto capabilities
- Quality metrics - Provides detailed scoring statistics
Scoring System¶
The merger implements a sophisticated scoring system that balances:
- Source reliability - Evidence scores based on clinical trust
- Classification quality - Multipliers for evidence classifications
- Source diversity - Confidence scores based on supporting sources
- Clinical priorities - Final weights and veto capabilities
API Reference¶
custom_panel.engine.merger ¶
Gene panel merger and scoring engine.
This module provides functionality to merge gene panels from multiple sources, apply scoring logic, and make inclusion decisions.
PanelMerger ¶
Gene panel merger and scoring engine.
Initialize the panel merger.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
dict[str, Any]
|
Configuration dictionary |
required |
create_master_list ¶
Create master gene list from multiple source DataFrames.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataframes
|
list[DataFrame]
|
List of standardized DataFrames from different sources |
required |
output_manager
|
Any
|
Optional output manager for saving intermediate files |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
Master DataFrame with merged and scored genes |
export_gene_lists ¶
Export gene lists for different categories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
Master DataFrame |
required |
output_dir
|
str | Path
|
Output directory |
required |
Returns:
Type | Description |
---|---|
dict[str, str]
|
Dictionary mapping category to output file path |
filter_by_category ¶
Filter genes by inclusion.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
Master DataFrame |
required |
category
|
str
|
Category to filter by (only "include" is supported now) |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
Filtered DataFrame |
get_scoring_summary ¶
Generate summary statistics for scoring results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
Scored DataFrame |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Summary statistics dictionary |