Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A hierarchical clustering library for Cytological profiling projects written in rust

License

Notifications You must be signed in to change notification settings

LokeyLab/cp_hierarchical_clustering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cp_hierarchical_clustering

by Derfel Terciano

A hierarchical clustering library for Cytological profiling projects written in rust

Purpose

This is a submodule that will be used for HistDiff Processor to generate HistDiff heatmaps.

Implements:

  • Linkages:
    • Complete Linkage
    • Single Linkage
    • Average Linkage
  • Metrics/Matrices:
    • Distance
    • Pearson Correlation

Outputs:

  • Dendrogram as json
  • Row and column ordering

main function:

create_hierarchy(
    raw_data: &[Vec<f64>],
    mat_metric: Metric,
    link_method: LinkageMethod,
) -> Result<ClusterHierarchy, Box<dyn Error>>
  • This function takes a &[Vec<f64>] and creates a ClusterHierarchy struct that stores the clustering output.
create_hierarchy_from_df(
    df: &DataFrame,
    mat_metric: Metric,
    link_method: LinkageMethod,
    ignore_cols: &Option<Vec<usize>>,
) -> Result<ClusterHierarchy, Box<dyn Error>> {
  • This is the same main function except it converts a polars dataframe into a hierarchy

Documentation

Run cargo doc --open

TODO:

  • Implement clustering foundation
    • Implement Agglomerative clustering
  • Implement similarity/distance calculations
    • Use native vectors instead of ndarray
    • Implement Distance matrix calculation
    • Implement Pearson similarity matrix
  • Implement tree outputs
    • Output tree JSON
    • Output simple JSON output
    • Output leaf orderings
    • Output dendrogram nodes themselves

About

A hierarchical clustering library for Cytological profiling projects written in rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published