This repository contains the analysis code pipeline to generate PEER factors from pseudo-bulk data and perform eQTL association analysis as part of the manuscript "Pitfalls and opportunities for applying latent variables in single-cell eQTL analyses"
Scripts are listed by the order in the methods section of the manuscript:
- Extract the whole OneK1K dataset from .RDS and subgroup into 14 cell types
- Generate the pseudo-bulk mean matrix
- Generate PEER factors (PFs) with 13 QC options
- Extra information of runtime and nr of iterations
- Make new covariate files
- Run sensitivity test by MatrixeQTL
- Merge results
- Summarize and nr of eQTL and eGenes
- Down-sampling analysis
- Principal component analysis (PCA)
- Generate PCs by PCAForQTL
- Run eQTL sensitivity test adjusting PCs 0-50 (similar to PFs)
- Main figures
- Supplementary figures and tables
Folder v1.0 contains the older version of the scripts.
All code is also available on Angli's personal Github: https://github.com/anglixue/PEER_factors/ and Zenodo: https://doi.org/10.5281/zenodo.7513270
We have submitted the OneK1K Seurat object that was used in Yazar et al. (Science. 2022) to the cellxgene. However, the platform only accepts GRCh38 but in Yazar et al we used GRCh37. So we have to realign the data to fulfill the website requirement, which explains the slight difference in the number of cells between the published version and cellxgene version.
Also, we suggest removing two individuals (“88_88” and “966_967”) due to the extremely low number of cells and abnormal cell composition. The exact steps can be found on line #18-22 on this Github page.
If you need the updated Seurat object of OneK1K or newly generated PEER factors for 14 cell types, please email Angli Xue ([email protected]).
Angli Xue, Seyhan Yazar, Drew Neavin, Joseph E. Powell. Pitfalls and opportunities for applying latent variables in single-cell eQTL analyses. Genome Biology. 2023. [Full text]
For questions, please email us at Angli Xue ([email protected]) or Joseph E. Powell ([email protected]).