forked from s-andrews/nextflow_pipelines
-
Notifications
You must be signed in to change notification settings - Fork 2
/
nf_pychopper
executable file
·96 lines (69 loc) · 3.94 KB
/
nf_pychopper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
params.outdir = "."
params.project_name = 'project__'
params.verbose = false
if (params.verbose){
println ("[WORKFLOW] PYCHOPPER: writing output to " + params.outdir)
}
params.help = false
// Show help message and exit
if (params.help){
helpMessage()
exit 0
}
barcode_folders = Channel.fromFilePairs(args)
include { PYCHOPPER } from './nf_modules/pychopper.mod.nf'
include { MERGE_BARCODES } from './nf_modules/merge_barcodes.mod.nf'
workflow {
main:
MERGE_BARCODES(barcode_folders, params.outdir)
PYCHOPPER (MERGE_BARCODES.out.merged_fastq, params.outdir, params.project_name)
}
workflow.onComplete {
def msg = """\
Pipeline execution summary
---------------------------
Completed at: ${workflow.complete}
Duration : ${workflow.duration}
Success : ${workflow.success}
workDir : ${workflow.workDir}
exit status : ${workflow.exitStatus}
"""
.stripIndent()
sendMail(to: "${workflow.userName}@babraham.ac.uk", subject: 'Minimal pipeline execution report', body: msg)
}
def helpMessage() {
log.info"""
>>
SYNOPSIS:
This workflow takes in a list of folders. They should be named barcodexx and each contain a set of FastQ files. The fastq files within a directory are merged, and the merged file is fed into pychopper (by default on the Babraham stone cluster).
Running this stand-alone workflow executes the cdna_classifier.py script from pychopper with default parameters. (i.e. `cdna_classifier.py -r report_#name_#projectname.pdf -u unclassified_#name_#projectname.fastq -w rescued_#name.fastq -S stats_#name_#projectname #reads full_length_barcode_#name.fastq`).
==============================================================================================================
USAGE:
nf_pychopper [options] <input files>
Mandatory arguments:
====================
<barcode folders> List of barcode folders each containing fastq files e.g. 'folder_demultiplexed/barcode*'
Other Options:
==============
--outdir [str] Path to the output directory. [Default: current working directory]
--project_name [str] Name of the project to append to some of the file names. [Default: 'project__']
--verbose More verbose status messages. [Default: OFF]
--help Displays this help message and exits.
Workflow Options:
=================
Please note the single '-' hyphen for the following options!
-resume If a pipeline workflow has been interrupted or stopped (e.g. by accidentally closing a laptop),
this option will attempt to resume the workflow at the point it got interrupted by using
Nextflow's caching mechanism. This may save a lot of time.
-bg Sends the entire workflow into the background, thus disconnecting it from the terminal session.
This option launches a daemon process (which will keep running on the headnode) that watches over
your workflow, and submits new jobs to the SLURM queue as required. Use this option for big pipeline
jobs, or whenever you do not want to watch the status progress yourself. Upon completion, the
pipeline will send you an email with the job details. This option is HIGHLY RECOMMENDED!
-process.executor=local Temporarily changes where the workflow is executed to the 'local' machine. See also Nextflow config
file for more details. [Default: slurm]
<<
""".stripIndent()
}