-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nf
executable file
·102 lines (94 loc) · 2.65 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* Copyright (c) 2023
*/
/*
* '' - A Nextflow pipeline for mapping markers to any reference genome
*
* This pipeline includes steps for mapping markers to any reference genome based on the
* flanking sequences around that marker
*
*
*/
/*
* Enable DSL 2 syntax
*/
nextflow.enable.dsl = 2
log.info """\
Parameters used in brioche for $params.genomename
=======================================================================================================================
$params.loginfo
=======================================================================================================================
"""
/*
* Import modules
*/
include {
BUILD_TARGET;
BUILD_BLASTDb;
RUN_BLAST;
PROCESS_BLAST_RESULTS;
ADD_MARKERINFO;
MERGE_MAPPINGS;
MERGE_MIN_MAPPINGS;
SPLIT_REFGENOME;
} from './modules.nf'
/*
* main pipeline logic
*/
workflow {
// Part 1: Build blast DB
SPLIT_REFGENOME(
params.genomefasta,
params.resultsdirectory,
params.chromstoexclude,
params.buildblastdbonly
)
BUILD_BLASTDb(
SPLIT_REFGENOME.out.flatten(),
params.genomefasta
)
if(!params.buildblastdbonly)
{
BUILD_TARGET(params.targetdesign)
probefasta=BUILD_TARGET.out.map{it->it[1]}
targettable=BUILD_TARGET.out.map{it->it[0]}
//Part 2: Run blast on probe fasta
RUN_BLAST(
probefasta,
BUILD_BLASTDb.out,
params.blastoutformat
)
//Part 2: Process the output from blast
PROCESS_BLAST_RESULTS(
RUN_BLAST.out.flatten(),
targettable,
params.minlength,
params.extendablebps,
params.genomefasta,
params.blastoutformat,
params.istarget3primeend,
params.markercharacter)
// PART 3: Process to filter markers
ADD_MARKERINFO(
PROCESS_BLAST_RESULTS.out,
params.probename,
params.genomename,
params.keepduplicates,
params.coverage,
params.pident)
ADD_MARKERINFO.out.map{it->it[0]}.collect().set{allmappings}
ADD_MARKERINFO.out.map{it->it[1]}.collect().set{minmappings}
MERGE_MAPPINGS(
allmappings,
params.resultsdirectory,
params.probename,
params.genomename
)
MERGE_MIN_MAPPINGS(
minmappings,
params.resultsdirectory,
params.probename,
params.genomename
)
}
}