diff --git a/bedboss/_version.py b/bedboss/_version.py index d3ec452..3ced358 100644 --- a/bedboss/_version.py +++ b/bedboss/_version.py @@ -1 +1 @@ -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/bedboss/bedboss.py b/bedboss/bedboss.py index 0d932f6..193ed2f 100644 --- a/bedboss/bedboss.py +++ b/bedboss/bedboss.py @@ -13,7 +13,6 @@ from bbconf.bbagent import BedBaseAgent from bbconf.models.base_models import FileModel - from bedboss.bedstat.bedstat import bedstat from bedboss.bedmaker.bedmaker import make_all from bedboss.bedbuncher import run_bedbuncher @@ -231,6 +230,7 @@ def insert_pep( :param str output_folder: output statistics folder :param Union[str, peppy.Project] pep: path to the pep file or pephub registry path :param str bedset_id: bedset identifier + :param str bedset_name: bedset name :param str rfg_config: path to the genome config file (refgenie) :param bool create_bedset: whether to create bedset :param bool upload_qdrant: whether to upload bedfiles to qdrant @@ -263,6 +263,7 @@ def insert_pep( validate_project(pep, BEDBOSS_PEP_SCHEMA_PATH) for i, pep_sample in enumerate(pep.samples): + m.print_success(f"Processing sample {i + 1}/{len(pep.samples)}") _LOGGER.info(f"Running bedboss pipeline for {pep_sample.sample_name}") if pep_sample.get("file_type"): if pep_sample.get("file_type").lower() == "narrowpeak": @@ -276,6 +277,7 @@ def insert_pep( input_file=pep_sample.input_file, input_type=pep_sample.input_type, genome=pep_sample.genome, + name=pep_sample.sample_name, bedbase_config=bbagent, narrowpeak=is_narrow_peak, chrom_sizes=pep_sample.get("chrom_sizes"), @@ -310,6 +312,7 @@ def insert_pep( upload_pephub=upload_pephub, upload_s3=upload_s3, no_fail=no_fail, + force_overwrite=force_overwrite, ) else: _LOGGER.info( diff --git a/bedboss/bedbuncher/bedbuncher.py b/bedboss/bedbuncher/bedbuncher.py index d791cb1..bcd5fcc 100644 --- a/bedboss/bedbuncher/bedbuncher.py +++ b/bedboss/bedbuncher/bedbuncher.py @@ -161,6 +161,7 @@ def run_bedbuncher( plots=plots.model_dump(exclude_none=True, exclude_unset=True), local_path=output_folder, no_fail=no_fail, + overwrite=force_overwrite, ) diff --git a/bedboss/bedmaker/bedmaker.py b/bedboss/bedmaker/bedmaker.py index e5117b9..5f33d05 100755 --- a/bedboss/bedmaker/bedmaker.py +++ b/bedboss/bedmaker/bedmaker.py @@ -70,13 +70,14 @@ def make_bigbed( pm_clean = False _LOGGER.info(f"Generating bigBed files for: {bed_path}") - if not os.path.exists(output_path): - os.makedirs(output_path) + bigbed_output_folder = os.path.join(output_path, BIGBED_FILE_NAME) + if not os.path.exists(bigbed_output_folder): + os.makedirs(bigbed_output_folder) bedfile_name = os.path.split(bed_path)[1] fileid = os.path.splitext(os.path.splitext(bedfile_name)[0])[0] # Produce bigBed (big_narrow_peak) file from peak file - big_bed_path = os.path.join(output_path, BIGBED_FILE_NAME, fileid + ".bigBed") + big_bed_path = os.path.join(bigbed_output_folder, fileid + ".bigBed") if not chrom_sizes: try: chrom_sizes = get_chrom_sizes(genome=genome, rfg_config=rfg_config) @@ -191,10 +192,13 @@ def make_bed( # creat cmd to run that convert non bed file to bed file if input_type == InputTypes.BED.value: - # If bed file was provided: - bbclient = BBClient() - bed_id = bbclient.add_bed_to_cache(input_file) - output_path = bbclient.seek(bed_id) + try: + # If bed file was provided: + bbclient = BBClient() + bed_id = bbclient.add_bed_to_cache(input_file) + output_path = bbclient.seek(bed_id) + except FileNotFoundError as e: + raise BedBossException(f"File not found: {input_file} Error: {e}") else: _LOGGER.info(f"Converting {input_file} to BED format") diff --git a/bedboss/cli.py b/bedboss/cli.py index d544089..06b0d94 100644 --- a/bedboss/cli.py +++ b/bedboss/cli.py @@ -414,6 +414,14 @@ def delete_bedset( print(f"BedSet {identifier} deleted from the bedbase database") +@app.command(help="check installed R packages") +def check_requirements(): + from bedboss.bedboss import requirements_check + + print("Checking piplines requirements...") + requirements_check() + + @app.callback() def common( ctx: typer.Context, diff --git a/docs/changelog.md b/docs/changelog.md index 78c4da1..cdd875e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,14 @@ 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.2.1] - 2024-04-09 +## Changed +- small naming tweaks + +## Added +- added requirement check to cli + + # [0.2.0] - 2024-04-08 ## Changed - moved all uploading functionality to the `bbconf` package diff --git a/requirements/requirements-all.txt b/requirements/requirements-all.txt index 011323b..cb808c6 100644 --- a/requirements/requirements-all.txt +++ b/requirements/requirements-all.txt @@ -4,7 +4,7 @@ peppy>=0.40.1 yacman>=0.8.4 requests>=2.28.2 piper>=v0.14.0 -bbconf>=0.5.0 +bbconf>=0.5.1 # bbconf @ git+https://github.com/databio/bbconf.git@dev#egg=bbconf refgenconf>=0.12.2 pandas>=1.5.3