Question: cydar: negative values for cell assignment indices
0
2.4 years ago by
Johns Hopkins University
Lukas Weber0 wrote:

Hi,

I have been trying out the 'cydar' package for testing for differential abundance in mass cytometry data, which was published a few months ago (Lun et al., 2017, Nature Methods).

In order to evaluate the performance of the algorithm, I have been looking at results at both the 'hypersphere' level and the individual cell level. To get the results at the cell level, I have been using the accessor function 'cellAssignments()' on the 'CyData' objects, which returns a list of integer vectors containing the cell IDs/indices of the cells contained within each hypersphere. This allows the individual cells to be matched up with the hypersphere-level q-values.

However, I noticed that some of the values in these 'cellAssignments' integer vectors are actually negative, which doesn't seem to make sense if they are cell IDs. Do you have any further information about what these negative values mean? Or is there a problem with the 'cellAssignments' vectors?

Below is a short example to demonstrate the issue. The example is using the data from the example in the Bioconductor vignette, and simply follows on directly from the section titled "Counting cells into hyperspheres" in the vignette. If I am interpreting it correctly, this seems to show that the 5th hypersphere contains 77 cells, but 23 of these have negative values for their cell IDs.

# example to demonstrate negative values for cell assignment indices
assignments <- cellAssignments(cd)[[5]]
length(assignments)
# [1] 77
# [1]    38    64   766  1327  5145 -5146  5148 -5149  5152 -5153
sum(assignments < 0)
# [1] 23


Lukas

cydar • 341 views
modified 2.4 years ago • written 2.4 years ago by Lukas Weber0
Answer: cydar: negative values for cell assignment indices
1
2.4 years ago by
Aaron Lun25k
Cambridge, United Kingdom
Aaron Lun25k wrote:

This was meant to provide some compression, where a negative value indicates that it's a continuous stretch from the last non-negative value. In short, you can read the above example like:

38, 64, 766, 1327, 5145:5146, 5148:5149, 5152:5153

... which clearly doesn't make any difference here, but it can sometimes help if you have very long stretches of cells in the same hypersphere. In practice, it tends to cut the size down by about 20%; not a lot, but better than nothing given that these indices don't get used much. Anyway, If you want the indices themselves for actual use, you can use the unpackIndices function, which will... unpack the indices.

Answer: cydar: negative values for cell assignment indices
0
2.4 years ago by
Johns Hopkins University
Lukas Weber0 wrote:

Great, thank you for the quick reply! Using the 'unpackIndices()' function has now worked correctly.