iCloneViz pseudocode
The pseudocode for iCloneViz is now presented, and is described and documented using a PDL (Program Design Language) structure as described in Pressman [75]. A C-style notation was utilized. A flow diagram of the pseudocode is shown in Additional File 5. The multi-omic relational integration is illustrated in Additional File 1.
Symbol Definitions:
● patient_id: Patient identifier.
● button_selection: An instance of the button that was clicked.
● button_click_filter: Boolean indicating whether an instance of the button labeled "Filter" was clicked.
● button_click_show_tsg_methylation_table: Boolean indicating whether an instance of the button labeled "Show TSG Methylation Table" was clicked.
● button_click_show_wes_table: Boolean indicating whether an instance of the button labeled "Show WES Table" was clicked.
● button_click_show_rna_table: Boolean indicating whether an instance of the button labeled "Show RNA Table" was clicked.
● exp_id []: Array of one or two patient experiment identifiers. Can be referenced via subscripting (e.g., exp_id [0]).
● exp_id[i].W: WES data in relation W for the patient experiment with the experiment identifier exp_id[i].
● filter_settings: Data structure containing all filter settings including:
○ min_vaf: Minimum variant allele frequency (default 4%).
○ max_vaf: Maximum variant allele frequency (default 100%).
○ min_depth: Minimum read depth (default 20).
○ max_depth: Maximum read depth (default 1000).
○ min_meth: Minimum methylation percent (default 25%).
○ opacity: Opacity of scatter plot points (default 50%).
○ show_kg_only: Boolean indicating whether to show only mutations found in the key genes list K (default False).
● default_filter_settings: Default values used for filtering.
/*******************************************************
Name & Purpose: Main, program entry point
Inputs: None
Processing: Establish main processing loop for iCloneViz
Outputs: None
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
main()
{
while (window is open)
{
patient_id = display_patient_search();
button_selection, exp_id[] = display_patient_experiments(patient_id);
process(button_selection, exp_id[]);
}
}
/*******************************************************
Name & Purpose: Display Patient Search, via patient ID display patient meta-data
Inputs: none
Processing: Display patient meta-data
Outputs: None
Returns: ID of selected patient from MPMDB
Authors: D. Johann, E. Peterson
********************************************************/
display_patient_search()
{
patient_id = input from user;
- get / display patient meta-data via relation
P
;
return patient_id;
}
/*******************************************************
Name & Purpose: Display Patient Experiments, show available experiments for iCloneViz analysis
Inputs: Patient ID
Processing: Retrieve patient experimental meta-data from MPMDB
Outputs: Patient experimental data now in memory
Returns: Array of experiment IDs, Button selection for selected analysis, eg, Genomic Real Estate or Paired Scatter Plot or KDE plus Scatter Plot
Authors: D. Johann, E. Peterson
********************************************************/
display_patient_experiments(patient_id)
{
- get / display all experimental data from database (MPMDB) for patient via relation
P
;
exp_id[] = selected experiment ids;
return button_selection, exp_id[]
}
/*******************************************************
Name & Purpose: Process, process data and display visualization based on the user's choice of visualization
Inputs: Button selection, & Experiment IDs
Processing: Execute specific function to handle processing based on user's choice of visualization
Outputs: None
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
process(button_selection, exp_id[])
{
if (button_selection == 'Genomic Real Estate')
genomic_real_estate(exp_id[0]);
else if (button_selection == 'Paired Scatter Plot')
paired_scatter_plot(exp_id[0...1]);
else if (button_selection == 'KD + Scatter Plot')
kd_plus_scatter_plot(exp_id[0]);
}
/*******************************************************
Name & Purpose: Genomic Real Estate, fetch WES-based mutation data, using R.NET to generate R plot and visualize
Inputs: Experiment ID of experiment to visualize
Processing: Using R.NET API, generate plot image and display in window
Outputs: Scatter plot of all mutations by chromosome and variant allele frequency, read depth is encoded by color, see Additional File 2
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
genomic_real_estate(exp_id)
{
- execute query to MPMDB to fetch mutation data based on the exp_id and DB relation
W
;
- establish the R.NET interface and invoke R;
- divide x-axis into 24 sections (22 chromosome + X,Y)
- scale each section by the length of each chromosome
for each
w
in
W
{
- plot
w
along x-axis by position, the y-axis by variant allele frequency, and color by read depth;
}
- export plot as image file;
- return execution to .NET;
- display image file in windows form;
}
/*******************************************************
Name & Purpose: Paired Scatter Plot, fetch filter settings and call function to display paired scatter plot
Inputs: Experiment IDs
Processing: If first time displaying, use default filter settings to display paired plot, otherwise, fetch filter settings from user and display paired plot
Outputs: None
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
paired_scatter_plot(exp_id[])
{
display_paired_scatter_plot(default_filter_settings, exp_id[]);
while (window is open)
{
filter_settings = read_filter_toolbar();
display_paired_scatter_plot(filter_settings, exp_id[]);
}
}
/*******************************************************
Name & Purpose: Display Paired Scatter Plot, calculate WES mutations in common and exclusive to each experiment and generate paired scatter plot
Inputs: Filter settings fetched from user input, and Experiment IDs
Processing: Fetch WES mutations, and using filter settings and referenced equations, calculate mutations in common and exclusive to each experiment; display paired scatter plot with data, see Additional File 3
Outputs: A paired scatter plot for each experiment in exp_id array, based on variant allele frequency
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
display_paired_scatter_plot(filter_settings, exp_id[])
{
// Relational algebra Eq. (9)
common = exp_id[0].W ∩ exp_id[1].W;
// Relational algebra Eq. (10)
exp0_unique = exp_id[0].W \ exp_id[1].W;
// Relational algebra Eq. (10)
exp1_unique = exp_id[1].W \ exp_id[0].W;
- label all genes in
K
;
if (filter_settings.show_kg_only == true)
- hide all non-labelled points;
- plot common, exp0_unique, and exp1_unique based on DNAllelicFreq (variant allelic frequency) using filter-settings;
}
/*******************************************************
Name & Purpose: Read Filter Toolbar, gather user-defined filter settings, and display "TSG Methylation Table", "WES Table", or "RNA Table" if the user so desires
Inputs: None
Processing: Collect filter settings from user; if the user clicks on "Filter" the filter settings are returned and they are used when displaying a desired plot; if the user clicks on "Show TSG Methylation Table", "Show WES Table", or "Show RNA Table", the desired table is displayed using the referenced equations
Outputs: Tables selected if clicked
Returns: User-defined filter settings
Authors: D. Johann, E. Peterson
********************************************************/
read_filter_toolbar()
{
while (true)
{
filter_settings.min_vaf = user input minimum VAF;
filter_settings.max_vaf = user input maximum VAF;
filter_settings.min_depth = user input minimum read depth;
filter_settings.max_depth = user input maximum read depth;
filter_settings.min_meth = user input minimum methylation percent;
filter_settings.opacity = user input scatter plot point opacity;
filter_settings.show_kg_only = user input show key gene only;
if (button_click_filter)
return filter_settings;
else if (button_click_show_tsg_methylation_table)
- display TGS Methylation Table via Relational algebra Eq. (13);
break;
else if (button_click_show_wes_table)
- display WES Table Eq. (11);
break;
else if (button_click_show_rna_table)
- display RNA Table Eq. (14);
break;
}
return filter_settings;
}
/*******************************************************
Name & Purpose: KD Plus Scatter Plot, call subroutines to process and render data for each of the individual plot areas, as well as, to calculate various metircs
Inputs: Experiment ID of experiment to visualize
Processing: Call subroutines to process and render the individual plot areas; call subroutine to calculate various metrics
Outputs: None
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
kd_plus_scatter_plot(exp_id)
{
display_kd_plot(default_filter_settings, exp_id);
display_scatter_plot(default_filter_settings, exp_id);
calculate_metrics(default_filter_settings, exp_id);
while (window is open)
{
filter_settings = read_filter_toolbar();
display_kd_plot(filter_settings, exp_id);
display_scatter_plot(filter_settings, exp_id);
calculate_metrics(filter_settings, exp_id);
}
}
/*******************************************************
Name & Purpose: Display KD Plot, displays the kernel density estimation curve, using the 'ks' R package to calculate an appropriate bandwidth
Inputs: User-defined filter settings and the experiment ID to be visualized
Processing: Calculate the KDE for DNA mutations, use R.NET to utilize the 'ks' package (used for bandwidth calculation)
Outputs: KD curve, see Figures 1 & 2
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
display_kd_plot(filter_settings, exp_id)
{
- calculate KDE based on Relational algebra Eq. (
11
) and Eq. (
2
) for all mutations in Ŵ and weighted by copy number;
- utilize R.NET to call 'hpi' function in the R 'ks', for bandwidth calculation;
- display KD plot using filter_settings;
}
/*******************************************************
Name & Purpose: Display Scatter Plot, displays the DNA mutational scatter plot, and tooltip containing RNA expression based info if available
Inputs: User-defined filter settings and the experiment ID to be visualized
Processing: Displays a scatter plot point for each DNA mutation, set each glyph depending on the degree of modality data available, and populate tooltip with RNA expression data if available
Outputs: Mutational scatter plot, see Figures 1 & 2
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
display_scatter_plot(filter_settings, exp_id)
{
- calculate Ŵ by Relational algebra Eq. (
11
) using filter_settings;
- set glyph for all DNA mutations to be a blue circle and place along a-axis according to variant allele frequency and along y-axis by depth
for each tuple ŵ in Ŵ having RNA data calculate
by Relational algebra Eq. (
12
)
{
- update point glyph, (red star, expressed RNA mutation);
- build hover-over tooltip to contain: gene name, transcript(s) ids and FPKM(s) from
;
}
- display scatter plot for each mutation in Ŵ with associated tooltip (if RNA data is available);
}
/*******************************************************
Name & Purpose: Calculate Metrics, calculate various metrics for display
Inputs: User-defined filter settings and the experiment ID to be visualized
Processing: Calculate SDI, total number of mutations, and total number of key gene mutations, for the data being visualized
Outputs: Calculated metrics
Returns: None
Authors: D. Johann, E. Peterson
********************************************************/
calculate_metrics(filter_settings, exp_id)
{
- calculate SDI using Eq. (
1
) and relation Ŵ (Relational algebra Eq. (
11
)) using filter_settings;
- calculate total number of mutations in relation Ŵ using filter_settings;
- calculate total number of key genes from
K
which are found in relation Ŵ using filter_settings;
- display metrics;
}