buenrostrolab / stimATAC_analyses_code

All code associated with manuscript detailing scATAC and scRNA-seq following stimulus of PBMCs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Making a DORC SE

waltno opened this issue · comments

Hi!

Thank you so much for generating such powerful code! I am looking to run FigR but I am getting stuck at the dorcMat part.

DORC.SE <- readRDS("./data/SE/ATAC_stim_DORC_prom_enhancer_scores.rds")

I am wondering how you constructed the DORC prom enhancer RDS? I assume you use the super enhancer data from Hnisz, 2013... just not sure how

Just saw that you are close to making this an R package! Looking forward to that!

Hi @waltno ! Sorry for omitting this in the analysis code, I've now included a function that was used to compute the single cell DORC accessibility scores.

The one that was read in that line of code you mentioned above is actually the same scores, but just split based on whether the peaks that we found to associate with genes overlap promoters vs distal enhancers, which is why I sum them together and use them as a single matrix for downstream correlations (since they're mutually exclusive).

You can get this same combined DORC accessibility matrix using the getDORCScores function (now found within DORC_functions.R). The function takes the exact same SummarizedExperiment peaks x cells input that is used in the runGenePeakcorr function, and all it's doing is also taking the returned list of peak-gene associations (you filter for pvalZ in the returned data.frame first using a cut-off, like 0.05), and a list of "DORC" genes, or genes with a relatively higher number of significant peak-gene associations (returned by the dorcJplot function), and takes the sum of the normalized ATAC signal for those peaks, for each gene, and in each cell. The result is a sparseMatrix of DORC genes x cells, which you can then smooth and visualize (tSNE/UMAP etc.).

Yes, we're very close to releasing the code with command instructions and tutorial walk-throughs, and I'll link to it in this git once that's public! Hoping it'll be easier to use the code base once that's there to use!

Hope this helps!

Awesome! Thank you so much. I had some matrix package issues to troubleshoot as well as foreach scope errors. I had to copy motifPeakZtest and extractTFNames into the runFigR function foreach loop. After figuring that out, I am up and running!

Thanks for letting me know about this, and I'm glad you figured it out and got it running. I know foreach can be finicky with variable scoping, I had to troubleshoot some of this on my end as well in the process of packaging it. It should hopefully work smoother as part of the package we are releasing since all the dependencies will be forked in each subprocess and there won't be the needed to globally source any functions yourself