From 4527edad7f1ff753210167d28766cd8a2af57c0d Mon Sep 17 00:00:00 2001 From: Khoroshevskyi Date: Thu, 16 Jan 2025 12:27:59 -0500 Subject: [PATCH] Fixed #76 --- bbconf/modules/bedfiles.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bbconf/modules/bedfiles.py b/bbconf/modules/bedfiles.py index 17da1ef..54d9abc 100644 --- a/bbconf/modules/bedfiles.py +++ b/bbconf/modules/bedfiles.py @@ -674,8 +674,6 @@ def update( """ Update bed file to the database. - !! WARNING: this method is in development. Please, void of using it! - :param identifier: bed file identifier :param stats: bed file results {statistics, plots, files, metadata} :param metadata: bed file metadata (will be saved in pephub) @@ -725,9 +723,18 @@ def update( _LOGGER.info("upload_pephub set to false. Skipping pephub..") if upload_qdrant: - self.upload_file_qdrant( - identifier, files.bed_file.path, payload=metadata.model_dump() - ) + if classification.genome_alias == "hg38": + _LOGGER.info(f"Uploading bed file to qdrant.. [{identifier}]") + self.upload_file_qdrant( + identifier, + files.bed_file.path, + bed_metadata.model_dump(exclude_none=False), + ) + _LOGGER.info(f"File uploaded to qdrant. {identifier}") + else: + _LOGGER.warning( + f"Could not upload to qdrant. Genome: {classification.genome_alias} is not supported." + ) with Session(self._sa_engine) as session: bed_statement = select(Bed).where(and_(Bed.id == identifier))