|
1 | 1 | # Universal Genotyping Pipeline |
2 | 2 |
|
3 | | -[](https://snakemake.readthedocs.io) |
4 | 3 | [](VERSION) |
| 4 | +[](https://snakemake.readthedocs.io) |
5 | 5 |
|
6 | 6 | Universal Genotyping Pipeline is a Snakemake preprocessing pipeline for downstream allele-specific CNA inference softwares including: |
7 | | -- [HATCHet](https://github.com/raphael-group/hatchet) - bulk **short-read** WGS/WES, **long-read** PacBio HiFi/ONT, |
8 | | -- [Copy-typing](https://github.com/raphael-group/Copy-typing) - scRNA-seq, scATAC-seq, |
| 7 | +- [HATCHet](https://github.com/raphael-group/hatchet) - bulk **short-read** WGS/WES, **long-read** PacBio HiFi/Oxford Nanopore, |
| 8 | +- [Copy-typing](https://github.com/raphael-group/Copy-typing) - scRNA-seq, scATAC-seq, Epi Multiome, |
9 | 9 | - [CalicoST](https://github.com/raphael-group/CalicoST) - Visium ST. |
10 | 10 |
|
11 | 11 | --- |
12 | 12 |
|
| 13 | +## Installation |
| 14 | + |
| 15 | +`Universal-Genotyping-Pipeline` requires a 64-bit Linux system and [conda](https://docs.conda.io/en/latest/) and [Snakemake](https://snakemake.readthedocs.io/) (version 9 or newer). Create the runner environment from [`environment.yaml`](environment.yaml) and activate it: |
| 16 | + |
| 17 | +```sh |
| 18 | +conda env create -f environment.yaml |
| 19 | +conda activate genotyping-env |
| 20 | +``` |
| 21 | + |
| 22 | +Build the conda environments for pipeline dependencies **once** for all future runs: |
| 23 | + |
| 24 | +```sh |
| 25 | +snakemake --profile profile/ \ |
| 26 | + --conda-create-envs-only --cores 1 \ |
| 27 | + -s workflow/Snakefile |
| 28 | +``` |
| 29 | + |
| 30 | +All pipeline dependencies can be found at [`workflow/envs/`](./workflow/envs/), see [dependencies](./docs/reference.md#dependencies) for details. |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## Configuration |
| 35 | + |
| 36 | +--- |
| 37 | +The profile at [`profile/config.yaml`](profile/config.yaml) holds run-wide settings. The main keys to check: |
| 38 | + |
| 39 | +| Key | Usage | |
| 40 | +|-----|--------------| |
| 41 | +| `cores` | Max CPU cores the whole pipeline may use for job scheduling. | |
| 42 | +| `use-conda` | Keep `true`. | |
| 43 | +| `conda-prefix` | Where the pipeline dependencies environments live; set to an **absolute path**. | |
| 44 | +| `resources: downloads` | How many remote (URL) input files download at once; default `2`. | |
| 45 | +| `local-storage-prefix` | Where remote input files are downloaded; set to a large scratch disk. | |
| 46 | + |
| 47 | +> [!IMPORTANT] |
| 48 | +> The default `conda-prefix` is the relative path `.snakemake/conda` w.r.t. current working directory. After the environments are built, change it to an absolute path to avoid re-building the environment for every new run. |
| 49 | +
|
| 50 | +--- |
| 51 | + |
| 52 | +The sample sheet ([template](resources/templates/samples.json)) is a JSON file lists the input datasets & configurations. Copy the template and modify from it according to [schema](docs/sample_sheet.md). Validate the format and check the file existence via: |
| 53 | + |
| 54 | +```sh |
| 55 | +python resources/scripts/validate_sample_file.py /path/to/samples.json --check-files |
| 56 | +``` |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +The config file ([template](resources/templates/config.yaml)) is a YAML file lists the detailed workflow parameters and paths. See [reference.md](docs/reference.md#configuration) for detailed guidelines for each specific workflow: [bulk-genotyping](docs/bulk_genotyping.md), [single-cell-genotyping](docs/single_cell_genotyping.md), [copytyping-preprocess](docs/copytyping_preprocess.md). |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## Running the pipeline |
| 65 | + |
| 66 | +Run the snakemake pipeline using following commands. `--config` allows user to overwrite config parameters against the config file. |
| 67 | + |
| 68 | +```sh |
| 69 | +snakemake --profile profile/ \ |
| 70 | + -s workflow/Snakefile \ |
| 71 | + --configfile /path/to/my_config.yaml \ |
| 72 | + --directory <output_dir> \ |
| 73 | + --config sample_file=/path/to/samples.json sample_id=<PATIENT_ID> |
| 74 | +``` |
| 75 | + |
| 76 | + |
| 77 | +> [!TIP] |
| 78 | +> - For the first run, use CMD argument `--dry-run` (`-n`). It lists the jobs Snakemake would run without actual executions, so you can confirm the plan and catch potential configuration errors. |
| 79 | +> - If a run failed at intermediate jobs or user changed downstream parameters, use CMD argument |
| 80 | +> `--rerun-incomplete` to resume execution. |
| 81 | +
|
| 82 | +--- |
| 83 | + |
13 | 84 | ## Documentation |
14 | 85 |
|
15 | 86 | | Document | Description | |
16 | 87 | |----------|-------------| |
17 | | -| [docs/pipeline.md](docs/pipeline.md) | Install, configure, and run the Snakemake pipeline. | |
18 | 88 | | [docs/bulk_genotyping.md](docs/bulk_genotyping.md) | Bulk genotyping workflow | |
19 | 89 | | [docs/single_cell_genotyping.md](docs/single_cell_genotyping.md) | Single-cell/spatial genotyping workflow | |
20 | 90 | | [docs/copytyping_preprocess.md](docs/copytyping_preprocess.md) | Copy-typing preprocessing workflow | |
21 | | -| [docs/workflow.md](docs/workflow.md) | Detailed description per workflow | |
22 | 91 | | [docs/sample_sheet.md](docs/sample_sheet.md) | Sample sheet specification | |
23 | | -| [docs/reference.md](docs/reference.md) | Manual for input, output, and (hyper-)parameters | |
24 | | -| [config/config.yaml](config/config.yaml) | Default configuration (auto-loaded by the Snakefile) | |
25 | | -| [resources/templates/](resources/templates/) | User config and sample-file templates | |
| 92 | +| [docs/reference.md](docs/reference.md) | Reference manual | |
26 | 93 | | [resources/README.md](resources/README.md) | External data resources | |
27 | 94 | | [CHANGELOG.md](CHANGELOG.md) | Release notes and version history | |
0 commit comments