dkzhang777 / SlideCNA

5 stars 2 forks source link

Error in dplyr::select(counts_re, tidyselect::all_of(so_clone@meta.data[so_clone@meta.data$clone == : #2

Open kzb193 opened 1 year ago

kzb193 commented 1 year ago

Hello,

I have tried to use SlideCNA on a slide-seqV2 dataset, and I have got this error. I have also included some additional details of each of the inputs. Can you please help?

run_slide_cna(so=ge.x, md=md, gene_pos=gene_pos, plotDir=dir.p, OUPUT_DIRECTORY=dir.o) Calculating cluster 2 Calculating cluster 1 Calculating cluster 3 Error in dplyr::select(counts_re, tidyselect::all_of(so_clone@meta.data[so_clone@meta.data$clone == : Selections can't have missing values. In addition: Warning messages: 1: In [.data.table(new_md, , :=(N_bin, .N), by = bin_all) : Invalid .internal.selfref detected and fixed by taking a (shallow) copy of the data.table so that := can add this new column by reference. At an earlier point, this data.table has been copied by R (or was created manually using structure() or similar). Avoid names<- and attr<- which in R currently (and oddly) may copy the whole data.table. Use set syntax instead to avoid copying: ?set, ?setnames and ?setattr. If this message doesn't help, please report your use case to the data.table issue tracker so the root cause can be fixed or this message improved. 2: In [.data.table(new_md, , :=(N_bin, .N), by = bin_all) : Invalid .internal.selfref detected and fixed by taking a (shallow) copy of the data.table so that := can add this new column by reference. At an earlier point, this data.table has been copied by R (or was created manually using structure() or similar). Avoid names<- and attr<- which in R currently (and oddly) may copy the whole data.table. Use set syntax instead to avoid copying: ?set, ?setnames and ?setattr. If this message doesn't help, please report your use case to the data.table issue tracker so the root cause can be fixed or this message improved. Error in cluster_markers_obj$markers_clone : $ operator is invalid for atomic vectors Calculating cluster 1 Calculating cluster 2 Error in handle_url(handle, url, ...) : Must specify at least one of url or handle

Additional details

class(ge.x) [1] "Seurat" attr(,"package") [1] "SeuratObject" str(ge.x) Formal class 'Seurat' [package "SeuratObject"] with 13 slots ..@ assays :List of 1 .. ..$ RNA:Formal class 'Assay' [package "SeuratObject"] with 8 slots .. .. .. ..@ counts :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots .. .. .. .. .. ..@ i : int [1:7526410] 0 1 7 17 22 25 26 29 31 32 ... .. .. .. .. .. ..@ p : int [1:18289] 0 3202 6214 9304 12158 14841 17693 20457 22974 25799 ... .. .. .. .. .. ..@ Dim : int [1:2] 6769 18288 .. .. .. .. .. ..@ Dimnames:List of 2 .. .. .. .. .. .. ..$ : chr [1:6769] "NOC2L" "ISG15" "C1orf159" "SDF4" ... .. .. .. .. .. .. ..$ : chr [1:18288] "CTCTTCGGCGTAGG" "AGCCCGCGCTGGTT" "CGCGGGAATAATTT" "CCACCAACTTGCTC" ... .. .. .. .. .. ..@ x : num [1:7526410] 2 1 2 1 1 10 6 1 4 1 ... .. .. .. .. .. ..@ factors : list() .. .. .. ..@ data :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots .. .. .. .. .. ..@ i : int [1:7526410] 0 1 7 17 22 25 26 29 31 32 ... .. .. .. .. .. ..@ p : int [1:18289] 0 3202 6214 9304 12158 14841 17693 20457 22974 25799 ... .. .. .. .. .. ..@ Dim : int [1:2] 6769 18288 .. .. .. .. .. ..@ Dimnames:List of 2 .. .. .. .. .. .. ..$ : chr [1:6769] "NOC2L" "ISG15" "C1orf159" "SDF4" ... .. .. .. .. .. .. ..$ : chr [1:18288] "CTCTTCGGCGTAGG" "AGCCCGCGCTGGTT" "CGCGGGAATAATTT" "CCACCAACTTGCTC" ... .. .. .. .. .. ..@ x : num [1:7526410] 2 1 2 1 1 10 6 1 4 1 ... .. .. .. .. .. ..@ factors : list() .. .. .. ..@ scale.data : num[0 , 0 ] .. .. .. ..@ key : chr "rna_" .. .. .. ..@ assay.orig : NULL .. .. .. ..@ var.features : logi(0) .. .. .. ..@ meta.features:'data.frame': 6769 obs. of 0 variables .. .. .. ..@ misc : list() ..@ meta.data :'data.frame': 18288 obs. of 8 variables: .. ..$ orig.ident : Factor w/ 1 level "colon_slideseqv2": 1 1 1 1 1 1 1 1 1 1 ... .. ..$ nCount_RNA : num [1:18288] 7402 7855 6797 6966 5531 ... .. ..$ nFeature_RNA : int [1:18288] 3202 3012 3090 2854 2683 2852 2764 2517 2825 2579 ... .. ..$ bc : chr [1:18288] "CTCTTCGGCGTAGG" "AGCCCGCGCTGGTT" "CGCGGGAATAATTT" "CCACCAACTTGCTC" ... .. ..$ seurat_clusters: Factor w/ 10 levels "0","1","2","3",..: 9 9 9 9 9 9 9 9 9 9 ... .. ..$ pos_x : num [1:18288] 2364 3485 2280 3062 2274 ... .. ..$ pos_y : num [1:18288] 3072 1734 2952 1556 2983 ... .. ..$ cluster_type : chr [1:18288] "Malignant" "Malignant" "Malignant" "Malignant" ... ..@ active.assay: chr "RNA" ..@ active.ident: Factor w/ 1 level "colon_slideseqv2": 1 1 1 1 1 1 1 1 1 1 ... .. ..- attr(*, "names")= chr [1:18288] "CTCTTCGGCGTAGG" "AGCCCGCGCTGGTT" "CGCGGGAATAATTT" "CCACCAACTTGCTC" ... ..@ graphs : list() ..@ neighbors : list() ..@ reductions : list() ..@ images : list() ..@ project.name: chr "colon_slideseqv2" ..@ misc : list() ..@ version :Classes 'package_version', 'numeric_version' hidden list of 1 .. ..$ : int [1:3] 4 1 0 ..@ commands : list() ..@ tools : list()

dim(md) [1] 18288 6 class(md) [1] "data.table" "data.frame" head(md) bc seurat_clusters pos_x pos_y cluster_type nCount_RNA 1: CTCTTCGGCGTAGG 8 2364.115 3072.225 Malignant 7402 2: AGCCCGCGCTGGTT 8 3484.520 1734.005 Malignant 7855 3: CGCGGGAATAATTT 8 2279.745 2951.975 Malignant 6797 4: CCACCAACTTGCTC 8 3061.825 1556.490 Malignant 6966 5: AGCCCTAGCATAGG 8 2274.220 2982.525 Malignant 5531 6: CCCGACACGCGACC 8 2986.945 1603.680 Malignant 6497 table(md$cluster_type)

Malignant Normal 12736 5552

class(gene_pos) [1] "data.table" "data.frame" dim(gene_pos) [1] 6769 5 head(gene_pos) GENE chr start end rel_gene_pos 1: NOC2L chr1 879584 894689 1 2: ISG15 chr1 948803 949920 2 3: C1orf159 chr1 1017198 1051741 3 4: SDF4 chr1 1152288 1167411 4 5: UBE2J2 chr1 1189289 1209265 5 6: DVL1 chr1 1270656 1284730 6 table(rownames(ge.x@assays$RNA)==gene_pos$GENE)

TRUE 6769

dkzhang777 commented 1 month ago

Hi, we have recently released new fixes to the SlideCNA code and have developed vignettes for implementation on Slide-seq and snRNA-seq data (https://github.com/dkzhang777/SlideCNA_Analysis). I would suggest re-running the dataset with these updates and if there is still an error, feel free to write here again. Thanks!

kzb193 commented 3 weeks ago

Thank you for update on this issue. Will try re-running.