Skip to main content

A Python implementation of FlowSOM algorithm with parallelized consensus metaclustering

Project description

FlowSOM

Python implementation of the FlowSOM algorithm based on minisom and ConsensusClustering.

The main advantage over the current implementations is the parallelized nature of the ConsensusClustering.

Installation

    pip install flowsom-clustering

Basic usage:

import numpy as np
import pandas as pd
from FlowSOM import flowsom

# import your data via pandas or numpy

data = pd.DataFrame(data = np.random.rand(250,10),
                    columns = [str(i) for i in range(10)])

cluster_annotations = flowsom(data = data, # input data array
                              x_dim = 50, # x dimension of the self organized map
                              y_dim = 50, # y dimension of the self organized map
                              sigma = 1, # spread of the neighborhood function
                              learning_rate = 0.5, # initial learning rate
                              n_iterations = 100, # trains the map for 100 iterations
                              neighborhood_function = "gaussian", # defines the neighborhood function
                              consensus_cluster_algorithm = "AgglomerativeClustering", # runs Consensus Clustering with Agglomerative Clustering
                              consensus_cluster_min_n = 10, # minimum n_clusters to check for optimal clustering
                              consensus_cluster_max_n = 50, # maximum n_clusters to check for optimal clustering
                              consensus_cluster_resample_proportion = 0.5, # resample proportion for the consensus finding
                              consensus_cluster_n_resamples = 10, # number of resamples for consensus clustering
                              verbose = False, # whether to be verbose
                              n_jobs = None, # number of joblib.Parallel threads
                              random_state = 187 # seed for reproducibility of the results
                              )

data["flowsom_consensus"] = cluster_annotations

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flowsom_clustering-0.0.7.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

flowsom_clustering-0.0.7-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page