From 1a5816467193f5c212ae5b6e49fc82b1c6ab9c56 Mon Sep 17 00:00:00 2001 From: UCDNJJ Date: Fri, 17 Mar 2023 22:35:28 -0700 Subject: [PATCH] fix output rownames --- R/loadTaxonomy.R | 4 ++-- R/taxonomy_mapping.R | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/R/loadTaxonomy.R b/R/loadTaxonomy.R index d10dd38..54b6b46 100644 --- a/R/loadTaxonomy.R +++ b/R/loadTaxonomy.R @@ -28,7 +28,7 @@ loadTaxonomy = function(refFolder, ## Convert count data into a matrix countsReference = as.matrix(countsReference[,names(countsReference)!=gene_id]) rownames(countsReference) = colnames(datReference) - countsReference = t(countsReference) + countsReference = Matrix::t(countsReference) }else{ countsReference = NULL } @@ -97,10 +97,10 @@ loadTaxonomy = function(refFolder, } ) } + # This next bit should NOT be needed, but the anndata crashes without it if(is_tibble(umap.coords)){ umap.coords = as.data.frame(umap.coords) - print(class(umap.coords)) rownames(umap.coords) = umap.coords[,sample_id] } diff --git a/R/taxonomy_mapping.R b/R/taxonomy_mapping.R index ff71a07..d945066 100644 --- a/R/taxonomy_mapping.R +++ b/R/taxonomy_mapping.R @@ -45,6 +45,7 @@ taxonomy_mapping = function(AIT.anndata, query.data, corr.map=TRUE, tree.map=TRU ############# ## Combine mapping results mappingAnno = Reduce(cbind, mappingResults) + rownames(mappingAnno) = colnames(query.data) ## Add query sample names to mapping results ############# ## ---- Convert cell type mappings to subclass, neighborhood (if available), and class -------------------------------