Пример #1
0
 def _update_path_to_data(self, d_list):
     if not isinstance(d_list, list):
         d_list = [d_list]
     for d in d_list:
         if not d.path_to_data or any([len(x) > 255 for x in d.path_to_data.split("/")]):
             logger.debug("Updating 'path_to_data' from '{}'...".format(d.path_to_data))
             d.path_to_data = elaspic_database.get_uniprot_base_path(d) + elaspic_database.get_uniprot_domain_path(d)
             logger.debug("to '{}'...".format(d.path_to_data))
             self.db.merge_row(d)
         os.makedirs(op.join(conf.CONFIGS["archive_temp_dir"], d.path_to_data), exist_ok=True)
Пример #2
0
 def _update_path_to_data(self, d_list):
     if not isinstance(d_list, list):
         d_list = [d_list]
     for d in d_list:
         if not d.path_to_data or any(
             [len(x) > 255 for x in d.path_to_data.split("/")]):
             logger.debug("Updating 'path_to_data' from '{}'...".format(
                 d.path_to_data))
             d.path_to_data = elaspic_database.get_uniprot_base_path(
                 d) + elaspic_database.get_uniprot_domain_path(d)
             logger.debug("to '{}'...".format(d.path_to_data))
             self.db.merge_row(d)
         os.makedirs(op.join(conf.CONFIGS["archive_temp_dir"],
                             d.path_to_data),
                     exist_ok=True)
Пример #3
0
    def __exit__(self, exc_type, exc_value, traceback):
        d = self.d

        if exc_type is not None:
            return False

        if self.provean_supset_file is None:
            provean = elaspic_database_tables.Provean()
            provean.uniprot_id = d.uniprot_id
            provean.provean_supset_filename = op.basename(self.sequence.provean_supset_file)
            provean.provean_supset_length = self.sequence.provean_supset_length
            self.db.merge_provean(
                provean,
                self.sequence.provean_supset_file,
                conf.CONFIGS["copy_data"] and elaspic_database.get_uniprot_base_path(d),
            )
Пример #4
0
    def __init__(self, d, db):
        self.d = d
        self.db = db

        self.sequence = None
        self.skip = False

        if d.uniprot_sequence and d.uniprot_sequence.provean and d.uniprot_sequence.provean.provean_supset_filename:
            # Provean supset has already been calculated
            self.provean_supset_file = op.join(
                conf.CONFIGS["archive_temp_dir"],
                elaspic_database.get_uniprot_base_path(d),
                d.uniprot_sequence.provean.provean_supset_filename,
            )
        else:
            self.provean_supset_file = None
Пример #5
0
    def __init__(self, d, db):
        self.d = d
        self.db = db

        self.sequence = None
        self.skip = False

        if (d.uniprot_sequence and d.uniprot_sequence.provean
                and d.uniprot_sequence.provean.provean_supset_filename):
            # Provean supset has already been calculated
            self.provean_supset_file = op.join(
                conf.CONFIGS["archive_temp_dir"],
                elaspic_database.get_uniprot_base_path(d),
                d.uniprot_sequence.provean.provean_supset_filename,
            )
        else:
            self.provean_supset_file = None
Пример #6
0
    def __exit__(self, exc_type, exc_value, traceback):
        d = self.d

        if exc_type is not None:
            return False

        if self.provean_supset_file is None:
            provean = elaspic_database_tables.Provean()
            provean.uniprot_id = d.uniprot_id
            provean.provean_supset_filename = op.basename(
                self.sequence.provean_supset_file)
            provean.provean_supset_length = self.sequence.provean_supset_length
            self.db.merge_provean(
                provean,
                self.sequence.provean_supset_file,
                conf.CONFIGS["copy_data"]
                and elaspic_database.get_uniprot_base_path(d),
            )