-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.nf
45 lines (32 loc) · 1.21 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
import nextflow.splitter.CsvSplitter
nextflow.enable.dsl=2
def fetchRunAccessions( tsv ) {
def splitter = new CsvSplitter().options( header:true, sep:'\t' )
def reader = new BufferedReader( new FileReader( tsv ) )
splitter.parseHeader( reader )
List<String> run_accessions = []
Map<String,String> row
while( row = splitter.fetchRecord( reader ) ) {
run_accessions.add( row['run_accession'] )
}
return run_accessions
}
//--------------------------------------------------------------------------
// Param Checking
//--------------------------------------------------------------------------
if(params.studyIdFile) {
accessions = fetchRunAccessions( params.studyIdFile )
}
else {
throw new Exception("Missing params.studyIdFile")
}
//--------------------------------------------------------------------------
// Includes
//--------------------------------------------------------------------------
include { markerGeneAnalysis } from './modules/markerGeneAnalysis.nf'
//--------------------------------------------------------------------------
// Main Workflow
//--------------------------------------------------------------------------
workflow {
markerGeneAnalysis(accessions)
}