-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error when fitting the compass model #81
Comments
Myself and three other people are all getting the same error now when running the
|
Can you share data / code so that I might reproduce the error? |
@gfinak yes, we have a tutorial repo that uses COMPASS. You just need:
Here is a more complete error message with context:
I've also heard from a colleague (edit: @quinnpeters) that they don't get the error with a much older version of R (v3.6.3). |
Hi @emjbishop I got your separate private message to me about this issue. Here's some runtime output showing how > CC <- COMPASSContainerFromGatingSet(gs,
+ node = parent_node,
+ individual_id = id,
+ mp = markermap,
+ countFilterThreshold = 5000)
Extracting cell counts
Fetching 4+
Fetching child nodes
common markers are:
Time FSC-A FSC-H SSC-A CD8b TNFa CD107a CD154 CD3 IL2 CD4 IL17a IL4_5_13 CD14_19 CCR7 CD38 LD IFNg CD45RA HLADR
Extracting single cell data for 4+/IL2|4+/IL4513|4+/IFNG|4+/TNF|4+/IL17|4+/154|4+/107a
..............................Creating COMPASS Container
Filtering low counts
Filtering 0 samples due to low counts
Warning message:
In COMPASSContainer(data = sc_data, counts = counts, meta = pd, :
There appear to be negative intensities in the 'data' supplied.
> CC2 <- COMPASSContainerFromGatingSet(gs,
+ node = parent_node,
+ individual_id = id,
+ mp = markermap,
+ countFilterThreshold = 5000)
Extracting cell counts
Fetching 4+
Fetching child nodes
common markers are:
Time FSC-A FSC-H SSC-A CD8b TNFa CD107a CD154 CD3 IL2 CD4 IL17a IL4_5_13 CD14_19 CCR7 CD38 LD IFNg CD45RA HLADR
Extracting single cell data for 4+/IL2|4+/IL4513|4+/IFNG|4+/TNF|4+/IL17|4+/154|4+/107a
..............................Creating COMPASS Container
Filtering low counts
Filtering 0 samples due to low counts
Warning message:
In COMPASSContainer(data = sc_data, counts = counts, meta = pd, :
There appear to be negative intensities in the 'data' supplied.
> CC$data$`114716.fcs_445737`[100,]
IL2 IL4_5_13 IFNg TNFa IL17a CD154 CD107a
1.018558e-312 2.781342e-309 8.257046e-317 1.746838e+03 2.483463e-265 1.807873e-308 1.157082e-309
> CC2$data$`114716.fcs_445737`[100,]
IL2 IL4_5_13 IFNg TNFa IL17a CD154 CD107a
1.820499e-318 1.823898e-318 1.827297e-318 1.746838e+03 1.834095e-318 1.837494e-318 1.840894e-318
> dmso_spike_1_sn <- CC2$meta %>% dplyr::filter(STIM %in% c("DMSO", "Spike 1")) %>% dplyr::pull(name)
> table(unlist((lapply(CC$data[dmso_spike_1_sn], function(x) {any(is.na(x))}))))
FALSE TRUE
9 1
> table(unlist((lapply(CC2$data[dmso_spike_1_sn], function(x) {any(is.na(x))}))))
FALSE
10
> fit <- COMPASS(CC,
+ treatment = STIM == "Spike 1",
+ control = STIM == "DMSO",
+ iterations = 100)
There are a total of 5 samples from 5 individuals in the 'treatment' group.
There are a total of 5 samples from 5 individuals in the 'control' group.
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 2, 7
> any(is.na(CC$data$`114716.fcs_445737`))
[1] TRUE
> any(is.na(CC2$data$`114716.fcs_445737`))
[1] FALSE
> fit2 <- COMPASS(CC2,
+ treatment = STIM == "Spike 1",
+ control = STIM == "DMSO",
+ iterations = 100)
There are a total of 5 samples from 5 individuals in the 'treatment' group.
There are a total of 5 samples from 5 individuals in the 'control' group.
The model will be run on 5 paired samples.
The category filter has removed 123 of 125 categories.
There are a total of 2 categories to be tested.
Initializing parameters...
Computing initial parameter estimates...
Keeping 100 iterations. We'll thin every 8 iterations.
Burnin for 100 iterations...
Sampling 800 iterations...
Done!
Computing the posterior difference in proportions, posterior log ratio...
Done!
> fit2
A COMPASS model fit on 5 paired samples.
Haven't gotten to the root of the problem but documenting the investigation so far. |
I suggest looking at the SimpleCOMPASS interface. CompassContainerFromGatingSet makes a lot of assumptions and we ended up abandoning it internally. |
Hello again, we appreciate the suggestion to use SimpleCOMPASS and indeed it works well. However, when we have dozens of subject samples with multiple stims and cell types it's not practical to generate the boolean combinations in FlowJo for each subject. Do you have a way to automatically generate the boolean combinations, or a method in FlowJo? |
Indeed, we would typically export the flowJo wsp file, read it in with flowWorskpace, then there are some internal functions that could generate the boolean counts from the marginal gated data at the single cell level. The doc for SimpleCompass highlights the functions used: Lines 47 to 48 in 38dc986
|
Thanks, this is really helpful. However, I'm not getting the same poly/functionality scores or heatmap as with regular COMPASS. You can see the scores and heatmaps at the bottom of these READMEs: Any thoughts? Perhaps I can tweak the boolean combinations somehow? P.S. When I make the heatmap with SimpleCOMPASS I get the console message that |
First I'd suggest checking that that data are indeed the same (the input matrices). |
Thanks for the suggestions. I tried using 20,000 iterations and the same seed but I'm still getting a different result. I do believe that my filtered categories have <5 cells, however I wouldn't expect that to matter since I'm assuming that COMPASS and SimpleCOMPASS use the same filter and I think the input data is the same. Regarding input data, they both started with the same
If this all looks good then perhaps we'd need a vignette for going from GatingSet to SimpleCOMPASS, since I'm not sure where this is going wrong. |
The problem is here:
The threshold is intended to be placed at the location of the functional gate, not literally negative, but negative for the marker, which would typically be some positive MFI value. I assume you've gated your data. Best |
When I try to fit the COMPASS Model with a large compass container, I get the following error which I cannot figure out how to solve:
fit <- COMPASS(CC_comb,
treatment = Stim == "SPIKE",
control = Stim == "DMSO",
iterations = 40000)
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 2, 7
As far as I can tell, there is no issue with the metadata or counts. The data structure of the compass container, however, must be causing some issue?
The text was updated successfully, but these errors were encountered: