navinlabcode / copykat

Other
193 stars 54 forks source link

Error all cells are filtered when using copykat on anndata object converted to seurat object #57

Closed cmills2 closed 1 year ago

cmills2 commented 2 years ago

Hi @gaobio . I am importing an AnnData object that is converted to Seurat object. I am getting this same Error message. I have verified that the cells are columns and genes are rows and am using a human sample. If you could review and advise that would be great. Thank you!

library(copykat) library(Seurat) Attaching SeuratObject library(SeuratObject) library(SeuratDisk) Registered S3 method overwritten by 'SeuratDisk': method from
as.sparse.H5Group Seurat Convert("/Volumes/beronja_s/beronjaLab/Claire/Sequencing/Pt10_filtered/Pt10_GEX_filtered1.h5ad", dest = "h5seurat", overwrite = TRUE) Warning: Unknown file type: h5ad Warning: 'assay' not set, setting to 'RNA' Creating h5Seurat file for version 3.1.5.9900 Adding X as data Adding raw/X as counts Adding meta.features from raw/var Adding DM_EigenVectors as cell embeddings for DM_EigenVectors Adding MAGIC_imputed_data as cell embeddings for MAGIC_imputed_data Adding X_pca as cell embeddings for pca Adding X_umap as cell embeddings for umap Adding PCs as feature loadings fpr pca Adding miscellaneous information for pca Adding standard deviations for pca Adding miscellaneous information for umap Adding DMEigenValues to miscellaneous data Adding clusters_colors to miscellaneous data Adding dendrogram_leiden to miscellaneous data Adding hvg to miscellaneous data Adding leiden to miscellaneous data Adding leiden_colors to miscellaneous data Adding rank_genes_groups to miscellaneous data Adding scrublet to miscellaneous data pt10 <- LoadH5Seurat("/Volumes/beronja_s/beronjaLab/Claire/Sequencing/Pt10_filtered/Pt10_GEX_filtered1.h5seurat", assays="RNA") Validating h5Seurat file Initializing RNA with data Adding counts for RNA Adding feature-level metadata for RNA Adding reduction DM_EigenVectors Adding cell embeddings for DM_EigenVectors Warning: Keys should be one or more alphanumeric characters followed by an underscore, setting key from DMEigenVectors to DMEigenVectors Warning: All keys should be one or more alphanumeric characters followed by an underscore '', setting key to DMEigenVectors_ Adding miscellaneous information for DM_EigenVectors Adding reduction MAGIC_imputed_data Adding cell embeddings for MAGIC_imputed_data Warning: Keys should be one or more alphanumeric characters followed by an underscore, setting key from MAGIC_imputeddata to MAGICimputeddata Warning: All keys should be one or more alphanumeric characters followed by an underscore '', setting key to MAGICimputeddata_ Adding miscellaneous information for MAGIC_imputed_data Adding reduction pca Adding cell embeddings for pca Adding feature loadings for pca Adding miscellaneous information for pca Adding reduction umap Adding cell embeddings for umap Adding miscellaneous information for umap Adding command information Adding cell-level metadata pt10 An object of class Seurat 18176 features across 10427 samples within 1 assay Active assay: RNA (18176 features, 0 variable features) 4 dimensional reductions calculated: DM_EigenVectors, MAGIC_imputed_data, pca, umap exp.pt10data <- as.matrix(pt10@assays$RNA@counts) write.table(exp.pt10data, file="exp.pt10data.txt", sep="\t", quote = FALSE, row.names = TRUE) copykat.test <- copykat(rawmat=exp.pt10data, id.type="S", ngene.chr=5, win.size=25, KS.cut=0.1, sam.name="test", distance="euclidean", norm.cell.names="",output.seg="FLASE", plot.genes="TRUE", genome="hg20",n.cores=1) [1] "running copykat v1.0.8 updated 02/25/2022 introduced mm10 module, fixed typos" [1] "step1: read and filter data ..." [1] "18176 genes, 10427 cells in raw data" [1] "9245 genes past LOW.DR filtering" [1] "step 2: annotations gene coordinates ..." [1] "start annotation ..." Error in copykat(rawmat = exp.pt10data, id.type = "S", ngene.chr = 5, : all cells are filtered copykat.test <- copykat(rawmat=exp.pt10data, id.type="S", cell.line = "no", ngene.chr=5, win.size=25, KS.cut=0.5, sam.name="test", distance="euclidean", norm.cell.names="",output.seg="FALSE", plot.genes="TRUE", genome="hg20",n.cores=1) [1] "running copykat v1.0.8 updated 02/25/2022 introduced mm10 module, fixed typos" [1] "step1: read and filter data ..." [1] "18176 genes, 10427 cells in raw data" [1] "9245 genes past LOW.DR filtering" [1] "step 2: annotations gene coordinates ..." [1] "start annotation ..." Error in copykat(rawmat = exp.pt10data, id.type = "S", cell.line = "no", : all cells are filtered copykat.test <- copykat(rawmat=exp.pt10data, id.type="S", cell.line = "no", ngene.chr=1, win.size=25, KS.cut=0.1, sam.name="test", distance="euclidean", norm.cell.names="",output.seg="FALSE", plot.genes="TRUE", genome="hg20",n.cores=1) [1] "running copykat v1.0.8 updated 02/25/2022 introduced mm10 module, fixed typos" [1] "step1: read and filter data ..." [1] "18176 genes, 10427 cells in raw data" [1] "9245 genes past LOW.DR filtering" [1] "step 2: annotations gene coordinates ..." [1] "start annotation ..." Error in copykat(rawmat = exp.pt10data, id.type = "S", cell.line = "no", : all cells are filtered copykat.test <- copykat(rawmat=exp.pt10data, id.type="S", LOW.DR = 0.01, cell.line = "no", ngene.chr=5, win.size=25, KS.cut=0.1, sam.name="test", distance="euclidean", norm.cell.names="",output.seg="FALSE", plot.genes="TRUE", genome="hg20",n.cores=1) [1] "running copykat v1.0.8 updated 02/25/2022 introduced mm10 module, fixed typos" [1] "step1: read and filter data ..." [1] "18176 genes, 10427 cells in raw data" [1] "15406 genes past LOW.DR filtering" [1] "step 2: annotations gene coordinates ..." [1] "start annotation ..." Error in copykat(rawmat = exp.pt10data, id.type = "S", LOW.DR = 0.01, : all cells are filtered

gaobio commented 1 year ago

@cmills2 @UboCA Please double-check if you selected correct version of genome, human or mouse. All your cells were filtered out due to none gene names matched.