lanagarmire / Asgard

Other
39 stars 18 forks source link

Error from "DrugCombination" function : The following error occurred in $<-.data.frame(*tmp*, "FDR", value = numeric(0)): replacement has 0 rows, data has 15 #16

Open HyeokAn opened 3 weeks ago

HyeokAn commented 3 weeks ago

The following error occurred in $<-.data.frame(tmp, "FDR", value = numeric(0)): replacement has 0 rows, data has 15

Here's the data that I used for Asgard %%R colnames(sc@meta.data) [1] "nFeaturess_RNA_by_counts" "log1p_nFeaturess_RNA_by_counts" [3] "total_counts" "log1p_total_counts"
[5] "pct_counts_in_top_20_genes" "total_counts_mt"
[7] "log1p_total_counts_mt" "pct_counts_mt"
[9] "total_counts_ribo" "log1p_total_counts_ribo"
[11] "pct_counts_ribo" "total_counts_hb"
[13] "log1p_total_counts_hb" "pct_counts_hb"
[15] "outlier" "mt_outlier"
[17] "scDblFinder_score" "scDblFinder_class"
[19] "orig_ident" "orig.ident"
[21] "bulk_ident" "bulk_ident2"
[23] "bulk_ident3" "bulk_ident4"
[25] "batch" "nFeaturess_RNA"
[27] "S_score" "G2M_score"
[29] "phase" "leiden_scVI_0.2"
[31] "leiden_scVI_0.3" "leiden_scVI_0.4"
[33] "leiden_scVI_0.45" "leiden_scVI_0.5"
[35] "leiden_scVI_0.5.5" "leiden_scVI_0.6"
[37] "leiden_scVI_0.7" "leiden_scVI_0.8"
[39] "leiden_scVI_0.9" "leiden_scVI_1.0"
[41] "leiden_scVI_1.5" "nhood_ixs_random"
[43] "nhood_ixs_refined" "nhood_kth_distance"
[45] "label" "scCODA_sample_id"
[47] "sub_cluster" "label2"
[49] "celltype" "type"
[51] "sample"

And the code that I used is below

%%R
Drug.combinations<-DrugCombination(SC.integrated=sc,
                      Gene.data=Gene.list,
                      Drug.data=Drug.ident.res,
                      Drug.FDR=0.1,
                      FDA.drug.only=TRUE,
                      Combined.drugs=2,
                      Case=Case,
                      Tissue="skin",
                      GSE92742.gctx=GSE92742.gctx.path,
                      GSE70138.gctx=GSE70138.gctx.path)

I could some what figure out that this error comes from source code Combination.table$FDR <- [p.adjust](https://rdrr.io/r/stats/p.adjust.html)(pvalues, method = "BH") I've succeeded to select mono-drug therapies correctly. But I have no idea how to fix this error.