Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design matrix and nhood counts are not the same dimension #317

Open
nbutyrate opened this issue Apr 5, 2024 · 1 comment
Open

Design matrix and nhood counts are not the same dimension #317

nbutyrate opened this issue Apr 5, 2024 · 1 comment

Comments

@nbutyrate
Copy link

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

@MikeDMorgan
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants