Skip to content

Commit 0b1873d

Browse files
committed
Accomodate different header fields
1 parent 333d6da commit 0b1873d

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

workflows/eqtl/eqtl.nf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ process merge_files {
6969
input:
7070
file file_list
7171
val analysis_type
72+
val fields
73+
val types
7274

7375
output:
7476
file "all.${analysis_type}.tsv"
@@ -77,7 +79,7 @@ process merge_files {
7779

7880
script:
7981
outfile = "all.${analysis_type}.tsv"
80-
mongo_hdr = GroovyCollections.transpose( params.cond_fields, params.cond_types)
82+
mongo_hdr = GroovyCollections.transpose( fields, types)
8183
.collect{arr -> arr.join(".") + "()"}
8284
.plus("tissue.string()")
8385
.join("\t")
@@ -93,23 +95,27 @@ process merge_files {
9395
}
9496

9597
workflow conditional_eqtl {
98+
analysis_type = "cond"
9699
cond_tsv = channel.fromPath("${params.cond_eqtl_glob}")
97100
cond_headers = channel.of(params.cond_fields).collect()
98-
analysis_type = "cond"
101+
fields = params.cond_fields
102+
types = params.cond_types
99103

100104
validate_header(cond_tsv, cond_headers)
101105
munge_files(cond_tsv, analysis_type)
102-
merge_files(munge_files.out.collect(), analysis_type)
106+
merge_files(munge_files.out.collect(), analysis_type, fields, types)
103107
}
104108

105109
workflow susie_eqtl {
110+
analysis_type = "susie"
106111
susie_tsv = channel.fromPath("${params.susie_eqtl_glob}")
107112
susie_headers = channel.of(params.susie_fields).collect()
108-
analysis_type = "susie"
113+
fields = params.susie_fields
114+
types = params.susie_types
109115

110116
validate_header(susie_tsv, susie_headers)
111117
munge_files(susie_tsv, analysis_type)
112-
merge_files(munge_files.out.collect(), analysis_type)
118+
merge_files(munge_files.out.collect(), analysis_type, fields, types)
113119
}
114120

115121
workflow {

0 commit comments

Comments
 (0)