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

the results of fit_marginal are all null #61

Open
Santanevrgivup opened this issue Sep 27, 2024 · 6 comments
Open

the results of fit_marginal are all null #61

Santanevrgivup opened this issue Sep 27, 2024 · 6 comments

Comments

@Santanevrgivup
Copy link

my code:
data <- construct_data(
sce = sce,
assay_use = "counts",
celltype = "cell_type",
pseudotime = NULL,
spatial = c("spatial1", "spatial2"),
other_covariates = NULL,
corr_by = "1"
)
marginal <- fit_marginal(
data = data,
predictor = "gene",
mu_formula = "s(spatial1, spatial2, bs = 'gp', k= 50)",
sigma_formula = "1",
family_use = "nb",
n_cores = 10,
usebam = FALSE
)
origin data is from tech DBiT-seq, and with dim(1988*1662) after preprocessed.

here is the output of fit_marginal function
微信图片_20240927213345
so in the next step(fit_copula) also report errors like this :
Error in colnames<-(*tmp*, value = rownames(sce)) :
attempt to set 'colnames' on an object with less than two dimensions
Calls: fit_copula -> convert_n -> colnames<-
In addition: Warning message:
In mclapply(seq_len(n), do_one, mc.preschedule = mc.preschedule, :
all scheduled cores encountered errors in user code
Execution halted
I would greatly appreciate your help!

@SONGDONGYUAN1994
Copy link
Owner

Hi,
The result means that the fit_marginal fails for all the genes. This is usually caused by some errors in the input data (output of construct_data). Could you set all n_cores = 1 and check the error message?

Best,
Dongyuan

@Santanevrgivup
Copy link
Author

Dear Dongyuan,
Following your suggestion, I set all n.cores values to 1 and checked the output of the construct_data function. I couldn't find any anomalies. So the output of fit_marginal still results in all empty values, and this process didn't produce any error messages. Could you please provide me with some further guidance? I greatly appreciate your help.
image
image

@SONGDONGYUAN1994
Copy link
Owner

This is weird. Could you share your sce data with me? You can mask the gene names if you are worried about data leaking. I can check it.

Best,
Dongyuan

@Santanevrgivup
Copy link
Author

Of course, it would be my pleasure!This data is public, so there are no concerns about data leakage. Please feel free to proceed without any worries.This compressed file contains three files: 'input_sce' is the sce_obj that has been preprocessed and is ready to be input into construct_data, 'code.R' contains part of the relevant code, and 'GSM418~' is the raw data.
Thank you again!
Santa
Check.zip

@SONGDONGYUAN1994
Copy link
Owner

@Santanevrgivup
Hi Santa,

I found the problem. Please convert your spatial locations (spatial1, spatial2) from chr to numeric. Now they are characheters so that the model cannot fit.

Best,
Dongyuan

@Santanevrgivup
Copy link
Author

Hi Dongyuan,

The problem has been solved by following your suggestion! Thank you once again for your patient guidance. Sincerely wish you good health and lasting academic vigor!

Santa

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