def __init__(self): self.project_config = config_mongo.get_project_config() self.logger = Logger.get_logger() self.output_files_dir = '%s/output_files' % self.project_config['output_dir'] if 'output_files_dir' not in self.project_config or not os.path.isdir(self.project_config['output_files_dir']): bash.make_dir(self.output_files_dir) config_mongo.change_config_field('output_files_dir', self.output_files_dir) else: self.output_files_dir = self.project_config['output_files_dir']
def __init__(self): """ This init method is different in that it will create the annotation_dir config parameter if it doesn't already exist. This is not necessarily the most elegant way to do this, but it works. :return: """ self.project_config = config_mongo.get_project_config() self.logger = Logger.get_logger() # Creates the annotation_dir if needed and loads it into the config file self.annotations_dir = '%s/annotations' % self.project_config['output_dir'] if 'annotation_dir' not in self.project_config or not\ os.path.isdir(self.project_config['annotation_dir']): bash.make_dir(self.annotations_dir) config_mongo.change_config_field('annotation_dir', self.annotations_dir) else: self.annotations_dir = self.project_config['annotation_dir']
def main(self, args): """ This is the main function that runs Variant manager according to the arguments that were passed in by the user. :param args: These are the args as parsed by the parser at the bottom of this script. :return: None """ # This sets the project name for several different modules to use. self.args = args varman2.set_project_name(args['project_name']) # Checks the arguments given to make sure that they can be processed correctly. self.__argcheck(args) # Setting up the project config file self.__setup_project_analysis(self.args) self.project_config = config_mongo.get_project_config() # SETTING UP LOGGING Logger.create_logger(self.project_config['log_file'], 'a') self.logger = Logger.get_logger() # This executes the correct argument specified by the user argexecute = ArgExecutor(self.args) if self.args['which'] == 'add': argexecute.add() elif self.args['which'] == 'delete': argexecute.delete() elif self.args['which'] == 'load': argexecute.load_variants() elif self.args['which'] == 'hotspot': argexecute.hotspot() elif self.args['which'] == 'stats': argexecute.stats() elif self.args['which'] == 'output': argexecute.output() elif self.args['which'] == 'nothing': argexecute.nothing()
def __init__(self): self.project_config = config_mongo.get_project_config() self.logger = Logger.get_logger()
def __init__(self, var_type): self.project_config = config_mongo.get_project_config() self.logger = Logger.get_logger() self.variant_type = var_type self.affected_dict = sampleinfo_mongo.get_affected_dict()