Giter Site home page Giter Site logo

yyt1002 / featuremap Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 112.67 MB

FeatureMAP (Feature-preserving Manifold Approximation and Projection) is an interpratable dimensionality reduction tool.

Home Page: https://featuremap.readthedocs.io/en/latest/index.html

License: BSD 3-Clause "New" or "Revised" License

HTML 16.32% Python 0.43% Jupyter Notebook 83.25%
data-visualization dimensionality-reduction interpretable-machine-learning single-cell-analysis tangent-space-embedding

featuremap's Introduction

FeatureMAP Illustration

FeatureMAP: Feature-preserving Manifold Approximation and Projection

Visualizing single-cell data is crucial for understanding cellular heterogeneity and dynamics. Traditional methods like UMAP and t-SNE are effective for clustering but often miss critical gene information. FeatureMAP innovatively combines UMAP and PCA concepts to preserve both clustering structures and gene feature variations within a low-dimensional space.

Description

FeatureMAP introduces a novel approach by enhancing manifold learning with pairwise tangent space embedding, aiming to retain crucial aspects of cellular data. We introduce two visualization plots by FeatureMAP: expression (GEX) and variation (GVA) embedding. Here is an example over one synthetic dataset (BEELINE) with a bifurcation model. Compared with UMAP, FeatureMAP-GEX better preserves density, and FeatureMAP-GVA shows trajectories. Bifurcation Embedding

Besides the two-dimensional visualization, FeatureMAP presents three core concepts:

  1. Gene Contribution: Estimating and projecting gene feature loadings. The arrow represents the direction and magnitude of one gene's change. Gene Contribution

  2. Gene Variation Trajectory: Tracking the cell differentiation across states. There are clear paths (transition states) connecting cell states (core states) in a knot-and-thread way. Gene Variation Trajectory View 3D Plot

  3. Core and Transition States: Defined computationally through cell density and cell variation properties. Core states are cells with higher cell density and smaller cell variation, while transition states are lower cell density and larger cell variation. Core and Transition States

These enhancements allow for differential gene variation (DGV) analysis, highlighting key regulatory genes that drive transitions between cellular states. Tested on both synthetic and real single-cell RNA sequencing (scRNA-seq) data, including studies on pancreatic development and T-cell exhaustion (Tutorials in ??), FeatureMAP provides a more detailed understanding of cellular trajectories and regulatory mechanisms.

Getting Started

Dependencies

  • Python 3.8 or higher
  • Required Python libraries: numpy, scipy, matplotlib, umap-learn, scikit-learn
  • Operating System: Any (Windows, macOS, Linux)

Installation

1. Install directly using pip:

pip install featuremap-learn

How to use FeatureMAP

Data Visualization

For data visualization, FeatureMAP introduces expression embedding and variation embedding. Here is one example by MNIST datasets.

import featuremap
from sklearn.datasets import fetch_openml
from sklearn.utils import resample

digits = fetch_openml(name='mnist_784')
subsample, subsample_labels = resample(digits.data, digits.target, n_samples=7000, stratify=digits.target, random_state=1)

x_emb = featuremap.featureMAP().fit_transform(subsample)
v_emb = featuremap.featureMAP(output_variation=True).fit_transform(subsample)

Parameters:

output_variation: bool (False by default). Decide to generate expression embedding or variation embedding.

Outputs

x_emb: expession embedding to show the clustering

v_emb: variation embedding to show the trajectory

Documentation

More tutorials are at https://featuremap.readthedocs.io/en/latest/index.html.

Citation

Our FeatureMAP alogrithm is based on the paper

Yang, Yang, et al. "Interpretable Dimensionality Reduction by Feature Preserving Manifold Approximation and Projection." arXiv preprint arXiv:2211.09321 (2022).

License

The FeatureMAP package is under BSD-3-Clause license.

featuremap's People

Contributors

yyt1002 avatar amoschoomy avatar

Watchers

 avatar

featuremap's Issues

Deleted package detected

I'm a Cyber Security researcher and developer of PackjGuard [1] to address open-source software supply chain attacks.

Issue

During my research, I detected a deleted package in this repository.

Details

Specifically, the package featuremap mentioned in file README at line 41 does not exist on the public PyPI registry. A bad actor can hijack this package to propagate malicious code.

Impact

Not only your apps/services using https://github.com/YYT1002/FeatureMAP repo code are vulnerable to this attack, but the users of your open-source Github repo could also fall victim.

You could read more about such attacks here: https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610

Remediation

Please highlight this in file README and register a placeholder package for featuremap on public PyPI soon to remediate.

To automatically fix such issues in future, please install PackjGuard Github app [1].

Thanks!

  1. PackjGuard is a Github app that monitors your repos 24x7, detects vulnerable/malicious/risky open-source dependencies, and creates pull requests for auto remediation: https://github.com/marketplace/packjguard

Deleted package detected

I'm a Cyber Security researcher and developer of PackjGuard [1] to address open-source software supply chain attacks.

Issue

During my research, I detected a deleted package in this repository.

Details

Specifically, the package featuremap-learn mentioned in file README at line 41 does not exist on the public PyPI registry. A bad actor can hijack this package to propagate malicious code.

Impact

Not only your apps/services using https://github.com/YYT1002/FeatureMAP repo code are vulnerable to this attack, but the users of your open-source Github repo could also fall victim.

You could read more about such attacks here: https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610

Remediation

Please highlight this in file README and register a placeholder package for featuremap-learn on public PyPI soon to remediate.

To automatically fix such issues in future, please install PackjGuard Github app [1].

Thanks!

  1. PackjGuard is a Github app that monitors your repos 24x7, detects vulnerable/malicious/risky open-source dependencies, and creates pull requests for auto remediation: https://github.com/marketplace/packjguard

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.