Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion bbconf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import logging
from importlib.metadata import version

import coloredlogs

from bbconf.bbagent import BedBaseAgent

from .const import PKG_NAME

__all__ = ["BedBaseAgent"]
__version__ = version(__package__)

__all__ = ["BedBaseAgent", "__version__"]

_LOGGER = logging.getLogger(PKG_NAME)
coloredlogs.install(
Expand Down
75 changes: 38 additions & 37 deletions bbconf/models/bed_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,28 @@ class BedStatsModel(BaseModel):


class BedPEPHub(BaseModel):
sample_name: str = ""
genome: str = ""
organism: str = ""
species_id: str = ""
cell_type: str = ""
cell_line: str = ""
assay: str = Field("", description="Experimental protocol (e.g. ChIP-seq)")
library_source: str = Field(
sample_name: str | None = ""
genome: str | None = ""
organism: str | None = ""
species_id: str | None = ""
cell_type: str | None = ""
cell_line: str | None = ""
assay: str | None = Field("", description="Experimental protocol (e.g. ChIP-seq)")
library_source: str | None = Field(
"", description="Library source (e.g. genomic, transcriptomic)"
)
genotype: str = Field("", description="Genotype of the sample")
target: str = Field("", description="Target of the assay (e.g. H3K4me3)")
antibody: str = Field("", description="Antibody used in the assay")
treatment: str = Field(
genotype: str | None = Field("", description="Genotype of the sample")
target: str | None = Field("", description="Target of the assay (e.g. H3K4me3)")
antibody: str | None = Field("", description="Antibody used in the assay")
treatment: str | None = Field(
"", description="Treatment of the sample (e.g. drug treatment)"
)
tissue: str = Field("", description="Tissue type")
global_sample_id: str = Field("", description="Global sample identifier")
global_experiment_id: str = Field("", description="Global experiment identifier")
description: str = Field("", description="Description of the sample")
tissue: str | None = Field("", description="Tissue type")
global_sample_id: str | None = Field("", description="Global sample identifier")
global_experiment_id: str | None = Field(
"", description="Global experiment identifier"
)
description: str | None = Field("", description="Description of the sample")

model_config = ConfigDict(extra="allow", populate_by_name=True)

Expand All @@ -107,35 +109,34 @@ class StandardMeta(BaseModel):
Standardized Bed file metadata
"""

species_name: str = Field(
default="", description="Name of species. e.g. Homo sapiens.", alias="organism"
species_name: str | None = Field(
default="",
description="Name of species. e.g. Homo sapiens.",
alias="organism",
)
species_id: str = ""
genotype: str = Field("", description="Genotype of the sample")
phenotype: str = Field("", description="Phenotype of the sample")
species_id: str | None = ""
genotype: str | None = Field("", description="Genotype of the sample")
phenotype: str | None = Field("", description="Phenotype of the sample")
description: str | None = ""

cell_type: str = Field(
"",
cell_type: str | None = Field(
None,
description="specific kind of cell with distinct characteristics found in an organism. e.g. Neurons, Hepatocytes, Adipocytes",
)
cell_line: str = Field(
"",
cell_line: str | None = Field(
None,
description="population of cells derived from a single cell and cultured in the lab for extended use, e.g. HeLa, HepG2, k562",
)
tissue: str = Field("", description="Tissue type")
tissue: str | None = Field(None, description="Tissue type")

library_source: str = Field(
"", description="Library source (e.g. genomic, transcriptomic)"
library_source: str | None = Field(
None, description="Library source (e.g. genomic, transcriptomic)"
)
assay: str = Field(
"",
description="Experimental protocol (e.g. ChIP-seq)",
)
antibody: str = Field("", description="Antibody used in the assay")
target: str = Field("", description="Target of the assay (e.g. H3K4me3)")
treatment: str = Field(
"", description="Treatment of the sample (e.g. drug treatment)"
assay: str | None = Field(None, description="Experimental protocol (e.g. ChIP-seq)")
antibody: str | None = Field(None, description="Antibody used in the assay")
target: str | None = Field(None, description="Target of the assay (e.g. H3K4me3)")
treatment: str | None = Field(
None, description="Treatment of the sample (e.g. drug treatment)"
)

global_sample_id: list[str] | None = Field(
Expand All @@ -145,7 +146,7 @@ class StandardMeta(BaseModel):
None, description="Global experiment identifier. e.g. GSE000"
) # excluded in training

original_file_name: str = Field("", description="Original file name")
original_file_name: str | None = Field(None, description="Original file name")

model_config = ConfigDict(
populate_by_name=True,
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

### [0.14.10] - 2026-04-05
### Fixed:
- version info bug

### [0.14.9] - 2026-02-26
### Changed:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "bbconf"
version = "0.14.9"
version = "0.14.10"
description = "Configuration and data management tool for BEDbase"
readme = "README.md"
license = "BSD-2-Clause"
Expand Down Expand Up @@ -32,7 +32,7 @@ dependencies = [
"zarr < 3.0.0",
"pyyaml >= 6.0.1",
"s3fs >= 2024.3.1",
"pandas < 3.0.0",
"pandas>2.0.0, < 3.0.0",
"pybiocfilecache == 0.6.1",
"umap-learn >= 0.5.8",
"qdrant_client >= 1.16.1",
Expand Down
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ def example_dict():
"promoterprox_frequency": 16,
"promoterprox_percentage": 17,
},
metadata={"sample_name": "sample_name_1"},
metadata={
"sample_name": "sample_name_1",
"species_name": "species_name",
"species_id": "123",
},
plots=plots,
files=files,
classification=classification,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bedfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def test_bed_update(self, bbagent_obj):
with ContextManagerDBTesting(config=bbagent_obj.config, add_data=True):
bed_file = bbagent_obj.bed.get(BED_TEST_ID, full=True)
# assert bed_file.annotation.model_dump(exclude_defaults=True) == {}
assert bed_file.annotation.cell_line == ""
assert bed_file.annotation.cell_line is None

new_metadata = {
"cell_line": "K562",
Expand Down