Giter VIP home page Giter VIP logo

pycliquetop_2023's Introduction

PyCliqueTop_2023

Written on August 28, 2023 by Nikki Sanderson

PyCliqueTop_2023 is a Python version of the MATLAB CliqueTop package by Chad Giusti corresponding to the 2015 PNAS paper "Clique topology reveals intrinsic geometric structure in neural correlations".

Persisent homology (previously computed using the software Perseus) is now computed using the python package Ripser (https://ripser.scikit-tda.org).

To run the functions in PyCliqueTop_2023, you'll need first install Ripser. To install Ripser, you'll need Cython. To install both of these, run the following in your terminal:

pip install Cython

pip install Ripser

PyCliqueTop_2023 computes Betti curves of clique complexs for an input similarity (ex. correlation) or dissimilarity (ex. distance) matrix. The main functions are:

  • compute_betti_curves() - takes as input a symmetric matrix and outputs Betti curves

  • plot_betti_curves() - takes as input the Betti curves output by compute_betti_curves() and plots the Betti curves

The wrapper function 'compute_betti_curves()' calls on the functions 'matrix_2_order_matrix()', 'matrix_2_persistence_diagrams()', and 'persistence_diagrams_2_betti_curves()' internally. It also has two optional input parameters: 'max_dim' and 'similarity'. The first optional parameter 'max_dim' allows the user to set a maximum homological dimension up to which to compute the persistent homology (default 'max_dim' = 3). The second optional parameter 'similarity' is a boolean that allows the user to specify whether the input matrix is a similarity (ex. correlation) or dissimilarity (ex. distance) matrix (default 'similarity' = True).

To test that these functions work on your own machine, please run the following example scripts included in this directory. They should all produce output plots.

  • pycliquetop_script_1.py
  • pycliquetop_script_2.py
  • pylciquetop_script_3.py

These example scripts also include many comments about how to use the PyCliqueTop_2023 functions, so please also read through the example scripts for additional information that may be helpful. Further comments about the PyCliqueTop_2023 functions are also included in the function scripts themselves.

Dependencies: Python3, numpy, scipy, scipy.io, scipy.stats, matplotlib, Ripser

pycliquetop_2023's People

Contributors

nerdnik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.