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

NA in the coefficient #61

Open
Huimin721 opened this issue Mar 5, 2025 · 1 comment
Open

NA in the coefficient #61

Huimin721 opened this issue Mar 5, 2025 · 1 comment
Assignees

Comments

@Huimin721
Copy link

Dear team,

Thanks for developing the package. I was running the function on a diabetes dataset:

data = data.frame(Group = Group,ID = ID,imageID = imageID,x=x,y=y,cellType=cellType)

res = spicyR::spicy(
    cells=data,
    condition = 'Group',
    subject = 'ID',
    cores = 80)

This is how the dataset look like:

str(data)
'data.frame': 1292937 obs. of 6 variables:
$ Group : chr "Onset" "Onset" "Onset" "Onset" ...
$ ID : chr "6362" "6362" "6362" "6362" ...
$ imageID : chr "A01" "A01" "A01" "A01" ...
$ x : num 52.5 128 135.3 449.5 458.4 ...
$ y : num 0.667 0.895 0.429 1.158 1.1 ...
$ cellType: chr "acinar" "acinar" "acinar" "acinar" ...

The function will run but get a one column coefficient full of NA, and my package version is 1.19.
Could I ask why this happens? Should I set the characters to be factors?
Thanks so much!

@shreyarajeshrao shreyarajeshrao self-assigned this Mar 5, 2025
@shreyarajeshrao
Copy link
Contributor

Hi @Huimin721,

Thanks for bringing up the issue! It looks like celltype being a character might be causing problems with the model fit, so converting it to a factor might fix the issue. If you have very few cells per image, spicyR might have difficulty generating a window, so you could try window = "square" instead of the default window = "convex". If neither of these work, could you share a subset of your data with us so we can find the issue?

Thank you!
Shreya

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