Skip to content
Snippets Groups Projects

Sync in wf

Merged Loraine Gueguen requested to merge sync_in_wf into dev
1 file
+ 3
0
Compare changes
  • Side-by-side
  • Inline
+ 29
7
@@ -142,13 +142,35 @@ def get_sp_picture(sp_dict_list):
sp_picture_dict = {}
for sp in sp_dict_list:
gspecies = get_gspecies_string_from_sp_dict(sp)
if gspecies not in sp_picture_dict.keys() or ( constants.ORG_PARAM_DESC_MAIN_SPECIES in sp[constants.ORG_PARAM_DESC].keys() and
sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_MAIN_SPECIES] == True ):
sp_picture_dict[gspecies] = ""
if constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys() and \
sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != "":
sp_picture_dict[gspecies] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]
genus_species = get_gspecies_string_from_sp_dict(sp)
# logging.debug("picture path for {0} {1}: {2}".format(genus_species,
# sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_STRAIN],
# sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]))
# no picture stored yet for this genus_species
if genus_species not in sp_picture_dict.keys() \
or (genus_species in sp_picture_dict.keys()
and sp_picture_dict[genus_species] == None):
if constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys() \
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != None \
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != "":
sp_picture_dict[genus_species] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]
else:
sp_picture_dict[genus_species] = None
# overwrite stored picture if a picture exists for the main strain
if (constants.ORG_PARAM_DESC_MAIN_SPECIES in sp[constants.ORG_PARAM_DESC].keys()
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_MAIN_SPECIES] == True )\
and (constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys()
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != None
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != ""):
sp_picture_dict[genus_species] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]
# logging.debug("picture dict: %s" % sp_picture_dict)
return sp_picture_dict
def get_sp_jbrowse_links(org_list):
Loading