cydar: negative values for cell assignment indices
2
0
Entering edit mode
@lukas-weber-10656
Last seen 7 months ago
Boston University

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
head(assignments, 10)
# [1]    38    64   766  1327  5145 -5146  5148 -5149  5152 -5153
sum(assignments < 0)
# [1] 23

 

Thank you for your help,

Lukas

cydar • 953 views
ADD COMMENT
1
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 10 hours ago
The city by the bay

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.

ADD COMMENT
0
Entering edit mode
@lukas-weber-10656
Last seen 7 months ago
Boston University

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

ADD COMMENT

Login before adding your answer.

Traffic: 466 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6