Separate cellNames based on biological variable during the creation of metacell aggregates #1199
RegnerM2015
started this conversation in
General
Replies: 1 comment 3 replies
-
I cant comment on the exact code changes but the concept seems fine. Though I feel like you could accomplish this just by doing a project subset first. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @rcorces and @jgranja24
I am working with a scATAC-seq dataset that includes both healthy and diseased tissue samples.
When performing peak-to-gene linkage and co-accessibility analyses, the single cell observations are aggregated into metacells via kNN to create more informative observations for computing correlations.
In this case, I think it is important for cells that make up a metacell aggregate to be all from the same biological condition/group. In other words, healthy cells should form healthy aggregates and disease cells should form disease aggregates. Creating metacells that include both healthy and disease cells could obscure the downstream results.
To ensure that the aggregate metacells contain only cells from one biological condition or group, I made some slight changes to the source code of
addCoAccessibility
andaddPeak2GeneLinks
.I modified
addCoAccessibility
toaddCoAccessibility.mod
by adding two additional parameters,group1
andgroup2
which are character vectors of cellNames (barcodes). In this case,group1
is a vector of disease cellNames andgroup2
is a vector of healthy cellNames. After thecellsToUse
parameter is checked, I first subset the reducedDims to only the cells ofgroup1
. Using thesegroup1
cells, I proceed as normally by performing the subsampling for anidx
, running the kNN, determining the overlaps in cells between metacell aggregates, and converting the knnObject toknnObj.group1
. I then repeat these steps after subsetting the reducedDims to only the cells ofgroup2
resulting in the knnObjectknnObj.group2
. Finally, I concatenate these knnObj lists into one list that is used for construction of the metacell aggregate matrices.I implemented the same changes described above and modified
addPeak2GeneLinks
toaddPeak2GeneLinks.mod
:Are these changes reasonable and accurate? Both modified functions successfully run to completation on my end. I would really appreciate your help and advice on this matter.
Beta Was this translation helpful? Give feedback.
All reactions