Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a7a13ff
implementing gtars qc
khoroshevskyi Oct 16, 2025
e5864cd
update pkgs and files vite config
nleroy917 Oct 16, 2025
9b31bac
add loading sign
khoroshevskyi Oct 16, 2025
b82c8a9
more ui bedqc improvements
khoroshevskyi Oct 16, 2025
cf72721
added more statistics
khoroshevskyi Oct 20, 2025
ceece9d
Added url as input option
khoroshevskyi Oct 20, 2025
4f248ff
Bump vite from 6.3.6 to 6.4.1 in /ui
dependabot[bot] Oct 21, 2025
fe98130
Adding region distribution plot
khoroshevskyi Oct 24, 2025
5bdec96
added region distribution plot
khoroshevskyi Oct 24, 2025
2b4d568
small adjustment for region distribution plot
khoroshevskyi Oct 24, 2025
83001a0
small corrections for wasm plots
khoroshevskyi Oct 27, 2025
b1fbdd1
CSS tweaks to the chromosome distribution plot
nleroy917 Oct 27, 2025
044e34d
Updated Region Distribution plot, and wasm return values
khoroshevskyi Oct 27, 2025
8af4f88
More improvements in bed analyzer
khoroshevskyi Oct 27, 2025
8b3b072
Fixed 1 part: of #229
khoroshevskyi Oct 28, 2025
17056d0
swap rid for the map index
nleroy917 Oct 28, 2025
e0f9272
Merge remote-tracking branch 'refs/remotes/origin/gtars_wasm' into gt…
nleroy917 Oct 28, 2025
690c845
Added Analyze button to bed page + improvements in analytics page
khoroshevskyi Oct 31, 2025
58615a2
Merge remote-tracking branch 'origin/gtars_wasm' into gtars_wasm
khoroshevskyi Oct 31, 2025
be3a6e8
updated naming of the function in analyzer
khoroshevskyi Oct 31, 2025
2c19557
updated ui dependencies
khoroshevskyi Nov 4, 2025
343eef0
updated ui dependencies and fixed errors
khoroshevskyi Nov 4, 2025
e0540e6
Updated ui lock
khoroshevskyi Nov 4, 2025
8463203
added gtars init
khoroshevskyi Nov 4, 2025
a66aa7b
fixing wasm
khoroshevskyi Nov 4, 2025
3730ad5
Added umap endpoint
khoroshevskyi Nov 11, 2025
3d9367a
linting
khoroshevskyi Nov 11, 2025
23e00a4
fixed test query parameter for multiple endpoints
khoroshevskyi Nov 11, 2025
4faf3e6
Bump vega-interpreter from 2.0.0 to 2.2.1 in /ui
dependabot[bot] Nov 13, 2025
fa15ea2
Bump vega-expression, vega and vega-lite in /ui
dependabot[bot] Nov 13, 2025
fa46ab2
Merge pull request #234 from databio/dependabot/npm_and_yarn/ui/multi…
khoroshevskyi Nov 14, 2025
b6bbe9c
Merge pull request #233 from databio/dependabot/npm_and_yarn/ui/vega-…
khoroshevskyi Nov 14, 2025
58448c5
Merge pull request #228 from databio/dependabot/npm_and_yarn/ui/vite-…
khoroshevskyi Nov 14, 2025
f276a7a
Merge remote-tracking branch 'origin/dev' into gtars_wasm
khoroshevskyi Nov 14, 2025
3b1c57e
fixed test query parameter for multiple endpoints
khoroshevskyi Nov 14, 2025
f8dbe74
Added umap visualizer
khoroshevskyi Nov 25, 2025
dd3e6b2
multiple ui improvements
khoroshevskyi Nov 25, 2025
53ab00b
Improvements of home page
khoroshevskyi Nov 25, 2025
99baebe
Added motion for better visualization
khoroshevskyi Nov 25, 2025
1e7ddf5
Added links to the home page icons
khoroshevskyi Nov 25, 2025
fc5f6ba
fixed search errors
khoroshevskyi Nov 25, 2025
d56d03f
Updated analyze page
khoroshevskyi Nov 25, 2025
73b8477
few font improvements
khoroshevskyi Nov 25, 2025
46f4f9d
polished animation
khoroshevskyi Nov 26, 2025
bc425a1
updated version and configs
khoroshevskyi Dec 1, 2025
310c0dc
updated yaml
khoroshevskyi Dec 1, 2025
d365cfe
updated package libraries
khoroshevskyi Dec 1, 2025
37b786b
Small search changes
khoroshevskyi Dec 1, 2025
b6c2ffc
Merge remote-tracking branch 'origin/embeddings' into embeddings
khoroshevskyi Dec 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bedhost/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.6"
__version__ = "0.12.0"
14 changes: 13 additions & 1 deletion bedhost/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from bbconf.bbagent import BedBaseAgent
from bbconf.models.base_models import UsageModel
from starlette.responses import FileResponse, JSONResponse, RedirectResponse
from fastapi import Query

from . import _LOGGER
from .exceptions import BedHostException
Expand Down Expand Up @@ -80,6 +81,13 @@ def drs_response(status_code, msg):
return JSONResponse(status_code=status_code, content=content)


test_query_parameter = Query(
False,
description="Internal parameter for testing purposes. If true, the request will not be counted.",
include_in_schema=False,
)


def count_requests(
usage_data: UsageModel,
event: Literal["bed_search", "bedset_search", "bed_meta", "bedset_meta", "files"],
Expand All @@ -96,7 +104,11 @@ def decorator(func):
async def wrapper(*args, **kwargs):

function_result = await func(*args, **kwargs)

if "test_request" in kwargs and kwargs["test_request"]:
_LOGGER.info(
f"Test request was executed. For '{event}' event with: {args}, {kwargs}. No results saved."
)
return function_result
if event == "files":
file_path = kwargs.get("file_path")
if "bed" in file_path or "bigbed" in file_path.lower():
Expand Down
6 changes: 4 additions & 2 deletions bedhost/routers/base_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Type,
)
from ..dependencies import fetch_detailed_stats
from ..helpers import get_openapi_version, count_requests
from ..helpers import get_openapi_version, count_requests, test_query_parameter
from ..main import app, bbagent, usage_data

router = APIRouter(prefix="/v1", tags=["base"])
Expand Down Expand Up @@ -144,6 +144,8 @@ async def service_info():

@router.get("/files/{file_path:path}")
@count_requests(usage_data, event="files")
async def redirect_to_download(file_path: str, request: Request):
async def redirect_to_download(
file_path: str, request: Request, test_request: bool = test_query_parameter
):
download_url = f"https://data2.bedbase.org/{file_path}"
return RedirectResponse(url=download_url)
30 changes: 29 additions & 1 deletion bedhost/routers/bed_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from ..const import EXAMPLE_BED, MAX_FILE_SIZE, MAX_REGION_NUMBER, MIN_REGION_WIDTH
from ..data_models import CROM_NUMBERS, BaseListResponse, BedDigest
from ..main import bbagent, usage_data
from ..helpers import count_requests
from ..helpers import count_requests, test_query_parameter

router = APIRouter(prefix="/v1/bed", tags=["bed"])

Expand Down Expand Up @@ -95,6 +95,7 @@ async def get_bed_metadata(
full: Optional[bool] = Query(
False, description="Return full record with stats, plots, files and metadata"
),
test_request: bool = test_query_parameter,
):
"""
Returns metadata for a single BED record. if full=True, returns full record with stats, plots, files and metadata.
Expand Down Expand Up @@ -261,6 +262,32 @@ async def embed_bed_file(
return embedding.tolist()[0]


@router.post(
"/umap",
summary="Get embeddings for a bed file.",
response_model=List[float],
)
async def embed_bed_file(
file: UploadFile = File(None),
):
"""
Create embedding for bed file
"""
_LOGGER.info("Embedding file..")

if file is not None:
with tempfile.TemporaryDirectory() as dirpath:
file_path = os.path.join(dirpath, file.filename)

with open(file_path, "wb") as bed_file:
shutil.copyfileobj(file.file, bed_file)

region_set = RegionSet(file_path)

embedding = bbagent.bed._get_umap_file(region_set)
return embedding.tolist()[0]


@router.get(
"/missing_plots",
summary="Get missing plots for a bed file.",
Expand Down Expand Up @@ -361,6 +388,7 @@ async def text_to_bed_search(
assay: Optional[Union[str, None]] = None,
limit: int = 10,
offset: int = 0,
test_request: bool = test_query_parameter,
):
"""
Search for a BedFile by a text query.
Expand Down
4 changes: 3 additions & 1 deletion bedhost/routers/bedset_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ..main import bbagent, usage_data
from ..data_models import CreateBEDsetRequest
from ..utils import zip_pep
from ..helpers import count_requests
from ..helpers import count_requests, test_query_parameter

router = APIRouter(prefix="/v1/bedset", tags=["bedset"])

Expand Down Expand Up @@ -46,6 +46,7 @@ async def list_bedsets(
query: str = None,
limit: int = 1000,
offset: int = 0,
test_request: bool = test_query_parameter,
):
"""
Returns a list of BEDset records in the database with optional filters and search.
Expand All @@ -64,6 +65,7 @@ async def list_bedsets(
async def get_bedset_metadata(
bedset_id: str,
full: bool = True,
test_request: bool = test_query_parameter,
):
# TODO: fix error with not found
try:
Expand Down
1 change: 1 addition & 0 deletions deployment/config/api-dev.bedbase.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ path:
# region2vec: databio/r2v-pretrained-for-search
region2vec: databio/r2v-encode-hg38
vec2vec: 'databio/v2v-sentencetransformers-encode'
umap_model: "https://huggingface.co/databio/bedbase-umap/resolve/main/hg38_umap_umap_model.joblib"
database:
host: $POSTGRES_HOST
port: 5432
Expand Down
1 change: 1 addition & 0 deletions deployment/config/api.bedbase.org.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ path:
# region2vec: databio/r2v-pretrained-for-search
region2vec: databio/r2v-encode-hg38
vec2vec: "databio/v2v-sentencetransformers-encode"
umap_model: "https://huggingface.co/databio/bedbase-umap/resolve/main/hg38_umap_umap_model.joblib"
database:
host: $POSTGRES_HOST
port: 5432
Expand Down
4 changes: 2 additions & 2 deletions requirements/requirements-all.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# bbconf @ git+https://github.com/databio/bbconf.git@comp_search#egg=bbconf
bbconf>=0.12.0
# bbconf @ git+https://github.com/databio/bbconf.git@umap#egg=bbconf
bbconf>=0.13.0
fastapi>=0.103.0
logmuse>=0.2.7
markdown
Expand Down
Loading