diff --git a/emgapi/management/commands/ebi_search_analysis_dump.py b/emgapi/management/commands/ebi_search_analysis_dump.py index 8514f98b1..cb49508f8 100644 --- a/emgapi/management/commands/ebi_search_analysis_dump.py +++ b/emgapi/management/commands/ebi_search_analysis_dump.py @@ -73,7 +73,8 @@ def get_analysis_context(self, analysis: AnalysisJob): logger.debug(f"Could not find IPS terms for {analysis.job_id}") ips_annotation = None - biome_list = analysis.study.biome.lineage.split(":")[1:] + biome_list = analysis.study.biome.lineage.split(":")[1:] or ['root'] + # to ensure there are no empty hierarchical fields taxonomy_lists = [] if analysis_taxonomy: diff --git a/emgapi/management/commands/ebi_search_study_dump.py b/emgapi/management/commands/ebi_search_study_dump.py index 1bee1aa08..888529262 100644 --- a/emgapi/management/commands/ebi_search_study_dump.py +++ b/emgapi/management/commands/ebi_search_study_dump.py @@ -54,7 +54,7 @@ def write_without_blank_lines(fp, string): @staticmethod def get_study_context(study: Study): - biome_list = study.biome.lineage.split(":")[1:] + biome_list = study.biome.lineage.split(":")[1:] or ['root'] return { "study": study,