metasnf2.1.2 package

Meta Clustering with Similarity Network Fusion

add_columns

Add columns to a data frame

add_settings_df_rows

Add rows to a settings_df

adjusted_rand_index_heatmap

Heatmap of pairwise adjusted rand indices between solutions

alluvial_cluster_plot

Alluvial plot of patients across cluster counts and important features

arrange_dll

Sort data frames in a data list by their unique ID values

as_ari_matrix

Convert an object to an ARI matrix

as_data_list

Convert an object to a data list

as_settings_df

Convert an object to a settings data frame

as_sim_mats_list

Convert an object to a similarity matrix list

as_snf_config

Convert an object to a snf config

as_weights_matrix

Convert an object to a weights matrix

as.data.frame.data_list

Coerce a data_list class object into a data.frame class object

as.data.frame.ext_solutions_df

Coerce a ext_solutions_df class object into a data.frame class obj...

as.data.frame.settings_df

Coerce a settings_df class object into a data.frame class object

as.data.frame.snf_config

Coerce a settings_df class object into a data.frame class object

as.data.frame.solutions_df

Coerce a solutions_df class object into a data.frame class object

as.data.frame.t_ext_solutions_df

Coerce a t_ext_solutions_df class object into a data.frame class o...

as.data.frame.t_solutions_df

Coerce a t_solutions_df class object into a data.frame class objec...

as.data.frame.weights_matrix

Coerce a weights_matrix class object into a data.frame class objec...

as.list.clust_fns_list

Coerce a clust_fns_list class object into a list class object

as.list.data_list

Coerce a data_list class object into a list class object

as.list.dist_fns_list

Coerce a dist_fns_list class object into a list class object

as.list.sim_mats_list

Coerce a sim_mats_list class object into a list class object

as.list.snf_config

Coerce a snf_config class object into a list class object

as.matrix.ari_matrix

Coerce a ari_matrix class object into a matrix class object

as.matrix.weights_matrix

Coerce a weights_matrix class object into a matrix class object

assemble_data

Collapse a data frame and/or a data list into a single data frame

assoc_pval_heatmap

Heatmap of pairwise associations between features

auto_plot

Automatically plot features across clusters

bar_plot

Bar plot separating a feature by cluster

batch_row_closure

Generate closure function to run batch_snf in an apply-friendly format

batch_snf_subsamples

Run SNF clustering pipeline on a list of subsampled data lists

batch_snf

Run variations of SNF

calc_aris

Construct an ARI matrix storing inter-solution similarities

calc_assoc_pval_matrix

Calculate p-values for all pairwise associations of features in a data...

calc_assoc_pval

Calculate p-values based on feature vectors and their types

calc_nmis

Calculate feature NMIs for a data list and a solutions data frame

calculate_coclustering

Calculate co-clustering data

cat_colours

Helper function for generating categorical colour palette

cell_significance_fn

Place significance stars on ComplexHeatmap cells

char_to_fac

Convert character-type columns of a data frame to factor-type

check_cfll_fn_args

Check if functions in a distance metrics list-like have valid argument...

check_cfll_fns

Check if items of a clustering functions list-like object are function...

check_cfll_named

Check if clustering functions list-like object has named algorithms

check_cfll_unique_names

Check if names in a clustering functions list-like object are unique

check_compatible_sdf_cfl

Check if settings_df exceeds bounds of clust_fns_list

check_compatible_sdf_dfl

Check if settings_df exceeds bounds of dist_fns_list

check_compatible_sdf_wm

Check if settings_df and weights_matrix have same number of rows

check_dataless_annotations

Helper function to stop annotation building when no data was provided

check_dfll_fn_args

Check if functions in a distance metrics list-like have valid argument...

check_dfll_fn_names

Check if functions in a distance metrics list-like have names

check_dfll_item_names

Check if items of a distance metrics list-like object have valid names

check_dfll_subitems_are_fns

Check if items of a distance metrics list-like object are functions

check_dfll_unique_names

Check if names in a distance metrics list-like object are unique

check_dll_duplicate_components

Check if data list contains any duplicate names

check_dll_duplicate_features

Check if data list contains any duplicate features

check_dll_empty_input

Error if empty input provided during data list initialization

check_dll_four_subitems

Error if data list-like list doesn't have only 4-item nested lists

check_dll_inherits_list

Error if data list-like structure isn't a list

check_dll_subitem_classes

Check if UID columns in a nested list have valid structure for a data ...

check_dll_subitem_names

Check valid item names for a data list-like list

check_dll_types

Error if data list-like structure has invalid feature types

check_dll_uid

Check if UID columns in a nested list have valid structure for a data ...

check_hm_dependencies

Check for ComplexHeatmap and circlize dependencies

check_sdfl_colnames

Check if settings data frame inherits class data.frame

check_sdfl_is_df

Check if settings data frame inherits class data.frame

check_sdfl_numeric

Check if settings data frame is numeric

check_similarity_matrices

Check validity of similarity matrices

check_valid_k

Check if max K exceeds the number of observations

check_valid_sc

Check if SNF config has valid structure

chi_squared_pval

Chi-squared test p-value (generic)

clust_fns_list

Build a clustering algorithms list

clust_fns

Built-in clustering algorithms

cocluster_density

Density plot of co-clustering stability across subsampled data

cocluster_heatmap

Heatmap of observation co-clustering across resampled data

coclustering_coverage_check

Co-clustering coverage check

collapse_dl

Convert a data list into a data frame

colour_scale

Return a colour ramp for a given vector

convert_uids

Convert unique identifiers of data list to "uid"

data_list

Build a data_list class object

discretisation_evec_data

Internal function for estimate_nclust_given_graph

discretisation

Internal function for estimate_nclust_given_graph

dist_fns_list

Build a distance metrics list

dist_fns

Built-in distance functions

dl_variable_summary

Variable-level summary of a data list

dlapply

Apply-like function for data list objects

dll_uid_first_col

Make the uid UID columns of a data list first

domains

Pull domains from a data list

dplyr_row_slice.ext_solutions_df

Function to extend dplyr to extended solutions data frame objects

dplyr_row_slice.solutions_df

Function to extend dplyr to solutions data frame objects

drop_cols

Helper function to remove columns from a data frame

drop_inputs

Execute inclusion

ensure_dll_df

Ensure the data item of each component is a data.frame class object

esm_manhattan_plot

Manhattan plot of feature-cluster association p-values

estimate_nclust_given_graph

Estimate number of clusters for a similarity matrix

ext_solutions_df

Constructor for ext_solutions_df class object

extend_solutions

Extend a solutions data frame to include outcome evaluations

features

Return character vector of features stored in an object

fisher_exact_pval

Fisher exact test p-value

generate_annotations_list

Generate annotations list

generate_clust_algs_list

Generate a clustering algorithms list

generate_distance_metrics_list

Generate a list of distance metrics

generate_settings_matrix

Build a settings data frame

get_cluster_df

Extract cluster membership information from one solutions data frame r...

get_cluster_solutions

Extract cluster membership information from a sol_df

get_clusters

Extract cluster membership vector from one solutions data frame row

get_complete_uids

Pull complete-data UIDs from a list of data frames

get_dist_matrix

Calculate distance matrices

get_dl_uids

Extract UIDs from a data list

get_heatmap_order

Return the row or column ordering present in a heatmap

get_matrix_order

Return the hierarchical clustering order of a matrix

get_mean_pval

Get mean p-value

get_min_pval

Get minimum p-value

get_pvals

Get p-values from an extended solutions data frame

get_representative_solutions

Extract representative solutions from a matrix of ARIs

gexclude

Helper function to drop columns from a data frame by grepl search

gselect

Helper function to pick columns from a data frame by grepl search

is_data_list

Test if the object is a data list

jitter_plot

Jitter plot separating a feature by cluster

label_meta_clusters

Assign meta cluster labels to rows of a solutions data frame or extend...

label_prop

Label propagation

label_propagate

Label propagate cluster solutions to non-clustered observations

label_splits

Convert a vector of partition indices into meta cluster labels

linear_adjust

Linearly correct data list by features with unwanted signal

linear_model_pval

Linear model p-value (generic)

mc_manhattan_plot

Manhattan plot of feature-meta cluster association p-values

merge_df_list

Merge list of data frames into a single data frame

merge.clust_fns_list

Merge clust_fns_list objects

merge.data_list

Merge observations between two compatible data lists

merge.dist_fns_list

Merge dist_fns_list objects

merge.ext_solutions_df

Merge ext_solutions_df objects

merge.settings_df

Merge settings_df objects

merge.sim_mats_list

Merge sim_mats_list objects

merge.snf_config

Merge method for SNF config objects

merge.solutions_df

Merge solutions_df objects

merge.t_ext_solutions_df

Merge t_ext_solutions_df objects

merge.t_solutions_df

Merge t_solutions_df objects

merge.weights_matrix

Merge weights_matrix objects

metasnf_alert

Helper function for raising alerts

metasnf_defunct

Helper function for defunct function errors

metasnf_deprecated

Helper function for deprecated function warnings

metasnf_error

Helper function for raising errors

metasnf_warning

Helper function for raising warnings

metasnf-package

metasnf: Meta Clustering with Similarity Network Fusion

n_features

Extract number of features stored in an object

n_observations

Extract number of observations stored in an object

new_ari_matrix

Constructor for ari_matrix class object

new_clust_fns_list

Constructor for clust_fns_list class object

new_data_list

Constructor for data_list class object

new_dist_fns_list

Constructor for dist_fns_list class object

new_ext_solutions_df

Constructor for ext_solutions_df class object

new_settings_df

Constructor for settings_df class object

new_sim_mats_list

Constructor for similarity_matrix_list class object

new_snf_config

Constructor for snf_config class object

new_solutions_df

Constructor for solutions_df class object

new_weights_matrix

Constructor for weights_matrix class object

not_shown_message

Helper function for creating what hidden ft/obs/sols message

numcol_to_numeric

Convert columns of a data frame to numeric type (if possible)

ord_reg_pval

Ordinal regression p-value

parallel_batch_snf

Parallel processing form of batch_snf

pick_cols

Helper function to pick columns from a data frame

pl

Helper function to pluralize a string

plot.ari_matrix

Heatmap of pairwise adjusted rand indices between solutions

plot.data_list

Plot of feature values in a data list

plot.ext_solutions_df

Plot of cluster assignments in an extended solutions data frame

plot.snf_config

Heatmap for visualizing an SNF config

plot.solutions_df

Plot of cluster assignments in a solutions data frame

prefix_dll_uid

Add "uid_" prefix to all UID values in uid column

print_with_n_message

Helper function for outputting tip on changing rows printed

print_with_t_message

Helper function for transposing solutions_df message

print.ari_matrix

Print method for class ari_matrix

print.clust_fns_list

Print method for class clust_fns_list

print.data_list

Print method for class data_list

print.dist_fns_list

Print method for class dist_fns_list

print.ext_solutions_df

Print method for class ext_solutions_df

print.settings_df

Print method for class settings_df

print.sim_mats_list

Print method for class sim_mats_list

print.snf_config

Print method for class snf_config

print.solutions_df

Print method for class solutions_df

print.t_ext_solutions_df

Print method for class t_ext_solutions_df

print.t_solutions_df

Print method for class t_solutions_df

print.weights_matrix

Print method for class weights_matrix

pval_heatmap

Heatmap of p-values

quality_measures

Quality metrics

random_removal

Generate random removal sequence

rbind.ext_solutions_df

Row-binding of solutions data frame class objects

rbind.solutions_df

Row-binding of solutions data frame class objects

rbind.t_solutions_df

Row-binding of t_solutions_df class objects

rbind.weights_matrix

Row-bind weights matrices

remove_dll_incomplete

Remove observations with incomplete data from a data list-like list ob...

rename_dl

Rename features in a data list

reorder_dl_uids

Reorder the uids in a data list

resample

Helper resampling function found in ?sample

run_snf

Run SNF

save_heatmap

Save a heatmap object to a file

scale_diagonals

Adjust the diagonals of a matrix

settings_df

Build a settings data frame

shiny_annotator

Launch a shiny app to identify meta cluster boundaries

sim_mats_list

Create or extract a sim_mats_list class object

similarity_matrix_heatmap

Plot heatmap of similarity matrix

similarity_matrix_path

Generate a complete path and filename to store an similarity matrix

siw_euclidean_distance

Squared (including weights) Euclidean distance

snf_config

Define configuration for generating a set of SNF-based cluster solutio...

snf_scheme

SNF schemes

snf_step

Helper function for using the correct SNF scheme

sol_df_col_order

Helper function for organizing solutions df-like column order

solutions_df

Constructor for solutions_df class object

split_parser

Helper function to determine which row and columns to split on

str.ari_matrix

Structure of a ari_matrix object

str.clust_fns_list

Structure of a clust_fns_list object

str.data_list

Structure of a data_list object

str.dist_fns_list

Structure of a dist_fns_list object

str.ext_solutions_df

Structure of a ext_solutions_df object

str.settings_df

Structure of a settings_df object

str.sim_mats_list

Structure of a sim_mats_list object

str.snf_config

Structure of a snf_config object

str.solutions_df

Structure of a solutions_df object

str.t_ext_solutions_df

Structure of a t_ext_solutions_df object

str.t_solutions_df

Structure of a t_solutions_df object

str.weights_matrix

Structure of a weights_matrix object

subsample_dl

Create subsamples of a data list

subsample_pairwise_aris

Calculate pairwise adjusted Rand indices across subsamples of data

summarize_clust_fns_list

Summarize a clust_fns_list object

summarize_dfl

Summarize a distance functions list

summarize_dl

Summarize a data list

summarize_pvals

Summarize p-value columns of an extended solutions data frame

summary_features

Pull features used to calculate summary p-values from an object

summary.ari_matrix

Summary method for class ari_matrix

summary.clust_fns_list

Summary method for class clust_fns_list

summary.data_list

Summary method for class data_list

summary.dist_fns_list

Summary method for class dist_fns_list

summary.ext_solutions_df

Summary method for class ext_solutions_df

summary.settings_df

Summary method for class settings_df

summary.sim_mats_list

Summary method for class sim_mats_list

summary.snf_config

Summary method for class snf_config

summary.solutions_df

Summary method for class solutions_df

summary.t_ext_solutions_df

Summary method for class t_ext_solutions_df

summary.t_solutions_df

Summary method for class t_solutions_df

summary.weights_matrix

Summary method for class weights_matrix

train_test_assign

Training and testing split

uids

Pull UIDs from an object

validate_ari_matrix

Validator for ari_matrix class object

validate_clust_fns_list

Validator for clust_fns_list class object

validate_data_list

Validator for data_list class object

validate_dist_fns_list

Validator for dist_fns_list class object

validate_ext_solutions_df

Validator for ext_solutions_df class object

validate_settings_df

Validator for settings_df class object

validate_sim_mats_list

Validator for similarity_matrix_list class object

validate_snf_config

Validator for snf_config class object

validate_solutions_df

Validator for solutions_df class object

validate_weights_matrix

Validator for weights_matrix class object

var_manhattan_plot

Manhattan plot of feature-feature association p-values

weights_matrix

Generate a matrix to store feature weights

Framework to facilitate patient subtyping with similarity network fusion and meta clustering. The similarity network fusion (SNF) algorithm was introduced by Wang et al. (2014) in <doi:10.1038/nmeth.2810>. SNF is a data integration approach that can transform high-dimensional and diverse data types into a single similarity network suitable for clustering with minimal loss of information from each initial data source. The meta clustering approach was introduced by Caruana et al. (2006) in <doi:10.1109/ICDM.2006.103>. Meta clustering involves generating a wide range of cluster solutions by adjusting clustering hyperparameters, then clustering the solutions themselves into a manageable number of qualitatively similar solutions, and finally characterizing representative solutions to find ones that are best for the user's specific context. This package provides a framework to easily transform multi-modal data into a wide range of similarity network fusion-derived cluster solutions as well as to visualize, characterize, and validate those solutions. Core package functionality includes easy customization of distance metrics, clustering algorithms, and SNF hyperparameters to generate diverse clustering solutions; calculation and plotting of associations between features, between patients, and between cluster solutions; and standard cluster validation approaches including resampled measures of cluster stability, standard metrics of cluster quality, and label propagation to evaluate generalizability in unseen data. Associated vignettes guide the user through using the package to identify patient subtypes while adhering to best practices for unsupervised learning.

  • Maintainer: Prashanth S Velayudhan
  • License: GPL (>= 3)
  • Last published: 2025-04-28