Skip to content
Snippets Groups Projects
Commit c7175f83 authored by Loraine Gueguen's avatar Loraine Gueguen
Browse files

Keep species with best assembly in get_uniq_species_dict_list() (will be main jbrowse url).

parent 050ba27e
No related branches found
No related tags found
2 merge requests!9Release 2.0 (merge dev to master),!6Todo release 1.1
...@@ -393,6 +393,7 @@ if __name__ == "__main__": ...@@ -393,6 +393,7 @@ if __name__ == "__main__":
# Starting # Starting
logging.info("gga_init.py called for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species) logging.info("gga_init.py called for %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species)
logging.debug("Jbrowse url to %s %s %s %s", deploy_stack_for_current_organism.genus, deploy_stack_for_current_organism.species, deploy_stack_for_current_organism.sex, deploy_stack_for_current_organism.strain)
# Make/update directory tree # Make/update directory tree
deploy_stack_for_current_organism.make_directory_tree() deploy_stack_for_current_organism.make_directory_tree()
......
...@@ -123,6 +123,16 @@ def get_species_history_id(instance, full_name): ...@@ -123,6 +123,16 @@ def get_species_history_id(instance, full_name):
return [history_id, show_history] return [history_id, show_history]
def get_gspecies_string_from_sp_dict(sp_dict):
gspecies = ""
for k, v in sp_dict.items():
for k2, v2 in v.items():
if k2 == "genus":
gspecies = gspecies.lower() + v2
elif k2 == "species":
gspecies = gspecies.lower() + "_" + v2
return gspecies
def get_unique_species_str_list(sp_dict_list): def get_unique_species_str_list(sp_dict_list):
""" """
...@@ -165,7 +175,7 @@ def get_unique_species_dict_list(sp_dict_list): ...@@ -165,7 +175,7 @@ def get_unique_species_dict_list(sp_dict_list):
unique_species_genus_species = get_unique_species_str_list(sp_dict_list=sp_dict_list) unique_species_genus_species = get_unique_species_str_list(sp_dict_list=sp_dict_list)
for sp in sp_dict_list: for sp in sp_dict_list:
for gspecies in unique_species_genus_species: gspecies = get_gspecies_string_from_sp_dict(sp)
if gspecies not in unique_species_dict.keys() or sp["description"]["main_species"] == "yes" : if gspecies not in unique_species_dict.keys() or sp["description"]["main_species"] == "yes" :
unique_species_dict[gspecies] = sp unique_species_dict[gspecies] = sp
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment