buildMappingDirectory.Rd
Starting from an anndata object this function builds the minimum files required for patch-seq shiny
buildMappingDirectory(
AIT.anndata,
mappingFolder,
query.data,
query.metadata,
query.mapping,
genes.to.use = paste0("highly_variable_genes_", AIT.anndata$uns$mode),
doPatchseqQC = TRUE,
metadata_names = NULL,
min.confidence = 0.7,
return.metrics = FALSE,
embedding = NULL,
verbose = TRUE
)
A reference taxonomy object.
The location to save output files for patch-seq (or other query data) results, e.g. "/allen/programs/celltypes/workgroups/rnaseqanalysis/shiny/star/human/human_patchseq_MTG_JAM_TEST/current/"
A CPM normalized matrix to be annotated.
A data frame of metadata for the query data.
Mapping results from taxonomy_mapping()
, must be an mappingClass S4 object. If provided row names must match column names in query.data.
The set of genes to use for patch-seq shiny creation (default is the highly_variable_genes associated with the current mode). Can be (1) a character vector of gene names, (2) a TRUE/FALSE (logical) vector of which genes to include, or (3) a column name in AIT.anndata$var corresponding to a logical vector of variable genes.
Boolean indicating whether patch-seq QC metrics should be calculated (default) or not.
An optional named character vector where the vector NAMES correspond to columns in the metadata matrix and the vector VALUES correspond to how these metadata should be displayed in Shiny. This is used for writing the desc.feather file later.
Probability below which a cell cannot be assigned to a cell type (default 0.7). In other words, if no cell types have probabilities greater than resolution.index, then the assigned cluster will be an internal node of the dendrogram.
If TRUE (default=FALSE) will return an updated query.metadata data frame with additional metrics calculated as part of this function. Otherwise, these values are available in 'anno.feather'.
Name of the embedding to project patch-seq data against. Default is to use X_default_mode if it exists; otherwise to use AIT.anndata$uns$default_embedding.
Should detail logging be printed to the screen?
This function writes files to the mappingFolder directory for visualization with molgen-shiny tools — anno.feather - query metadata — data.feather - query data — dend.RData - dendrogram (copied from reference) — desc.feather - table indicating which anno columns to share — memb.feather - tree mapping of each query cell to each tree node (not just the best matching type like in treeMap) — tsne.feather - low dimensional coordinates for data — tsne_desc.feather - table indicating which low-D representations to share