From 847942c568c003d79379132c25ed084c0ebea9f2 Mon Sep 17 00:00:00 2001 From: nsheff Date: Wed, 13 Sep 2023 07:51:44 -0400 Subject: [PATCH] update qdrant signature --- bbconf/bbconf.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/bbconf/bbconf.py b/bbconf/bbconf.py index 134a9bf..ff88007 100644 --- a/bbconf/bbconf.py +++ b/bbconf/bbconf.py @@ -444,21 +444,20 @@ def _create_t2bsi_object(self): def add_bed_to_qdrant( self, + bed_id: str, bed_file_path: str, - sample_id: str, - labels: dict = None, + payload: dict = None, ) -> None: """ Convert bed file to vector and add it to qdrant database + :param bed_id: bed file id :param bed_file_path: path to the bed file - :param bbconf: bbconf object - :param sample_id: bed file id - :param labels: additional bed file lables + :param payloads: additional metadata to store alongside vectors :return: None """ - _LOGGER.info(f"adding bed file to qdrant. Sample_id: {sample_id}") + _LOGGER.info(f"Adding bed file to qdrant. bed_id: {bed_id}") # Convert bedfile to vector bed_region_set = RegionSet(bed_file_path) reg_2_vec_obj = Region2VecExModel("databio/r2v-ChIP-atlas-hg38") @@ -470,9 +469,9 @@ def add_bed_to_qdrant( # Upload bed file vector to the database vec_dim = bed_embedding.shape[0] self.qdrant_backend.load( - id=sample_id, - embeddings=bed_embedding.reshape(1, vec_dim), - labels=[{"id": sample_id, **labels}], + ids=[bed_id], + vectors=bed_embedding.reshape(1, vec_dim), + payloads=[{**payload}], ) return None