Welcome to sc-jnmf’s documentation!

sc_jnmf package

Submodules

sc_jnmf.sc_jnmf module

class sc_jnmf.sc_jnmf.sc_JNMF(D1, D2, rank, lambda1=1.0, lambda2=0.0, lambda3=0.0, lambda4=1.0, W1=None, W2=None, H=None, geneset1=None, geneset2=None, cluster=None)

Bases: object

An analysis tool using Joint-NMF for single cell gene expression profiles.

Parameters
  • D1 (pandas DataFrame) – Gene expression matrix of pandas dataframe (row : gene, col : cell). D1 columns must be same as D2 columns.

  • D2 (pandas DataFrame) – Gene expression matrix of pandas dataframe (row : gene, col : cell). D2 columns must be same as D1 columns.

  • rank (int) – The rank in matrix factorization.

  • lambda1 (float, default 1.0) – The coefficient (parameter) of |D2-W2*H|_F^2 in the objective function.

  • lambda2 (float, default 0.0) – The coefficient (parameter) of |W1| (l1 or l2 norm) in the objective function.

  • lambda3 (float, default 0.0) – The coefficient (parameter) of |W2| (l1 or l2 norm) in the objective function.

  • lambda4 (float, default 1.0) – The coefficient (parameter) of |H| (l1 or l2 norm) in the objective function.

  • W1 (2d ndarray or None, default None) – Initial value of factorized matrix (gene * rank).

  • W2 (2d ndarray or None, default None) – Initial value of factorized matrix (gene * rank).

  • H (2d ndarray or None, default None) – Initial value of factorized matrix (rank * cell).

  • geneset1 (None) – The result of ‘gene_selection’ in geneset1.

  • geneset2 (None) – The result of ‘gene_selection’ in geneset2.

  • cluster (None) – The result of cell clustering.

clustering(method='hierarchical', cluster_num=None)

This function classify the cells of input data.

Parameters
  • method (str, default 'hierarchical') – Select the methods for clustering. In this version, only ‘Hierarchical clustering’. is supported.

  • cluster_num (int or None, default None) – Give the number of clusters.

factorize(solver='mu', init='random', device='gpu')

This function fuctorize the input gene expession matrix as ‘Joint-NMF’.

Parameters
  • solver (str, default 'mu') – The solver of Joint-NMF. In this version, only ‘multiplicative update’ is supported.

  • init (str or None, defaut 'random') – The initialization of factorized matrix. In this version, only ‘random’ is supported.

  • device (str, default 'gpu') – Select the device for matrix factorization. ‘gpu’ means it is calculated using GPU, and others means calculated using CPU.

gene_selection(rm_value1=2, rm_value2=0, threshold=0.06)

Gene filter same as SC3 clustering [Kiselev et al, 2017, nature methods(doi:10.1038/Nmeth.4236)]. This function removes gene that are either expressed (expression value > rm_value1) in less than (threshold*100)% of cells (rare genes) or expressed (expression value > rm_value2) in at least (threshold*100)% of cells (ubiquitous genes).

Parameters
  • rm_value1 (int or float, default 2) – threshold for counts as “gene expression” in removing rare genes.

  • rm_value2 (int or float, default 0) – threshold for counts as “gene expression” in removing ubiquitous genes.

  • threshold (float, default 0.06) – threshold of the number of cells that satisfy the condition for removing.

log_scale()
normalize(norm='l1', normalize='cell')

This function normalize the input gene expression data.

Parameters
  • norm (str, default 'l1') – Norm parameters for sklearn.preprocessing.Normalizer.

  • normalize (str, defaault 'cell') – Select ‘cell’ or ‘gene’ as the target of normalization.

Module contents

Indices and tables