From 778bdae7a734b3fedf86edbc565b65a162382208 Mon Sep 17 00:00:00 2001
From: Loraine Gueguen <loraine.gueguen@sb-roscoff.fr>
Date: Mon, 31 May 2021 13:05:50 +0200
Subject: [PATCH] fix missing method get_sp_jbrowse_links(org_list)

---
 utilities.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/utilities.py b/utilities.py
index 62da00a..1d88ad8 100755
--- a/utilities.py
+++ b/utilities.py
@@ -151,6 +151,23 @@ def get_sp_picture(sp_dict_list):
                 sp_picture_dict[gspecies] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]
     return sp_picture_dict
 
+def get_sp_jbrowse_links(org_list):
+    """
+    Get the jbrowse links from all strains for each species
+    """
+
+    jbrowse_links_dict = {}
+
+    for org in org_list:
+        gspecies = org.genus_species
+        if org.contig_prefix != "":
+            if gspecies not in jbrowse_links_dict.keys():
+                jbrowse_links_dict[gspecies] = org.contig_prefix + ">" + org.species_folder_name
+            else:
+                jbrowse_links_dict[gspecies] = jbrowse_links_dict[gspecies] + ";" + org.contig_prefix + ">" + org.species_folder_name
+
+    return jbrowse_links_dict
+
 def create_org_param_dict_from_constants():
     """
     Create a dictionary of variables containing the keys needed to render the organisms.yml.j2 (NOT the values)
-- 
GitLab