Skip to content

Commit 4298e4b

Browse files
Merge pull request #61 from databio/dev
Release 0.2.1
2 parents efa915c + 426df48 commit 4298e4b

File tree

7 files changed

+34
-10
lines changed

7 files changed

+34
-10
lines changed

bedboss/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.2.0"
1+
__version__ = "0.2.1"

bedboss/bedboss.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from bbconf.bbagent import BedBaseAgent
1414
from bbconf.models.base_models import FileModel
1515

16-
1716
from bedboss.bedstat.bedstat import bedstat
1817
from bedboss.bedmaker.bedmaker import make_all
1918
from bedboss.bedbuncher import run_bedbuncher
@@ -231,6 +230,7 @@ def insert_pep(
231230
:param str output_folder: output statistics folder
232231
:param Union[str, peppy.Project] pep: path to the pep file or pephub registry path
233232
:param str bedset_id: bedset identifier
233+
:param str bedset_name: bedset name
234234
:param str rfg_config: path to the genome config file (refgenie)
235235
:param bool create_bedset: whether to create bedset
236236
:param bool upload_qdrant: whether to upload bedfiles to qdrant
@@ -263,6 +263,7 @@ def insert_pep(
263263
validate_project(pep, BEDBOSS_PEP_SCHEMA_PATH)
264264

265265
for i, pep_sample in enumerate(pep.samples):
266+
m.print_success(f"Processing sample {i + 1}/{len(pep.samples)}")
266267
_LOGGER.info(f"Running bedboss pipeline for {pep_sample.sample_name}")
267268
if pep_sample.get("file_type"):
268269
if pep_sample.get("file_type").lower() == "narrowpeak":
@@ -276,6 +277,7 @@ def insert_pep(
276277
input_file=pep_sample.input_file,
277278
input_type=pep_sample.input_type,
278279
genome=pep_sample.genome,
280+
name=pep_sample.sample_name,
279281
bedbase_config=bbagent,
280282
narrowpeak=is_narrow_peak,
281283
chrom_sizes=pep_sample.get("chrom_sizes"),
@@ -310,6 +312,7 @@ def insert_pep(
310312
upload_pephub=upload_pephub,
311313
upload_s3=upload_s3,
312314
no_fail=no_fail,
315+
force_overwrite=force_overwrite,
313316
)
314317
else:
315318
_LOGGER.info(

bedboss/bedbuncher/bedbuncher.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def run_bedbuncher(
161161
plots=plots.model_dump(exclude_none=True, exclude_unset=True),
162162
local_path=output_folder,
163163
no_fail=no_fail,
164+
overwrite=force_overwrite,
164165
)
165166

166167

bedboss/bedmaker/bedmaker.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,14 @@ def make_bigbed(
7070
pm_clean = False
7171
_LOGGER.info(f"Generating bigBed files for: {bed_path}")
7272

73-
if not os.path.exists(output_path):
74-
os.makedirs(output_path)
73+
bigbed_output_folder = os.path.join(output_path, BIGBED_FILE_NAME)
74+
if not os.path.exists(bigbed_output_folder):
75+
os.makedirs(bigbed_output_folder)
7576

7677
bedfile_name = os.path.split(bed_path)[1]
7778
fileid = os.path.splitext(os.path.splitext(bedfile_name)[0])[0]
7879
# Produce bigBed (big_narrow_peak) file from peak file
79-
big_bed_path = os.path.join(output_path, BIGBED_FILE_NAME, fileid + ".bigBed")
80+
big_bed_path = os.path.join(bigbed_output_folder, fileid + ".bigBed")
8081
if not chrom_sizes:
8182
try:
8283
chrom_sizes = get_chrom_sizes(genome=genome, rfg_config=rfg_config)
@@ -191,10 +192,13 @@ def make_bed(
191192

192193
# creat cmd to run that convert non bed file to bed file
193194
if input_type == InputTypes.BED.value:
194-
# If bed file was provided:
195-
bbclient = BBClient()
196-
bed_id = bbclient.add_bed_to_cache(input_file)
197-
output_path = bbclient.seek(bed_id)
195+
try:
196+
# If bed file was provided:
197+
bbclient = BBClient()
198+
bed_id = bbclient.add_bed_to_cache(input_file)
199+
output_path = bbclient.seek(bed_id)
200+
except FileNotFoundError as e:
201+
raise BedBossException(f"File not found: {input_file} Error: {e}")
198202

199203
else:
200204
_LOGGER.info(f"Converting {input_file} to BED format")

bedboss/cli.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@ def delete_bedset(
414414
print(f"BedSet {identifier} deleted from the bedbase database")
415415

416416

417+
@app.command(help="check installed R packages")
418+
def check_requirements():
419+
from bedboss.bedboss import requirements_check
420+
421+
print("Checking piplines requirements...")
422+
requirements_check()
423+
424+
417425
@app.callback()
418426
def common(
419427
ctx: typer.Context,

docs/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
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.
44

5+
# [0.2.1] - 2024-04-09
6+
## Changed
7+
- small naming tweaks
8+
9+
## Added
10+
- added requirement check to cli
11+
12+
513
# [0.2.0] - 2024-04-08
614
## Changed
715
- moved all uploading functionality to the `bbconf` package

requirements/requirements-all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ peppy>=0.40.1
44
yacman>=0.8.4
55
requests>=2.28.2
66
piper>=v0.14.0
7-
bbconf>=0.5.0
7+
bbconf>=0.5.1
88
# bbconf @ git+https://github.com/databio/bbconf.git@dev#egg=bbconf
99
refgenconf>=0.12.2
1010
pandas>=1.5.3

0 commit comments

Comments
 (0)