Skip to content

Commit 4fb45e0

Browse files
committed
updated README created Nextflow directory
1 parent 1ad724a commit 4fb45e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3023
-168
lines changed

Amplicon/Illumina/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
**Developed by:**
3131
Michael D. Lee (Mike.Lee@nasa.gov)
3232
**Maintained by:**
33+
Olabiyi A. Obayomi (olabiyi.a.obayomi@nasa.gov)
3334
Michael D. Lee (Mike.Lee@nasa.gov)
3435
Alexis Torres (alexis.torres@nasa.gov)
3536
Amanda Saravia-Butler (amanda.m.saravia-butler@nasa.gov)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Workflow change log
2+
3+
## [1.0.0](https://github.com/nasa/GeneLab_Data_Processing/tree/NF_AmpIllumina_1.0.0/Amplicon/Illumina/Workflow_Documentation/NF_AmpIllumina)
4+
- Version that coverted snakemake to nextflow
5+
6+
<br>
7+
8+
---
9+
10+
<br>
11+
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# Workflow Information and Usage Instructions
2+
3+
## General Workflow Info
4+
5+
### Implementation Tools
6+
7+
The current GeneLab Illumina amplicon sequencing data processing pipeline (AmpIllumina), [GL-DPPD-7104-B.md](../../Pipeline_GL-DPPD-7104_Versions/GL-DPPD-7104-B.md), is implemented as a [Nextflow](https://nextflow.io/) DSL2 workflow and utilizes [Singularity](https://docs.sylabs.io/guides/3.10/user-guide/introduction.html) containers or [conda](https://docs.conda.io/en/latest/) environments to install/run all tools. This workflow is run using the command line interface (CLI) of any unix-based system. While knowledge of creating workflows in nextflow is not required to run the workflow as is, [the Nextflow documentation](https://nextflow.io/docs/latest/index.html) is a useful resource for users who want to modify and/or extend this workflow.
8+
9+
## Utilizing the Workflow
10+
11+
1. [Install Nextflow and Singularity](#1-install-nextflow-and-singularity)
12+
1a. [Install Nextflow](#1a-install-nextflow)
13+
1b. [Install Singularity](#1b-install-singularity)
14+
15+
2. [Download the workflow files](#2-download-the-workflow-files)
16+
17+
3. [Fetch Singularity Images](#3-fetch-singularity-images)
18+
19+
4. [Run the workflow](#4-run-the-workflow)
20+
4a. [Approach 1: Run slurm jobs in singularity containers with OSD accession as input](#4a-approach-1-run-slurm-jobs-in-singularity-containers-with-osd-accession-as-input)
21+
4b. [Approach 2: Run slurm jobs in singularity containers with a csv file as input](#4b-approach-2-run-slurm-jobs-in-singularity-containers-with-a-csv-file-as-input)
22+
4c. [Approach 3: Run jobs locally in conda environments and specify the path to one or more existing conda environments](#4c-approach-run-jobs-locally-in-conda-environments-and-specify-the-path-to-one-or-more-existing-conda-environments)
23+
4d. [Modify parameters and cpu resources in the nextflow config file](#4d-modify-parameters-and-cpu-resources-in-the-nextflow-config-file)
24+
25+
5. [Workflow outputs](#5-workflow-outputs)
26+
5a. [Main outputs](#5a-main-outputs)
27+
5b. [Resource logs](#5b-resource-logs)
28+
29+
<br>
30+
31+
---
32+
33+
### 1. Install Nextflow and Singularity
34+
35+
#### 1a. Install Nextflow
36+
37+
Nextflow can be installed either through [Anaconda](https://anaconda.org/bioconda/nextflow) or as documented on the [Nextflow documentation page](https://www.nextflow.io/docs/latest/getstarted.html).
38+
39+
> Note: If you want to install Anaconda, we recommend installing a Miniconda, Python3 version appropriate for your system, as instructed by [Happy Belly Bioinformatics](https://astrobiomike.github.io/unix/conda-intro#getting-and-installing-conda).
40+
>
41+
> Once conda is installed on your system, you can install the latest version of Nextflow by running the following commands:
42+
>
43+
> ```bash
44+
> conda install -c bioconda nextflow
45+
> nextflow self-update
46+
> ```
47+
48+
<br>
49+
50+
#### 1b. Install Singularity
51+
52+
Singularity is a container platform that allows usage of containerized software. This enables the GeneLab workflow to retrieve and use all software required for processing without the need to install the software directly on the user's system.
53+
54+
We recommend installing Singularity on a system wide level as per the associated [documentation](https://docs.sylabs.io/guides/3.10/admin-guide/admin_quickstart.html).
55+
56+
> Note: Singularity is also available through [Anaconda](https://anaconda.org/conda-forge/singularity).
57+
58+
<br>
59+
60+
---
61+
62+
### 2. Download the workflow files
63+
64+
All files required for utilizing the NF_XXX GeneLab workflow for processing amplicon illumina data are in the [workflow_code](workflow_code) directory. To get a copy of latest *NF_XXX* version on to your system, the code can be downloaded as a zip file from the release page then unzipped after downloading by running the following commands:
65+
66+
```bash
67+
wget https://github.com/nasa/GeneLab_Data_Processing/releases/download/NF_AmpIllumina/NF_AmpIllumina.zip
68+
unzip NF_AmpIllumina.zip && cd NF_XXX-X_X.X.X
69+
```
70+
71+
<br>
72+
73+
---
74+
75+
### 3. Fetch Singularity Images
76+
77+
Although Nextflow can fetch Singularity images from a url, doing so may cause issues as detailed [here](https://github.com/nextflow-io/nextflow/issues/1210).
78+
79+
To avoid this issue, run the following command to fetch the Singularity images prior to running the NF_MGIllumina workflow:
80+
81+
> Note: This command should be run in the location containing the `NF_MGIllumina` directory that was downloaded in [step 2](#2-download-the-workflow-files) above.
82+
83+
```bash
84+
bash ./bin/prepull_singularity.sh nextflow.config
85+
```
86+
87+
Once complete, a `singularity` folder containing the Singularity images will be created. Run the following command to export this folder as a Nextflow configuration environment variable to ensure Nextflow can locate the fetched images:
88+
89+
```bash
90+
export NXF_SINGULARITY_CACHEDIR=$(pwd)/singularity
91+
```
92+
93+
<br>
94+
95+
---
96+
97+
### 4. Run the Workflow
98+
99+
For options and detailed help on how to run the workflow, run the following command:
100+
101+
```bash
102+
nextflow run main.nf --help
103+
```
104+
105+
> Note: Nextflow commands use both single hyphen arguments (e.g. -help) that denote general nextflow arguments and double hyphen arguments (e.g. --csv_file) that denote workflow specific parameters. Take care to use the proper number of hyphens for each argument.
106+
107+
<br>
108+
109+
#### 4a. Approach 1: Run slurm jobs in singularity containers with OSD accession as input
110+
111+
```bash
112+
nextflow run main.nf -resume -profile slurm,singularity --GLDS_accession GLDS-487 --target_region 16S
113+
```
114+
115+
<br>
116+
117+
#### 4b. Approach 2: Run slurm jobs in singularity containers with a csv file as input
118+
119+
```bash
120+
nextflow run main.nf -resume -profile slurm,singularity --csv_file PE_file.csv --target_region 16S --F_primer AGAGTTTGATCCTGGCTCAG --R_primer CTGCCTCCCGTAGGAGT
121+
```
122+
123+
<br>
124+
125+
#### 4c. Approach 3: Run jobs locally in conda environments and specify the path to one or more existing conda environment(s)
126+
127+
```bash
128+
nextflow run main.nf -resume -profile conda --csv_file SE_file.csv --target_region 16S --F_primer AGAGTTTGATCCTGGCTCAG --R_primer CTGCCTCCCGTAGGAGT --conda.qc <path/to/existing/conda/environment>
129+
```
130+
131+
<br>
132+
133+
**Required Parameters For All Approaches:**
134+
135+
* `-run main.nf` - Instructs nextflow to run the NF_XXX workflow
136+
* `-resume` - Resumes workflow execution using previously cached results
137+
* `-profile` – Specifies the configuration profile(s) to load, `singularity` instructs nextflow to setup and use singularity for all software called in the workflow
138+
* `--target_region` – Specifies the amplicon target region to be analyzed, 16S, 18S or ITS.
139+
140+
141+
*Required only if you would like to pull and process data directly from OSDR*
142+
143+
* `--GLDS_accession` – A Genelab / OSD accession number e.g. GLDS-487.
144+
145+
*Required only if --GLDS_accession is not passed as an argument*
146+
147+
* `--csv_file` – A 3-column (single-end) or 4-column (paired-end) input csv file (sample_id, forward, [reverse,] paired). Please see the sample [SE_file.csv](workflow_code/SE_file.csv) and [PE_file.csv](workflow_code/PE_file.csv) in this repository for examples on how to format this file.
148+
149+
* `--F_primer` – Forward primer sequence.
150+
151+
* `--R_primer` – Reverse primer sequence.
152+
153+
> See `nextflow run -h` and [Nextflow's CLI run command documentation](https://nextflow.io/docs/latest/cli.html#run) for more options and details on how to run nextflow.
154+
155+
<br>
156+
157+
#### 4d. Modify parameters and cpu resources in the nextflow config file
158+
159+
Additionally, the parameters and workflow resources can be directly specified in the nextflow.config file. For detailed instructions on how to modify and set parameters in the nextflow.config file, please see the [documentation here](https://www.nextflow.io/docs/latest/config.html).
160+
161+
Once you've downloaded the workflow template, you can modify the parameters in the `params` scope and cpus/memory requirements in the `process` scope in your downloaded version of the [nextflow.config](workflow_code/nextflow.config) file as needed in order to match your dataset and system setup. For example, you can directly set the the full paths to available conda environments in the `conda` scope within the `params` scope. Additionally, if necessary, you'll need to modify each variable in the [nextflow.config](workflow_code/nextflow.config) file to be consistent with the study you want to process and the machine you're using.
162+
163+
<br>
164+
165+
---
166+
167+
### 5. Workflow outputs
168+
169+
#### 5a. Main outputs
170+
171+
The outputs from this pipeline are documented in the [GL-DPPD-7104-B](../../Pipeline_GL-DPPD-7104_Versions/GL-DPPD-7104-B.md) processing protocol.
172+
173+
#### 5b. Resource logs
174+
175+
Standard nextflow resource usage logs are also produced as follows:
176+
177+
- Output:
178+
- Resource_Usage/execution_report_{timestamp}.html (an html report that includes metrics about the workflow execution including computational resources and exact workflow process commands)
179+
- Resource_Usage/execution_timeline_{timestamp}.html (an html timeline for all processes executed in the workflow)
180+
- Resource_Usage/execution_trace_{timestamp}.txt (an execution tracing file that contains information about each process executed in the workflow, including: submission time, start time, completion time, cpu and memory used, machine-readable output)
181+
182+
> Further details about these logs can also found within [this Nextflow documentation page](https://www.nextflow.io/docs/latest/tracing.html#execution-report).
183+

0 commit comments

Comments
 (0)