Skip to content

Commit c04cdb2

Browse files
committed
add a function to parse json file
1 parent 4f120f2 commit c04cdb2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

helper-functions/main.nf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ nextflow.enable.dsl = 2
2727
version = '1.0.2'
2828
/********************************************************************/
2929

30+
import groovy.json.JsonSlurper
31+
32+
def parseJsonFile(json_file){
33+
records = new JsonSlurper().parse(json_file)
34+
return records
35+
}
3036

3137
// this is kind of like CWL's secondary files
3238
def getSecondaryFiles(main_file, exts){
@@ -53,3 +59,5 @@ def getSecondaryFiles(main_file, exts){
5359
def getBwaSecondaryFiles(main_file){
5460
return getSecondaryFiles(main_file, ['fai', 'sa', 'bwt', 'ann', 'amb', 'pac', 'alt'])
5561
}
62+
63+

0 commit comments

Comments
 (0)