Skip to content

Commit f502301

Browse files
committed
retrieve strand from metadata
1 parent 013f230 commit f502301

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

json-parser/main.nf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ process jsonParser {
6868
script:
6969
"""
7070
set -euxo pipefail
71-
VARIABLE1=`cat ${metadata_analysis} | jq -r 'if ([.read_groups[]?] | length) >0 then [.read_groups[] | .is_paired_end] | all | tostring else null end' | tr -d '\\n'`
72-
PAIRED=\${VARIABLE1:-'null'}
71+
VARIABLE1=`cat ${metadata_analysis} | jq -r 'if ([.read_groups[]?] | length) >0 then [.read_groups[] | .is_paired_end] | all | tostring else "NULL" end' | tr -d '\\n'`
72+
PAIRED=\${VARIABLE1:-'NULL'}
7373
VARIABLE2=`cat ${metadata_analysis} | jq -r '[.files[] | .info? | .analysis_tools[]?] | unique | join(",")' | tr -d '\\n'`
74-
ANALYSIS_TOOLS=\${VARIABLE2:-'null'}
75-
VARIABLE3=`cat ${metadata_analysis} | jq -r '.experiment | .library_strandedness?' | tr -d '\\n'`
76-
STRAND=\${VARIABLE3:-'null'}
74+
ANALYSIS_TOOLS=\${VARIABLE2:-'NULL'}
75+
VARIABLE3=`cat ${metadata_analysis} | jq -r 'if (.experiment | .library_strandedness?) then .experiment|.library_strandedness else "NULL" end' | tr -d '\\n'`
76+
STRAND=\${VARIABLE3:-'NULL'}
7777
STUDY_ID=`cat ${metadata_analysis} | jq -er '.studyId' | tr -d '\\n'`
7878
DONOR_ID=`cat ${metadata_analysis} | jq -er '.samples[0].donor.donorId' | tr -d '\\n'`
7979
EXP=`cat ${metadata_analysis} | jq -er '.experiment | .experimental_strategy? // .library_strategy' | tr -d '\\n'`

json-parser/tests/data

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../tests/data

tests/data/40054341-119d-492e-8543-41119dc92ea1.sequencing_experiment.4.analysis.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"library_strategy": "WGS",
5151
"sequencing_center": "EXT",
5252
"submitter_sequencing_experiment_id": "TEST_EXP",
53-
"library_strandedness": "Unstrained"
53+
"library_strandedness": ""
5454
},
5555
"read_groups": [
5656
{

0 commit comments

Comments
 (0)