Skip to content
Snippets Groups Projects

Release v2.1.0

Merged Loraine Gueguen requested to merge dev into master
3 files
+ 15
30
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 4
23
@@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-
import re
import bioblend
import argparse
import os
import logging
@@ -39,27 +38,6 @@ class LoadData(speciesData.SpeciesData):
self.bam_metadata_cache = {}
super().__init__(parameters_dictionary)
def get_history(self):
"""
Create or set the working history to the current species one
:return:
"""
try:
histories = self.instance.histories.get_histories(name=str(self.genus_species))
if len(histories) == 1:
self.history_id = histories[0]["id"]
logging.debug("History ID set for {0} {1}: {2}".format(self.genus, self.species, self.history_id))
else:
logging.critical("Multiple histories exists for {0}: {1}".format(self.genus, self.species))
except IndexError:
logging.info("Creating history for {0} {1}".format(self.genus, self.species))
hist_dict = self.instance.histories.create_history(name=str(self.genus_species))
self.history_id = hist_dict["id"]
logging.debug("History ID set for {0} {1}: {2}".format(self.genus, self.species, self.history_id))
return self.history_id
def remove_homo_sapiens_from_db(self):
"""
Run the GMOD tool to remove the "Homo sapiens" default organism from the original database
@@ -304,6 +282,7 @@ if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.INFO)
logging.getLogger("urllib3").setLevel(logging.INFO)
# Parsing the config file if provided, using the default config otherwise
if args.config:
@@ -360,7 +339,9 @@ if __name__ == "__main__":
logging.debug("Successfully set up library in galaxy for {0} {1}".format(load_data_for_current_species.genus, load_data_for_current_species.species))
# Set or get the history for the current organism
load_data_for_current_species.get_history()
load_data_for_current_species.history_id = utilities_bioblend.get_history(
instance=load_data_for_current_species.instance,
history_name=load_data_for_current_species.history_name)
# Remove H. sapiens from database if here
# TODO: set a dedicated history for removing H. sapiens (instead of doing it into a species history)
Loading