Nanostring-Biostats / InSituCor

InSituCor An R package for discovering modules of spatially correlated genes in spatial transcriptomics data.
Other
2 stars 0 forks source link

vignette should deal with flat files #20

Open patrickjdanaher opened 11 months ago

patrickjdanaher commented 11 months ago

This vignette demonstrates the functionality of InSituCor using a precompiled example dataset. InSituCor can be run using the outputs of the FlatFiles export module [link?], specifically the counts file (_exprMat_file.csv) and the metadata file (_metadata_file.csv). To replicate the vignette with the flat files, the following steps should be followed:

Load flat files

metadata <- read.csv("S0_metadata_file.csv") counts <- read.csv("S0_exprMat_file.csv")

prepare counts file

rownames(counts) <- counts$cell counts <- counts[,-c(1,2,3)] #remove metadata columns counts <- as.matrix(counts)

prepare metadata

metadata$celltype <- metadata$RNAnbclust*_clusters #cell type column name will be long conditionon <- metadata[, c("cell","celltype")] rownames(conditionon) <- metadata$cell conditionon$cell <- NULL

prepare xy data

xy <- annot[,c("cell", "x", "y")] #the x and y coordinates

cell type data

Celltype <- annot$celltype