Skip to content

Commit 0981b91

Browse files
committed
Added help
1 parent b78bd10 commit 0981b91

File tree

5 files changed

+187
-50
lines changed

5 files changed

+187
-50
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sample_id,forward,reverse,paired
2-
Sample-1,/global/data/temp_scratch/oobayomi/amplicon/nextflow_test/example-amplicon-reads/Sample-1_R1_raw.fastq.gz,/global/data/temp_scratch/oobayomi/amplicon/nextflow_test/example-amplicon-reads/Sample-1_R2_raw.fastq.gz,true
3-
Sample-2,/global/data/temp_scratch/oobayomi/amplicon/nextflow_test/example-amplicon-reads/Sample-2_R1_raw.fastq.gz,/global/data/temp_scratch/oobayomi/amplicon/nextflow_test/example-amplicon-reads/Sample-2_R2_raw.fastq.gz,true
2+
Sample-1,/path/to/raw-reads/Sample-1_R1_raw.fastq.gz,/path/to/raw-reads/Sample-1_R2_raw.fastq.gz,true
3+
Sample-2,/path/to/raw-reads/Sample-2_R1_raw.fastq.gz,/path/to/raw-reads/Sample-2_R2_raw.fastq.gz,true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sample_id,forward,paired
2-
Sample-1,/global/data/temp_scratch/oobayomi/amplicon/nextflow_test/example-amplicon-reads/Sample-1_R1_raw.fastq.gz,false
3-
Sample-2,/global/data/temp_scratch/oobayomi/amplicon/nextflow_test/example-amplicon-reads/Sample-2_R1_raw.fastq.gz,false
2+
Sample-1,/path/to/raw-reads/Sample-1_R1_raw.fastq.gz,false
3+
Sample-2,/path/to/raw-reads/Sample-2_R1_raw.fastq.gz,false

Amplicon/Illumina/Workflow_Documentation/SW_AmpIllumina-B/workflow_code/main.nf

Lines changed: 141 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,147 @@ c_bright_green = "\u001b[32;1m";
77
c_blue = "\033[0;34m";
88
c_reset = "\033[0m";
99

10-
11-
12-
// create GLD runsheet
13-
10+
/**************************************************
11+
* HELP MENU **************************************
12+
**************************************************/
13+
if (params.help) {
14+
println()
15+
println("Nextflow Amp454IonTor Consensus Pipeline: $workflow.manifest.version")
16+
println("USAGE:")
17+
println("Example 1: Submit and run jobs with slurm in singularity containers.")
18+
println(" > nextflow run main.nf -resume -profile slurm_sing --csv_file PE_file.csv --target_region 16S --F_primer AGAGTTTGATCCTGGCTCAG --R_primer CTGCCTCCCGTAGGAGT")
19+
println()
20+
println("Example 2: : Submit and run jobs with slurm in conda environments.")
21+
println(" > nextflow run main.nf -resume -profile slurm_conda --csv_file SE_file.csv --target_region 1TS --F_primer AGAGTTTGATCCTGGCTCAG --R_primer CTGCCTCCCGTAGGAGT")
22+
println()
23+
println("Example 3: Run jobs locally in conda environments, supplying a GLDS accession, and specify the path to an existing conda environment")
24+
println(" > nextflow run main.nf -resume -profile conda --GLDS_accession OSD-256 --target_region 18S --F_primer AGAGTTTGATCCTGGCTCAG --R_primer CTGCCTCCCGTAGGAGT --conda.qc <path/to/existing/conda/environment>")
25+
println()
26+
println("Required arguments:")
27+
println("""-profile [STRING] What profile should be used be use to run the workflow. Options are [singularity, docker, conda, slurm_sing, slurm_conda].
28+
singularity, docker and conda will run the pipelne locally using singularity, docker, and conda, respectively.
29+
slurm_sing and slurm_conda will submit and run jobs using slurm in singularity containers and conda environments, respectively. """)
30+
println("--csv_file [PATH] A 3-column (single-end) or 4-column (paired-end) input file (sample_id, forward, [reverse,] paired). Mandatory if a GLDS accession is not provided.")
31+
println(" Please see the files: SE_file.csv and PE_file.csv for single-end and paired-end examples, respectively.")
32+
println(" The sample_id column should contain unique sample ids.")
33+
println(" The forward and reverse columns should contain the absolute or relative path to the sample's forward and reverse reads.")
34+
println(" The paired column should be true for paired-end or anything else for single-end reads.")
35+
println("--target_region [STRING] What is the amplicon target region to be analyzed. Options are one of [16S, 18S, ITS]. Default: 16S")
36+
println("--trim_primers [BOOLEAN] Should primers be trimmed? true or false. Default: true")
37+
println("--raw_R1_suffix [STRING] Raw forward reads suffix (region following the unique part of the sample names). e.g. _R1_raw.fastq.gz")
38+
println("--raw_R2_suffix [STRING] Raw reverse reads suffix (region following the unique part of the sample names). e.g. _R2_raw.fastq.gz")
39+
40+
println("Cutadapt (trimming) parameters:")
41+
println(" --F_primer [STRING] Forward primer sequence e.g. AGAGTTTGATCCTGGCTCAG")
42+
println(" --R_primer [STRING] Reverse primer sequence e.g. CTGCCTCCCGTAGGAGT")
43+
println(" --min_cutadapt_len [int] What should be the minimum read length after quality trimming with cutadapt. Default: 130")
44+
println(" --primers_linked [STRING] Are the primers linked?. https://cutadapt.readthedocs.io/en/stable/recipes.html#trimming-amplicon-primers-from-paired-end-reads. Default: TRUE ")
45+
println(" --discard_untrimmed [STRING] Should untrimmed reads be discarded? Any supplied string except TRUE will not discard them. Default: TRUE")
46+
47+
println("Optional arguments:")
48+
println(" --help Print this help message and exit")
49+
println(" --publishDir_mode [STRING] How should nextflow publish file outputs. Options can be found here https://www.nextflow.io/docs/latest/process.html#publishdir Default: link.")
50+
println(" --errorStrategy [STRING] How should nextflow handle errors. Options can be found here https://www.nextflow.io/docs/latest/process.html#errorstrategy. Default: ignore")
51+
println(" --enable_visualizations [BOOLEAN] Should ASV plots be made? true or false. if true supply a path to the ruhnsheet for plotting to the --runsheet option. Default: false")
52+
println(" --runsheet [PATH] A 4-column file with these exact headers [ Sample Name, read1_path, raw_R1_suffix, groups] for plotting. Only relevant if --enable_visualizations is true. Default: null")
53+
println(" --multiqc_config [PATH] Path to a custome multiqc config file. Default: config/multiqc.config")
54+
55+
println("Dada2 parameters passed to filterAndTrim() function:")
56+
println(" --left_trunc [INT] truncate the sequences to the left by this number of bases. Default: 0")
57+
println(" --right_trunc [INT] truncate the sequences to the right by this number of bases. Default: 0")
58+
println(" --left_maxEE [INT] Maximum allowed errors to the left. Default: 1")
59+
println(" --right_maxEE [INT] Maximum allowed errors to the right. Default: 1")
60+
println(" --concatenate_reads_only [STRING] Concatenate only with dada2 instead of merging paired reads if TRUE.")
61+
println(" This is typically used with primers like 515-926, that captured 18S fragments that are typically too long to merge.")
62+
println(" Note that 16S and 18S should have been separated already prior to running this workflow. This should likely be left as FALSE for any option other than 18S above")
63+
println(" Values are TRUE or FALSE Default: FALSE")
64+
65+
println("File Suffixes:")
66+
println(" --primer_trimmed_R1_suffix [STRING] Suffix to use for naming your primer trimmed forward reads. Default: _R1_trimmed.fastq.gz")
67+
println(" --primer_trimmed_R2_suffix [STRING] Suffix to use for naming your primer trimmed reverse reads. Default: _R2_trimmed.fastq.gz")
68+
println(" --filtered_R1_suffix [STRING] Suffix to use for naming your quality filtered forward reads. Default: _R1_filtered.fastq.gz")
69+
println(" --filtered_R2_suffix [STRING] Suffix to use for naming your quality filtered reverse reads. Default: _R2_filtered.fastq.gz")
70+
println("Output directories:")
71+
println(" --raw_reads_dir [PATH] Where should the fastqc report of the raw reads be stored. Default: Raw_Sequence_Data/")
72+
println(" --fastqc_out_dir [PATH] Where should multiqc outputs be stored. Default: workflow_output/FastQC_Outputs/")
73+
println(" --trimmed_reads_dir [PATH] Where should your cutadapt trimmed reads be stored. Default: workflow_output/Trimmed_Sequence_Data/")
74+
println(" --filtered_reads_dir [PATH] Where should your filtered reads be stored. Default: workflow_output/Filtered_Sequence_Data/")
75+
println(" --info_out_dir [PATH] Where should output metadata be stored. Default: workflow_output/Metadata/")
76+
println(" --plots_dir [PATH] Where should your plots be stored if visualization is enabled. Default: workflow_output/Final_Outputs/Plots/")
77+
println(" --final_outputs_dir [PATH] Where should most outputs and summary reports be stored. Default: workflow_output/Final_Outputs/")
78+
println("Genelab specific arguements:")
79+
println(" --GLDS_accession [STRING] A Genelab accession number if the --csv_file parameter is not set. If this parameter is set, it will ignore the --csv_file parameter.")
80+
println(" --assay_suffix [STRING] Genelabs assay suffix. Default: GLAmpSeq.")
81+
println(" --output_prefix [STRING] Unique name to tag onto output files. Default: ''")
82+
println("Paths to existing conda environments to use otherwise a new one will be created using the yaml file in envs/.")
83+
println(" --conda.qc [PATH] Path to a conda environment containing fastqc, multiqc, zip and python. Default: null.")
84+
println(" --conda.R [PATH] Path to a conda environment containing R along with the packages decipher and biomformat installed. Default: null.")
85+
println(" --conda.genelab [PATH] Path to a conda environment containing genlab-utils. Default: null.")
86+
println(" --conda.cutadapt [PATH] Path to a conda environment containing cutadapt. Default: null.")
87+
println(" --conda.R_visualizations [PATH] Path to a conda environment containing R packages required for plotting. Default: null.")
88+
print("Advanced users can edit the nextflow.config file for more control over default settings such container choice, number cpus, memory per task etc.")
89+
exit 0
90+
}
91+
92+
log.info """
93+
Nextflow Amp454IonTor Consensus Pipeline: $workflow.manifest.version
94+
95+
You have set the following parameters:
96+
Input csv file : ${params.csv_file}
97+
GLDS_accession : ${params.GLDS_accession}
98+
Amplicon target region : ${params.target_region}
99+
Nextflow Directory publishing mode: ${params.publishDir_mode}
100+
Trim Primers: ${params.trim_primers}
101+
Nextflow Error strategy: ${params.errorStrategy}
102+
Enable visualization: ${params.enable_visualizations}
103+
Runsheet For plotting: ${params.runsheet}
104+
MultiQC configuration file: ${params.multiqc_config}
105+
106+
File Suffixes:
107+
Raw Forward Reads Suffix: ${params.raw_R1_suffix}
108+
Raw Reverse Reads Suffix: ${params.raw_R2_suffix}
109+
Trimmed Forward Reads Suffix: ${params.primer_trimmed_R1_suffix}
110+
Trimmed Reverse Reads Suffix: ${params.primer_trimmed_R2_suffix}
111+
Filtered Forward Reads Suffix: ${params.filtered_R1_suffix}
112+
Filtered Reverse Reads Suffix: ${params.filtered_R2_suffix}
113+
114+
Cutadapt Parameters:
115+
Forward Primer: ${params.F_primer}
116+
Reverse Primer: ${params.R_primer}
117+
Minimum Trimmed Reads length: ${params.min_cutadapt_len}
118+
Primers Are linked: ${params.primers_linked}
119+
Discard Untrimmed Reads: ${params.discard_untrimmed}
120+
121+
122+
Dada2 Parameters:
123+
Truncate left: ${params.left_trunc}bp
124+
Truncate right: ${params.right_trunc}bp
125+
Max error left: ${params.left_maxEE}
126+
Max error right: ${params.right_maxEE}
127+
Concatenate Reads: ${params.concatenate_reads_only}
128+
129+
Output Directories:
130+
Raw reads: ${params.raw_reads_dir}
131+
FastQC: ${params.fastqc_out_dir}
132+
Trimmed Reads: ${params.trimmed_reads_dir}
133+
Filtered Reads: ${params.filtered_reads_dir}
134+
Metadata: ${params.info_out_dir}
135+
Plots: ${params.plots_dir}
136+
Reports: ${params.final_outputs_dir}
137+
138+
Genelab Assay Suffix: ${params.assay_suffix}
139+
Output Prefix: ${params.output_prefix}
140+
141+
Conda Environments:
142+
qc: ${params.conda.qc}
143+
R: ${params.conda.R}
144+
genelab: ${params.conda.genelab}
145+
cutadapt: ${params.conda.cutadapt}
146+
R_visualizations: ${params.conda.R_visualizations}
147+
""".stripIndent()
148+
149+
150+
// Create GLDS runsheet
14151
include { GET_RUNSHEET } from "./modules/create_runsheet.nf"
15152

16153
// Read quality check and filtering
@@ -68,8 +205,6 @@ workflow {
68205
tuple( "${row.sample_id}", [file("${row.forward}")], deleteWS(row.paired))
69206
}.set{reads_ch}
70207

71-
//reads_ch.view()
72-
//return
73208
// Generating a file with sample ids on a new line
74209
file_ch.map{row -> "${row.sample_id}"}
75210
.collectFile(name: "${baseDir}/unique-sample-IDs.txt", newLine: true)

0 commit comments

Comments
 (0)