metacell pipeline functions

mcell_add_cgraph_bknn_norm_mc()

Build a cell graph using balanced knn after normalizing over a given metacell model

mcell_add_cgraph_from_distmat()

Build a cell graph using blanacing of an extrenal distance matrix

mcell_add_cgraph_from_mat_bknn()

Build a cell graph using balanced knn graph on given gene features

mcell_add_cgraph_from_mat_raw_knn()

Build a cell graph using raw knn graph on given gene features

mcell_add_gene_names_xref_mars10x()

Create a gene name xref for heuristc map of mars/10x

mcell_add_gene_stat()

mcell_gene_stat

mcell_add_mars_facs_data()

Creates a new matrix object from a given one by adding FACS index sorting data to matrix metadata table

mcell_add_mc_from_graph()

Compute metacell using a native implementation of a graph cover k-means-like approach

mcell_batch_stats()

generate a batch stat table for a given single cell umi matrix

mcell_calc_one_batch_stats()

calc batch stats - essentially umi distribution

mcell_cgraph_norm_gcor()

Computing gene-gene correlation normaized over a similarity graph

mcell_coclust_filt_by_k_deg()

Return a filter (boolean vector) selecting only coclust edges that are nearly as frequent as a user defined K-nn parameter

mcell_coclust_from_graph_resamp()

Compute metacell using resampling iterations of graph cover k-means-like approach

mcell_compare_bulk()

Utility plot function to compare bulk expression of two batches/metadata factors

mcell_gen_atlas()

wrap up an atlas object from mc, mc2d and matrix ids

mcell_gen_cell_cor_gset()

Compute a cell cell correlation matrix using features defined by a gene set

mcell_graph_pred_corr()

Compute predictive value of MC cover as correlation of MC averages of sc umis

mcell_gset_add_gene()

adding genes to a gene set

mcell_gset_filter_cov()

gnereate/filter gene features from coverage threshold in gstat table

mcell_gset_filter_multi()

Select/filter gene features from using multiple statistics from the gstat table. All genes passing the selected thresholds are included

mcell_gset_filter_szcor()

gnereate/filter gene features from statistics on correlation with umi count

mcell_gset_filter_varmean()

gnereate/filter gene features from gstat normalized var/mean

mcell_gset_from_mc_markers()

Generate a gene set of markers from a metacell cover

mcell_gset_remove_clusts()

add new gene set based on an existing one with filtering specific clusters

mcell_gset_split_by_dsmat()

split gene set into several modules using clustering of genes by correlation over cells downsampled umi vector

mcell_import_multi_mars()

Load a matrix from a MARS-seq multi-batch dataset. The scdb version of mcell_read_multi_scmat_mars

mcell_import_multi_scmat_10x()

Load a matrix from a 10x multi-batch dataset. The scdb version of mcell_read_multi_scmat_10x

mcell_import_scmat_10x()

Load a matrix from a 10x dataset. The scdb version of mcell_read_multi_scmat_10x

mcell_import_scmat_tsv()

Load a matrix from a simple dense table with genes in rows and cells in columns. First column is the gene name

mcell_mat_ignore_cells()

Generate a new matrix object with a given ignore cell list

mcell_mat_ignore_genes()

Generate a new matrix object with a given ignore gene list

mcell_mat_ignore_small_cells()

Generate a new matrix object after removing cells without enough umis

mcell_mat_rpt_cor_anchors()

Find and report naive gene gene correlation over umi matrix

mcell_mc2d_force_knn()

Metacell layout using force directed projection of a low degree mc graph

mcell_mc2d_force_knn_on_cells()

Compute cells 2d coordinates based on the mc graph when the mc coordinates are supplied externally

mcell_mc2d_plot()

Plot mc+cell graph using pre-defined mc colorization

mcell_mc2d_plot_by_factor()

Plot mc+cells using pre-defined mc colorization, breakdown by given metadata field (e.g. patient)

mcell_mc2d_plot_gene()

Plot the (log2) metacell footprint value of the selected gene on the 2d projection

mcell_mc2d_rotate()

Rotatae/invert projection

mcell_mc_add_annot()

Update metacell annotation

mcell_mc_add_color()

Update metacells colors

mcell_mc_cell_homogeneity()

Compute cell homogeneity - the fraction of intra mc edges per cell

mcell_mc_coclust_confusion_mat()

Compute confusion matrix on metacells using a coclustering object

mcell_mc_confusion_mat()

Compute confusion matrix on metacells

mcell_mc_edge_density()

for each MC we compute mean and variance of the intra-MC edge density

mcell_mc_export_tab()

Output genes cell modules footprint matrix with metadata on the cell modules

mcell_mc_from_coclust_balanced()

build a metacell cover from co-clust data through filtering un-balanced edges and running graph cover

mcell_mc_from_coclust_hc()

build a metacell cover from a co-clust object using a simple hclust approach

mcell_mc_from_coclust_louv_sub()

build a metacell cover from a big co-clust using louvain clustering and metacell coverage within clusters

mcell_mc_hclust_confu()

comput mc hierarchucal clustering using the normalized confusion matrix

mcell_mc_hierarchy()

identify super structure in an mc cover, based on hcluster of the confusion matrix

mcell_mc_match_graph()

TEst if a graph object cover all cells in the mc

mcell_mc_plot_by_factor()

plot a heatmap of number of cells per metacell and metadata factor (e.g. patient, condition, sample etc.)

mcell_mc_plot_confusion()

plot a metacel confusion matrix

mcell_mc_plot_gg()

Utility plot function to compare two genes based on mc_fp

mcell_mc_plot_hierarchy()

plot super strucutre: super clust mc footprint, and selected genes

mcell_mc_plot_marks()

plot a marker heat map give a metacell object

mcell_mc_plot_submc_marks()

plot a marker heat map for a subset of metacells - selecting relevant genes for separation

mcell_mc_plot_vgels()

plot a "gel" like diagram showing expression of a gene of interest over metacells that are classified into types

mcell_mc_pred_corr()

Compute predictive value of MC cover as correlation of MC averages of sc umis

mcell_mc_reorder_hc()

Reorder metacells using hierarchical clustering

mcell_mc_screen_outliers_1gene_fold()

Simple screen for outlier cells in a metacell cover, finding genes with overly high expression given their metacell mean

mcell_mc_split_by_color_group()

Splits input metacell object into sub-objects by color group, naming the new metacells <mc_id>_submc_<group>

mcell_mc_split_filt()

Split and filter metacells using dbscan and outlier gene detection

mcell_merge_mats()

ncell_merge_mats: Merge two matrix using their ids in scdb. See scm_merge_mats for details on batch management and policies on missing genes

mcell_mgraph_knn()

Compute metacell manifod graph using the confusion matrix of balanced K-nn between individual cells projected on metacells

mcell_mgraph_logistic()

Compute metacell manifold graph using logistic distances and balanced K-nn

mcell_new_mc()

Generate a new metacell in scdb

mcell_new_mc2d()

Generate a new metacell in scdb

mcell_new_mc_mgraph()

Generate a new metacell manifold graph object

mcell_new_mcatlas()

Generate a new atlas in scdb

mcell_new_mctnetwork()

Generate a new network in scdb

mcell_pipe_mat2mc2d()

Linear simple pipeline for turning a matrix to a MC and plotting std figs

mcell_plot_batch_stats()

plot batches stats

mcell_plot_cross_mc()

Plotting a matrix of co-occurences between two metacell covers of the same dataset

mcell_plot_gset_cor_mats()

Plot gene set correlation matrices given a an scamt. See version using metacells for potentially more robust behavior. This is used to detemrine initial feature selectio (e.g. filtering biologically irrelevant gene modules)

mcell_plot_gstats()

plot gene/feature statistics

mcell_plot_outlier_heatmap()

Plot and outlier heat map.

mcell_plot_umis_per_cell()

Plot histogram of total number of umis per cell in the umis matrix

mcell_proj_on_atlas()

Project a metacell object on a reference "atlas"

mcell_read_multi_scmat_10x()

read multiple 10x umi matrices and merge them, based on a table defining the datasets. Field amp_batch_id from the table is added to the cell name to prevent cell names clashes.

mcell_read_multi_scmat_mars()

read multiple MARS umi matrices and merge them, based on a table defining the datasets.

mcell_scmat_plot_cmp_kcor()

Analyze cell cell cor

mcell_wgtmc_pred_corr()

Compute predictive value of MC cover as correlation of weighted MC averages of sc umis

scdb functions

scdb_add_cgraph()

scdb_add_cgraph - add cgraph to the DB and cahce

scdb_add_coclust()

scdb_add_coclust - add coclust to the DB and cahce

scdb_add_gene_names_xref()

scdb_add_gene_names_xref - add a gene name xref tab to the DB - will save it and cache

scdb_add_gset()

scdb_add_gset - add gset to the DB and cahce

scdb_add_gstat()

scdb_add_gstat - add gstat to the DB and cahce

scdb_add_mat()

scdb_add_mat - add amatrix to the DB - will save it and cache

scdb_add_mc()

scdb_add_mc - add mc to the DB and cahce

scdb_add_mc2d()

scdb_add_mc2d - add mc2d to the DB and cahce

scdb_add_mcatlas()

scdb_add_mcatlas - add mcatlas to the DB and cahce

scdb_add_mctnetwork()

scdb_add_mctnetwork - add mctnetwork to the DB and cahce

scdb_add_mgraph()

scdb_add_mgraph - add mgraph to the DB and cahce

scdb_cgraph()

scdb_cgraph - get a cgraph object

scdb_coclust()

scdb_coclust - get a coclust object

scdb_del_cgraph()

scdb_del_cgraph - del cgraph from the DB and cahce

scdb_del_coclust()

scdb_del_coclust - del coclust from the DB and cahce

scdb_del_gene_names_xref()

scdb_del_gene_names_xref - remove a gene names xref from the DB (not just the cache!)

scdb_del_gset()

scdb_del_gset - del gset from the DB and cahce

scdb_del_gstat()

scdb_del_gstat - del gstat from the DB and cahce

scdb_del_mat()

scdb_del_mat - remove a matrix from the DB (not just the cache!)

scdb_del_mc()

scdb_del_mc - del mc from the DB and cahce

scdb_del_mc2d()

scdb_del_mc2d - del mc2d from the DB and cahce

scdb_del_mcatlas()

scdb_del_mcatlas - del mcatlas from the DB and cahce

scdb_del_mctnetwork()

scdb_del_mctnetwork - del mctnetwork from the DB and cahce

scdb_del_mgraph()

scdb_del_mgraph - del mgraph from the DB and cahce

scdb_gene_names_xref()

scdb_gene_names_xref - get gene names convertor table from db

scdb_gset()

scdb_gset - get a gene set

scdb_gstat()

scdb_gstat - get a gstat data frame. If it is missing and the id match an existing matrix, a gstat will be gerated for this matrix and added to scdb

scdb_init()

Initializing scdb

scdb_is_valid()

Testing is scdb is initialized

scdb_ls()

List all object of a given type from the current scdb

scdb_ls_loaded()

scdb_ls_loaded - list loaded object of a certain type

scdb_mat()

scdb_mat - get matrix from db, load it if needed

scdb_mc()

scdb_mc - get a mc object

scdb_mc2d()

scdb_mc2d - get a mc2d object

scdb_mcatlas()

scdb_mcatlas - get a mcatlas object

scdb_mctnetwork()

scdb_mctnetwork - get a mctnetwork object

scdb_mgraph()

scdb_mgraph - get a mgraph object

scm functions

scm_add_mars_facs_data()

Adds FACS index sorting data to matrix metadata table

scm_downsamp()

downsampl

scm_export_mat_to_sce()

Export a mat object (umi matrix and metadata table) to a SingleCellExperiment object

scm_gene_stat()

Calculate basic statistics on a matrix

scm_ignore_cells()

Set ignored (i.e. blacklisted) cells

scm_ignore_genes()

Set ignored (i.e. blacklisted) genes

scm_import_sce_to_mat()

Import a umi count matrix with metadata per cell from a SingleCellExperiment objectto a scmat object to a SingleCellExperiment object

scm_merge_mats()

Merge multiple single cell matrix object.

scm_new_matrix()

Constract a tgScMat

scm_sub_mat()

Extract sub-matrix. This return a matrix object on a subset of the genes and cells.

scm_which_downsamp_n()

Determine recommended downsampling depth.

scmat_read_scmat_10x()

Read a matrix from the output of a 10x run. Batches can be stripped from the cell identifier if in BARCODE-LANE format.

scmat_read_scmat_10x_custom()

Read a custom count matrix from the output of a 10x run. Batches can be stripped from the cell identifier if in BARCODE-LANE format.

metacell functions

mc_colorize()

colorize metacell using a set of prefered markers and their colors

mc_colorize_default()

colorize metacell using an ugly default color spectrum, or a user supplied one

mc_colorize_from_ref_mc()

colorize metacell by projecting colors from another metacell on a similar (not identical) set of cells

mc_colorize_sup_hierarchy()

colorize metacells using a set of super MCs derived by hclust, colored according to a user defined table

mc_compute_cov_gc()

Compute fraction of non zero expressing cells per gene and mc

mc_compute_e_gc()

Compute metacell absolute mean umi per cell

mc_compute_fp()

Compute metacell gene footprint

mc_compute_n_bc()

Compute distribution of cells over batches and metacell

mc_compute_outlier_fc()

Compute log fold change expression of each gene given its regularized metacell expression

mc_reorder()

Reorder metacell data given defined order

mc_restrict()

Create a metacell object on a subset of the MCs, with all other cells becoming outliers. There is no re-normalization of mc_fp.

mc_set_outlier_mc()

Move all cels from specific metacells to the outliers

mc_update_stats()

Compute stats over metacell and update the object

gene set functions

gset_add_genes()

Add specific genes to the set

gset_get_feat_mat()

extract umi matrix for the genes in the set, possibly donwsampling

gset_get_genes()

Get genes of one set

gset_import_table()

Import gene set for a text table

gset_new_gset()

Generating a new gset

gset_new_restrict_gset()

Generate a new gene set from an existing one, filtered by a list of genes

gset_new_restrict_nms()

Generate a new gene set from an existing one, filtered by a list of genes

gset_write_table()

Exprt gene set to a table

classes

tgCellGraph-class

Cell graph

tgCoClust-class

Metacell colustering object

tgGeneSets-class

Gene sets interface

tgMC2D-class

Meta cell 2d projection

tgMCAtlas-class

wrap up an atlas object from mc, mc2d and matrix ids

tgMCCov-class

Meta cell cover

tgMCManifGraph-class

manifold graph structure over a metacell object

tgMCTNetwork-class

temporal netwrok over metacells

tgScMat-class

Single cell RNA-seq matrix

initialize(<tgCellGraph>)

This constructs graph object from a data frame on columns col1,col2, weight, (the format returened by tgs_cor_graph). Note this is not intended to serve natively complex graph algs etc, but is just a container for use by scdb and operaitons on scmats (creating a graph) and mcell (using the graph to compute graph covers)

initialize(<tgCoClust>)

Construct a coclust object

initialize(<tgGeneSets>)

tgGeneSets public constructor

initialize(<tgMC2D>)

Construct a meta cell 2D embedding

initialize(<tgMCAtlas>)

Construct a meta cell reference atlas

initialize(<tgMCCov>)

Construct a meta cell object

initialize(<tgMCManifGraph>)

Construct a meta cell manifold graph

initialize(<tgMCTNetwork>)

Construct a meta cell time network

utils

plot_color_bar()

Plot a color bar with values

port_cor()

port_cor matrix correlation wrap. Parameter selects which function to use, cor or tgs_cor. Tgs_cor can be more efficien if available

allrow_cor()

computing correlations between all rows in two matrices

rescale_sparse_mat_cols()

Efficient version for scaling all columns in a sparse matrix

tgs_cor_graph()

wrapping tgs functions to compute balanced graph from a matrix

scfigs_dir()

Generate a standard figure dir name igven and object and figure type

scfigs_fn()

Generate a standard figure name igven and object and figure type

scfigs_init()

scgfig_set_base - set base directory for metacell figures, creates it if it doesn't exist.