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

Continuous variable as main effect #133

Closed
jonathan-columbiau opened this issue May 17, 2024 · 4 comments · May be fixed by #134
Closed

Continuous variable as main effect #133

jonathan-columbiau opened this issue May 17, 2024 · 4 comments · May be fixed by #134

Comments

@jonathan-columbiau
Copy link

Hi, thanks for creating Sccomp! It's a great tool.

I'm trying to use a continuous-valued variable as a main effect in sccomp, and when I try it I get an error. Is sccomp able to be used with continuous variables as the main effect?

Here's a reprex:

library(sccomp)
data(counts_obj)
#add sample continuous variable as main effect
counts_obj$contin_var = runif(nrow(counts_obj))
sccomp_result = 
  counts_obj |>
  sccomp_estimate( 
    formula_composition = ~ contin_var, 
    .sample = sample,
    .cell_group = cell_group,
    .count = count, 
    bimodal_mean_variability_association = TRUE,
    cores = 1, verbose = FALSE
  ) |> 
  sccomp_remove_outliers(cores = 1, verbose = FALSE) |> # Optional
  sccomp_test()

The actual error I get is:
Warning: non-unique values when setting 'row.names': ‘10x_6K’, ‘10x_8K’, ‘GSE115189’, ‘SCP345_580’, ‘SCP345_860’, ‘SCP424_pbmc1’, ‘SCP424_pbmc2’, ‘SCP591’, ‘SI-GA-E5’, ‘SI-GA-E7’, ‘SI-GA-E8’, ‘SI-GA-G6’, ‘SI-GA-G7’, ‘SI-GA-G8’, ‘SI-GA-G9’, ‘SI-GA-H1’, ‘SI-GA-H3’, ‘SI-GA-H4’, ‘SRR11038995’, ‘SRR7244582’
Error in .rowNamesDF<-(x, value = value) :
duplicate 'row.names' are not allowed

@stemangiola
Copy link
Collaborator

Hello, can you attach your input dataset (can also be a dummy example that causes the error, or an anonimised dataset of yours).

@jonathan-columbiau
Copy link
Author

Yes here's an example dataset
ex_dataset.csv

@stemangiola stemangiola linked a pull request May 17, 2024 that will close this issue
@stemangiola
Copy link
Collaborator

I have created a PR above

See if this error message is self explanatory

sccomp says: your "contin_var" factor(s) is(are) mismatched across samples. For example, sample_bar having more than one value for factor_foo. For sample_ar you should have one value for factor_foo. consistent across groups (e.g. cell types).

@jonathan-columbiau
Copy link
Author

Yes that's great, thanks

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

Successfully merging a pull request may close this issue.

2 participants