Skip to main content

SMURF : A matrix factorization method for single-cell

Project description

SMURF

A matrix factorization method for single-cell

Pre-requirements

  • python3
  • numpy
  • pandas
  • scipy
  • scikit-learn

Installation

Installation with pip

To install with pip, run the following from a terminal:

pip install smurf-imputaion

Usage

Basic use

import smurf
import pandas as pd

# read your data, the rows in the data represent genes, and the columns represent cells
data = pd.read_csv("data.csv", header=0, index_col=0)

# create a SCEnd object which only return the imputed data
operator = smurf.SMURF(n_features=10, estimate_only=True)

# impute
data_imputed = operator.smurf_impute(data)

# create a SCEnd object
operator = smurf.SMURF(n_features=10, estimate_only=False)

# impute
res = operator.smurf_impute(data)

# get the results
data_imputed = res["estimate"]

gene_matrix = res["gene latent factor matrix"]

cell_matrix = res["cell latent factor matrix"]

Parameters

SMURF(n_features=20, steps=10, alpha=1e-5, eps=10, noise_model="Fano", normalize=True, estimate_only=False)

Parameters

  • n_features : int, optional, default: 20

    The number of features during the matrix factorizaiton.

  • steps : int, optional, default: 0.5

    The max number of iteration.

  • alpha : float, optional, default: 1e-5

    gradient update step size. It can be so different with different dataset, please try more for a better result.

  • eps : float, optional, default: 10

    The threshold at which the objective function stops updating

  • noise_model: boolean, optional, default: "Fano"

    Our hypothetical noise model. We offer three options:

    • CV : constant variance
    • Fano : Fano factor
    • CCV : constant coefficient of variation

    We found that generally the fano model is the most stable.

  • normalize : boolean, optional, default: True

    By default, SMURF takes in an unnormalized matrix and performs library size normalization during the denoising step. However, if your data is already normalized or normalization is not desired, you can set normalize=False.

  • estimate_only : boolean, optional, default: False

    Generally, the SMURF returns a dictionary which contains the imputed matrix and gene latent factor matrix and cell latent factor matrix. If you have no need of the latent factor matrix, you can set estimate_only=True.

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

smurf-imputation-1.0.6.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smurf_imputation-1.0.6-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file smurf-imputation-1.0.6.tar.gz.

File metadata

  • Download URL: smurf-imputation-1.0.6.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for smurf-imputation-1.0.6.tar.gz
Algorithm Hash digest
SHA256 3a40463d42b0cf29f5da3b5530cf31b11643e5ae0bd307903f951b00baa5a9c7
MD5 6aef86c58d0434c7873a27879eb3ad8d
BLAKE2b-256 eb9364e830f5f89ca5ce4634b1b1e5457bfde3fac16d9b5c6e53c815aeb24fec

See more details on using hashes here.

File details

Details for the file smurf_imputation-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: smurf_imputation-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for smurf_imputation-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e803310ddd4e830b74259f86b96c5f00bc88d7c70a4d6ea249925e410e420c53
MD5 48e3451200d4fdd3df332c9ef501d20f
BLAKE2b-256 afc5c6ea57feb77289bbfac0e1da4066ecafdc5f3b5481d17714a522bd93bdd1

See more details on using hashes here.

Supported by

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