-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #463 from sunbeam-labs/462-make-updates-to-work-wi…
…th-storage-plugins 462 make updates to work with storage plugins
- Loading branch information
Showing
18 changed files
with
233 additions
and
76 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.. _dev: | ||
|
||
==== | ||
Dev | ||
==== | ||
|
||
Getting involved with developing Sunbeam can be a little daunting at first. This doc will try to break down the constituent parts from a developer's perspective. For starters, check out the structure_ doc to get a sense of how the code is organized. | ||
|
||
sunbeamlib | ||
========== | ||
|
||
The core of Sunbeam's configuration, setup, and execution is in the ``sunbeamlib`` module. This module is located in ``src/sunbeamlib/`` with the root ``pyproject.toml`` configuring it. It has a number of different scripts, each located in its own file prefixed by ``script_``, and also has utility functions and classes for both the scripts and some portions of the pipeline that are particularly common. | ||
|
||
workflow | ||
======== | ||
|
||
The core of the work done by Sunbeam is handled by the Snakemake workflow, located in ``workflow/``. Once a project is setup properly by sunbeamlib, the workflow can be run with all the reproducibility benefits of Snakemake. The core of the workflow is defined in ``workflow/Snakefile``. Reference the Snakemake docs for help understanding Snakemake things better; they're very good. From this core Snakefile, we import more ``.smk`` files from ``workflow/rules/`` and ``extensions/sbx_*/``. | ||
|
||
Important Variables | ||
------------------- | ||
|
||
Variables defined in the main Snakefile can be accessed throughout the workflow. Some important variables include: | ||
|
||
- ``Samples``: Dict[str, Dict[str, str]] - A dictionary where keys are sample names and values are dictionaries of read pairs mapping to file paths (``Samples[sample] = {"1": r1, "2": r2}``). | ||
- ``Pairs``: List[str] - Either ``["1", "2"]`` or ``["1"]`` depending on if the project is paired end or not. | ||
- ``Cfg``: Dict[str, Dict[str, str]] - The YAML config converted into dictionary form. | ||
- ``MIN_MEM_MB``: int - A minimum value of the number of megabytes of memory to request for each job. This will only apply for jobs that rely on Sunbeam to guess their memory requirements. | ||
- ``MIN_RUNTIME``: int - A minimum value of the number of minutes to request for each job. This will only apply for jobs that rely on Sunbeam to guess their runtime requirements. | ||
- ``HostGenomes``: List[str] - A list of host genomes that are used for decontaminating reads. | ||
- ``HostGenomeFiles``: List[str] - A list of files with host genomes that are used for decontaminating reads (not to be confused with ``sbx_mapping``'s ``GenomeFiles`` variable, which it uses to track reference genome files). | ||
- ``QC_FP``: Path - The Path to the project's quality control output directory. | ||
- ``ASSEMBLY_FP``: Path - The Path to the project's assembly output directory. | ||
- ``CLASSIFY_FP``: Path - The Path to the project's classification output directory. | ||
- ``MAPPING_FP``: Path - The Path to the project's mapping output directory. | ||
- ``BENCHMARK_FP``: Path - The Path to the project's benchmarking output directory. | ||
- ``LOG_FP``: Path - The Path to the project's log output directory. | ||
|
||
Environment Variables | ||
--------------------- | ||
|
||
- ``SUNBEAM_DIR``: str - The path to the Sunbeam installation directory. | ||
- ``SUNBEAM_VER``: str - The version of Sunbeam being run. | ||
- ``SUNBEAM_EXTS_INCLUDE``: str - If set, will include the given extension in the workflow (and exclude the rest). This is useful for testing individual extensions. | ||
- ``SUNBEAM_EXTS_EXCLUDE``: str - If set, will exclude the given extension from the workflow. This is useful for when namespaces between extensions collide (same rule name multiple times). | ||
- ``SUNBEAM_SKIP``: str - If set, will skip either 'qc' or 'decontam'. | ||
- ``SUNBEAM_DOCKER_TAG``: str - If set, will use the given tag for the Docker image instead of the default. | ||
- ``SUNBEAM_MIN_MEM_MB``: int - If set, will override the default minimum memory value. | ||
- ``SUNBEAM_MIN_RUNTIME``: int - If set, will override the default minimum runtime value. | ||
- ``SUNBEAM_NO_ADAPTER``: bool - If set, will not check that the adapter template file exists. | ||
|
||
tests | ||
===== | ||
|
||
All tests are located in the ``tests/`` directory. The tests are run with pytest, and the tests are organized into subdirectories based on the module they are testing. | ||
|
||
.github | ||
======= | ||
|
||
The ``.github/`` directory contains the configuration for GitHub Actions, which are used to run the tests on every push to the repository and manage releases. The configuration is in ``.github/workflows/``. |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _faqs: | ||
|
||
==== | ||
FAQs | ||
==== | ||
|
||
A collection of common questions, issues, or points of confusion. | ||
|
||
**I'm getting ``snakemake: error: argument --executor/-e: invalid choice: '_____' (choose from 'local', 'dryrun', 'touch')``. Why can't I use the ``--executor`` option?** | ||
|
||
You're using the exectuor option properly, it's just that you haven't installed the executor plugin. Use ``pip`` to install it and you should be good to go. | ||
|
||
**I'm trying to use singularity but it keeps failing and complaining about running out of space. I know I have plenty of open disk space. Why is it running out?** | ||
|
||
This is a known issue with singularity. It's not actually running out of space, it's just that the default location for the temporary directory is on a partition that is too small. You can change the location of the temporary directory by setting the ``SINGULARITY_TMPDIR`` and ``TMPDIR`` environment variables to a location with more space. | ||
|
||
**A rule keeps failing with an error like "perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory". What's going on?** | ||
|
||
This is unfortunately a common issue with conda where shared libraries are either not installed or not properly loaded for packages that depend on them. There can be many causes and many fixes. You can start by searching the exact error message and seeing if there are any suggestions for how to solve it. Often it will involve installing the missing library with conda or installing the missing library with the system package manager. For example, the solution to the example error for me running sunbeam on a standard Amazon machine image (AMI) was to install the library using ``sudo yum install libxcrypt-compat``. |
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
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,13 @@ | ||
# Template for running on CHOP HPC | ||
|
||
qc: | ||
host_fp: /mnt/isilon/microbiome/analysis/biodata/hosts | ||
sbx_kraken: | ||
kraken_db_fp: '/mnt/isilon/microbiome/analysis/biodata/kraken2db/standard_20200204' | ||
sbx_gene_clusters: | ||
genes_fp: /mnt/isilon/microbiome/analysis/biodata/diamondIndexes/v2.1.6.160 | ||
sbx_mapping: | ||
genomes_fp: /mnt/isilon/microbiome/analysis/biodata/bwa_and_bowtie2/six_fungal_genomes | ||
sbx_metaphlan4: | ||
dbdir: "/mnt/isilon/microbiome/analysis/biodata/metaphlan_databases/v4" | ||
dbname: "mpa_vOct22_CHOCOPhlAnSGB_202212" |
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 |
---|---|---|
|
@@ -43,6 +43,7 @@ qc: | |
pct_id: 0.5 | ||
frac: 0.6 | ||
host_fp: "" | ||
host_list: [] | ||
|
||
# Taxonomic classifications | ||
classify: | ||
|
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
Oops, something went wrong.