Пример #1
0
 def check_hash(self):
     actual_db_hash = str(self.db.get_meta_value('contigs_db_hash'))
     if self.db_hash != actual_db_hash:
         raise AuxiliaryDataError(
             'The hash value inside Auxiliary Database "%s" does not match with Contigs Database hash "%s",\
                                   these files probaby belong to different projects.'
             % (actual_db_hash, self.db_hash))
Пример #2
0
    def get_all(self, split_names=None):
        if split_names and not isinstance(split_names, set):
            raise AuxiliaryDataError(
                "Split names for auxiliarydataops::get_all must be of type `set`.`"
            )
        else:
            split_names = self.get_all_known_split_names()

        return self.get_coverage_for_multiple_splits(split_names)
Пример #3
0
    def get(self, split_name):
        cursor = self.db._exec(
            '''SELECT sample_name, coverages FROM %s WHERE split_name = "%s"'''
            % (t.split_coverages_table_name, split_name))

        rows = cursor.fetchall()

        if len(rows) == 0:
            raise AuxiliaryDataError(
                'The auxiliary database at "%s" does not know anything about the split "%s"'
                % (self.db_path, split_name))

        split_coverage = {}
        for row in rows:
            sample_name, coverage_blob = row  # unpack sqlite row tuple

            split_coverage[
                sample_name] = utils.convert_binary_blob_to_numpy_array(
                    coverage_blob, dtype=COVERAGE_DTYPE)

        return split_coverage