Closed nbutyrate closed 1 day ago
Hi I am trying to run MiloR on my data and getting the following error, please help,
here is my workflow sc1 <- as.SingleCellExperiment(Polyp, assay = "RNA")
sc1_milo <- Milo(sc1)
sc1_milo <- buildGraph(sc1_milo, k = 30, d = 30, reduced.dim = "STANDARDPCA")
sc1_milo <- makeNhoods(sc1_milo, prop = 0.1, k = 30, d=30, refined = TRUE, reduced_dims = "STANDARDPCA")
plotNhoodSizeHist(sc1_milo)
sc1_milo <- countCells(sc1_milo, meta.data = as.data.frame(colData(sc1_milo)), sample="SampleNameOnly")
sc1_design <- data.frame(colData(sc1_milo))[,c("SampleNameOnly", "Race1")]
sc1_milo <- calcNhoodDistance(sc1_milo, d=30, reduced.dim = "STANDARDPCA")
da_results <- testNhoods(sc1_milo, design = ~Race1, design.df = sc1_design, reduced.dim = "STANDARDPCA") Error in testNhoods(sc1_milo, design = ~Race1, design.df = sc1_design, : Design matrix (106571) and nhood counts (42) are not the same dimension
The design.df data frame needs to be a sample X meta data table, you are giving it a single-cell X meta data table, hence the discordant dimensions.
design.df
Hi I am trying to run MiloR on my data and getting the following error, please help,
here is my workflow sc1 <- as.SingleCellExperiment(Polyp, assay = "RNA")
sc1_milo <- Milo(sc1)
sc1_milo <- buildGraph(sc1_milo, k = 30, d = 30, reduced.dim = "STANDARDPCA")
sc1_milo <- makeNhoods(sc1_milo, prop = 0.1, k = 30, d=30, refined = TRUE, reduced_dims = "STANDARDPCA")
plotNhoodSizeHist(sc1_milo)
sc1_milo <- countCells(sc1_milo, meta.data = as.data.frame(colData(sc1_milo)), sample="SampleNameOnly")
sc1_design <- data.frame(colData(sc1_milo))[,c("SampleNameOnly", "Race1")]
sc1_milo <- calcNhoodDistance(sc1_milo, d=30, reduced.dim = "STANDARDPCA")
da_results <- testNhoods(sc1_milo, design = ~Race1, design.df = sc1_design, reduced.dim = "STANDARDPCA") Error in testNhoods(sc1_milo, design = ~Race1, design.df = sc1_design, : Design matrix (106571) and nhood counts (42) are not the same dimension