-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated documentation. Version bump to 0.1.1.
- Loading branch information
1 parent
3d4c815
commit 86c2e98
Showing
22 changed files
with
143 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,38 @@ | ||
# Cell state-specific single-cell eQTL mapping and cGRN inference | ||
|
||
This is an [airqtl](https://github.com/grnlab/airqtl) tutorial to map expression quantitative trait loci (eQTLs) and infer causal gene regulatory networks (cGRNs) at the cell state level of specificity. The Randolph et al [dataset](https://zenodo.org/records/4273999) from their [original study](https://www.science.org/doi/full/10.1126/science.abg0928) is used. | ||
This is an [airqtl](https://github.com/grnlab/airqtl) tutorial to map single-cell expression quantitative trait loci (sceQTLs) and infer causal gene regulatory networks (cGRNs) at the cell state level of specificity. The Randolph et al [dataset](https://zenodo.org/records/4273999) from their [original study](https://www.science.org/doi/full/10.1126/science.abg0928) is used. | ||
|
||
To use this tutorial, first [install airqtl](https://github.com/grnlab/airqtl#installation) and download this folder. You may need to update `Snakefile.config`, especially the `device` parameter if you prefer to use a CPU or a different GPU. Then the pipeline can be run with `snakemake -j 1` in shell environment. It takes ~1 day on a top-end Dell Alienware Aurora R16®, in which single-cell eQTL mapping takes ~10mins for each cell state. | ||
**This tutorial is being actively updated. Please check back often.** | ||
|
||
More documentation is underway to help you understand and customize this pipeline and repurpose it for your own data. | ||
## Running the tutorial | ||
1. [Install airqtl](https://github.com/grnlab/airqtl#installation) and download this folder | ||
2. (Optional) Customize pipeline configuration in `Snakefile.config`, especially the `device` parameter if you prefer to use a CPU or a different GPU. See [Understanding and customizing the tutorial](#Understanding-and-customizing-the-tutorial). | ||
3. Run the pipeline with `snakemake -j 1` **twice** in shell. The first run will download the raw dataset from Zenodo. The second run will read in the cell states to map sceQTLs infer cGRNs for each cell state. | ||
4. Check the sceQTL output files at `data/association` and cGRN output file at `data/merge.tsv.gz`. | ||
|
||
If you face any issues or need any assistance, see [FAQ](https://github.com/grnlab/airqtl#faq) and [Issues](https://github.com/grnlab/airqtl#issues). | ||
The whole run takes ~1 day on a top-end Dell Alienware Aurora R16®, in which single-cell eQTL mapping takes ~10mins for each cell state. The download step can take longer if your internet is slow. | ||
|
||
After a successful run of this tutorial, you can [repurpose it for your own dataset](#Repurposing-the-tutorial-pipeline-for-your-own-dataset). | ||
|
||
## Understanding and customizing the tutorial | ||
* Input files of the pipeline are described in the `datasetfiles_data` and `datasetfiles_meta` variables in [airqtl.pipeline.dataset](../../../src/airqtl/pipeline/dataset.py). Check the downloaded files in `data/raw/` to understand their format. | ||
* Each step of the pipeline is defined as a rule sequentially in `Snakefile`. Take the sceQTL association as an example, it corresponds to i) the shell command `airqtl eqtl association` and ii) the python function `airqtl.pipline.eqtl.association`. Therefore, you can learn more from either the command `airqtl eqtl association -h` or the docstring of `airqtl.pipline.eqtl.association`. The output files and logs of each step are located in `data/x` and `log/x.log` respectively, where x is the name of the step/rule and can be either a folder or a file with name suffix. Some of the steps are run once for the whole dataset while some are run separately for each cell state. | ||
* To change pipeline parameters, modify `Snakefile.config`. You can use custom command-line parameters of each step according to their accepted parameters such as those obtained from `airqtl eqtl association -h`. | ||
* To run the tutorial pipeline in parallel or on a cluster, modify `Snakefile` which is based on [Snakemake](https://snakemake.readthedocs.io/en/stable/). | ||
|
||
## Repurposing the tutorial pipeline for your own dataset | ||
1. [Run this tutorial pipeline](#Running-the-tutorial) successfully | ||
2. [Understand the format of input files](#Understanding-and-customizing-the-tutorial) in `data/raw` folder | ||
3. Perform initial quality control of your own dataset | ||
4. Download this tutorial folder to a new location on your computer | ||
5. Reformat your own dataset into the accepted format and place the files in newly created `data/raw` folder | ||
6. [Customize the pipeline](#Understanding-and-customizing-the-tutorial) as needed | ||
7. [Run the pipeline](#Running-the-tutorial) for your own dataset | ||
8. Check the output files | ||
|
||
## Issues | ||
If you encounter any error, you are suggested to first troubleshoot on your own. The error logs are located inside console output and the folder `log`. | ||
|
||
If you cannot resolve the error or have any other question, please [check the FAQ](../../../#faq) or [raise an issue](../../../#issues). | ||
|
||
If you applied any fix to the code or pipeline, you are strongly suggested to start over from step 1 of [Running the tutorial](#Running-the-tutorial), unless you are experienced and know what you are doing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
[project] | ||
name = "airqtl" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
authors = [ | ||
{ name="Lingfei Wang", email="[email protected]" }, | ||
] | ||
description = "Array of Interleaved Repeats for Quantitative Trait Loci" | ||
readme = "README.rst" | ||
license = {file = "LICENSE"} | ||
keywords = ["qtl","eqtl","scqtl","sceqtl","lmm","quantitative trait loci","expression quantitative trait loci","single-cell quantitative trait loci","single-cell expression quantitative trait loci","linear mixed model","linear mixed models","population-scale scRNA-seq","gene regulatory network","network inference","causal inference","mendelian randomization"] | ||
requires-python = ">=3.8" | ||
requires-python = ">=3.12" | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"License :: OSI Approved :: BSD License", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[pylint.MASTER] | ||
ignore-paths=.*/[.].*,^[.].*,__pycache__ | ||
|
||
[pylint.MESSAGES CONTROL] | ||
disable=W0311,C0301,C0413,W0406,C0103,C0415,E0102,E1101,C0206,C0303,C0209,W0611,R0913,R0914,W1514,C0302,W0511,R0902,E1121,R0915,R0912,E1136,W1202,W0102,W0201,E0101,C0200,W1401,W1201,R1710,W1203,E0401,R0903,E1102,R0401,R0904,C0325,R1735 | ||
|
||
[flake8] | ||
ignore=F405,E225,E231,F403,E402,N801,W191,E501,E226,W293,E123,E301,E265,E302,E303,E227,E741,W291,E228,C901,E252,E128,E126,N806,N803,E124 | ||
exclude = __pycache__,.*,src/dictys/net/layout.py,src/dictys/scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
|
||
if __name__ == "__main__": | ||
import airqtl | ||
airqtl.main() | ||
airqtl.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,4 +92,5 @@ def o2d(dc,missing={}): | |
dcnew=dcnew.loc[:,dcnew.nunique()!=1].copy() | ||
return dcnew | ||
|
||
|
||
assert __name__ != "__main__" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.