summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Code/parse_ena_xml.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Code/parse_ena_xml.py b/Code/parse_ena_xml.py
index c22ec2a..1e5a514 100644
--- a/Code/parse_ena_xml.py
+++ b/Code/parse_ena_xml.py
@@ -315,15 +315,17 @@ if __name__ == '__main__':
for k in sorted(d_run_keys):
d = {}
k2 = d_run[k]['experiment_id']
- k3 = d_experiment[k2]['sample_id'] if k2 in d_experiment else 'SAM_UNKNOWN'
- k4 = d_experiment[k2]['study_id'] if k2 in d_experiment else 'PRJ_UNKNOWN'
- d['tissue'] = d['library_strategy'] = d['library_source'] = d['sample_id'] = ''
+ d['experiment_id'] = k2
+ d['tissue'] = ''
+ d['sample_id'] = d['study_id'] = d['library_strategy'] = d['library_source'] = d['detail'] = ''
if k2 in d_experiment:
- d['sample_id'] = d_experiment[k2]['sample_id']
+ k3 = d_experiment[k2]['sample_id']
+ k4 = d_experiment[k2]['study_id']
+ d['sample_id'] = k3
+ d['study_id'] = k4
d['tissue'] = get_tissue(k, d_run, k2, d_experiment, k3, d_sample, k4, d_study)
d['library_strategy'] = d_experiment[k2]['library_strategy']
d['library_source'] = d_experiment[k2]['library_source']
- d['detail'] = 'TBA'
json_dict[k] = d
if d['library_source'] == 'TRANSCRIPTOMIC':
count_transcriptomic += 1