Skip to content

Commit 0af9a0b

Browse files
committed
add support to pass on info field
1 parent b0971f4 commit 0af9a0b

5 files changed

Lines changed: 18 additions & 2 deletions

payload-gen-dna-alignment/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def main(args):
135135
'name': 'sequencing_alignment'
136136
},
137137
'studyId': seq_experiment_analysis_dict.get('studyId'),
138+
'info': {},
138139
'workflow': {
139140
'workflow_name': workflow_full_name.get(args.wf_name, args.wf_name),
140141
'workflow_version': args.wf_version,
@@ -155,6 +156,12 @@ def main(args):
155156
'read_groups': seq_experiment_analysis_dict.get('read_groups')
156157
}
157158

159+
# pass `info` dict from seq_experiment payload to new payload
160+
if 'info' in seq_experiment_analysis_dict and isinstance(seq_experiment_analysis_dict['info'], dict):
161+
payload['info'] = seq_experiment_analysis_dict['info']
162+
else:
163+
payload.pop('info')
164+
158165
payload['experiment'].update(seq_experiment_analysis_dict.get('experiment', {}))
159166

160167
if 'library_strategy' in payload['experiment']:

payload-gen-dna-alignment/tests/checker.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ process file_smart_diff {
7474
cat ${output_file} \
7575
| sed -e 's/"run_id": ".*"/"run_id": "run_id"/' \
7676
| sed -e 's/"session_id": ".*"/"session_id": "session_id"/' \
77-
| sed -e 's/"fileName": ".*.DO.*.SA.*.*"/"fileName": "_study_.DO_id_.SA_id_._normalized_file_name_"/' \
77+
| sed -e 's/"fileName": ".*"/"fileName": "_normalized_file_name_"/' \
7878
> normalized_output
7979
8080
([[ '${expected_file}' == *.gz ]] && gunzip -c ${expected_file} || cat ${expected_file}) \
8181
| sed -e 's/"run_id": ".*"/"run_id": "run_id"/' \
8282
| sed -e 's/"session_id": ".*"/"session_id": "session_id"/' \
83-
| sed -e 's/"fileName": ".*.DO.*.SA.*.*"/"fileName": "_study_.DO_id_.SA_id_._normalized_file_name_"/' \
83+
| sed -e 's/"fileName": ".*"/"fileName": "_normalized_file_name_"/' \
8484
> normalized_expected
8585
8686
diff normalized_output normalized_expected \

tests/data/0ae2c59b-2976-485c-a2c5-9b2976085cbf.fq.sequencing_experiment.song-analysis.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"analysisId": "0ae2c59b-2976-485c-a2c5-9b2976085cbf",
33
"studyId": "TEST-PRO",
4+
"info": {
5+
"anything": "any value"
6+
},
47
"analysisState": "PUBLISHED",
58
"samples": [
69
{

tests/data/dc934840-98a2-4471-8655-deaaad226180.dna_alignment.payload.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"name": "sequencing_alignment"
44
},
55
"studyId": "TEST-PRO",
6+
"info": {
7+
"anything": "any value"
8+
},
69
"workflow": {
710
"workflow_name": "DNA Seq Alignment",
811
"workflow_version": "0.4.0",

tests/data/ebf6a3ab-05d5-4a19-bc36-5fd4abac58ff.dna_alignment.payload.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"name": "sequencing_alignment"
44
},
55
"studyId": "TEST-PRO",
6+
"info": {
7+
"anything": "any value"
8+
},
69
"workflow": {
710
"workflow_name": "DNA Seq Alignment",
811
"workflow_version": "0.4.0",

0 commit comments

Comments
 (0)