Closed yonatans2 closed 2 years ago
The names are taken as strings from the column names in the input "anndata" file. How did you create it?
wd <- "/net/mraid14/export/tgdata/users/yonshap/proj/mmcortex/"
setwd(wd)
library(anndata)
pmc <- readRDS('./data/pl_cort_peak_mc_smoothed_mg.rds')
rownames(pmc) <- gsub("-", "_", rownames(pmc))
peaks <- misha.ext::mat_to_intervs(pmc) %>% select(chrom, start, end)
ad <- anndata::AnnData(X = t(mcp), var = peaks)
anndata::write_h5ad(anndata = ad, filename = './data/test_anndata_atac_metacell.h5ad')
So set the colnames of pmc before creating it:
colnames(pmc) <- 1:ncol(pmc)
ad <- anndata::AnnData(X = t(mcp), var = peaks)
anndata::write_h5ad(anndata = ad, filename = './data/test_anndata_atac_metacell.h5ad')
I did as much, but after import.........................................................................
I think they should be 1-based. But it should at least be consistent...