-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
71 lines (61 loc) · 2.29 KB
/
main.nf
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
/*
* enables modules
*/
nextflow.enable.dsl = 2
/*
* Default pipeline parameters. They can be overriden on the command line eg.
* given `params.foo` specify on the run command line `--foo some_value`.
*/
params.outdir = "results"
log.info """\
SINGLE CELL RNA-SEQ SIMULATION - N F P I P E L I N E
===================================
transcript counts: ${params.trx_cnt}
transcript annotation: ${params.annotation}
number of transcripts to sample: ${params.n_trx}
outdir : ${params.outdir}
inclusion prob: ${params.prob}
"""
// import modules
include { SAMPLER } from './modules/transcript_sampler'
include { STRUCTURE } from './modules/structure_generator'
include { EXTRACT } from './modules/sequence_extractor'
include { PRIME } from './modules/priming_site_predictor'
include { CDNA } from './modules/cdna_generator'
include { FRAGMENT } from './modules/fragment_selector'
include { SEQUENCER } from './modules/read_sequencer'
// Define inputs
trx_cnt_ch = Channel.fromPath( params.trx_cnt )
annotation_ch = Channel.fromPath( params.annotation )
n_trx_ch = Channel.value( params.n_trx )
polyA_len_ch = Channel.value( params.polyA_len )
genome_ch = Channel.fromPath( params.genome )
primerSeq_ch = Channel.fromPath( params.primerSeq )
frag_mean = Channel.value( params.frag_mean )
frag_sd = Channel.value( params.frag_sd )
read_length = Channel.value( params.read_length )
/*
* main script flow
*/
workflow {
SAMPLER( trx_cnt_ch, annotation_ch, n_trx_ch )
STRUCTURE( params.prob, SAMPLER.out.csv, SAMPLER.out.gtf)
sampled_gtf_ch = STRUCTURE.out.gtf
sampled_transcript_counts_csv = STRUCTURE.out.csv
EXTRACT( sampled_gtf_ch, polyA_len_ch, genome_ch )
extracted_seqs_ch = EXTRACT.out.polya_fasta_ch
PRIME( extracted_seqs_ch , primerSeq_ch )
priming_sites_gtf = PRIME.out.priming_sites
CDNA( extracted_seqs_ch, priming_sites_gtf, sampled_transcript_counts_csv )
cdna_seq = CDNA.out.fa
cdna_counts = CDNA.out.csv
FRAGMENT( cdna_seq, cdna_counts, frag_mean, frag_sd )
terminal_fragments = FRAGMENT.out.fa
SEQUENCER( terminal_fragments, read_length)
}
/*
* completion handler
*/
workflow.onComplete {
log.info ( workflow.success ? "\nDone! Open the following report in your browser --> $params.outdir/report.html\n" : "Oops .. something went wrong" )
}