Skip to content

Commit

Permalink
added docs + updated bbconf and pipestat
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Oct 4, 2023
1 parent 91ffcac commit 7f1cf69
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 13 deletions.
12 changes: 9 additions & 3 deletions bedboss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import coloredlogs

from bedboss import *
from bedboss.bedqc import bedqc
from bedboss.bedmaker import bedmaker
from bedboss.bedstat import bedstat

# from bedboss.bedqc.bedqc import bedqc
# from bedboss.bedmaker.bedmaker import BedMaker
# from bedboss.bedstat.bedstat import bedstat
from bedboss._version import __version__
from bedboss.bedboss import run_all, run_all_by_pep, bedqc, BedMaker, bedstat


__package_name__ = "bedboss"
Expand All @@ -24,9 +26,13 @@
"__version__",
"__package_name__",
"__author__",
"bedboss",
"bedqc",
"bedmaker",
"BedMaker",
"bedstat",
"run_all",
"run_all_by_pep",
]

_LOGGER = logmuse.init_logger("bedboss")
Expand Down
2 changes: 1 addition & 1 deletion bedboss/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0a3"
__version__ = "0.1.0a4"
8 changes: 6 additions & 2 deletions bedboss/bedboss.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
check_db_connection,
)
from bedboss.exceptions import OpenSignalMatrixException
from bedboss import __version__
from bedboss._version import __version__

_LOGGER = logging.getLogger("bedboss")

Expand Down Expand Up @@ -57,7 +57,11 @@ def get_osm_path(genome: str) -> Union[str, None]:
if not os.path.exists(osm_path):
if not os.path.exists(OPEN_SIGNAL_FOLDER):
os.makedirs(OPEN_SIGNAL_FOLDER)
download_file(url=f"{OPEN_SIGNAL_URL}{osm_name}", path=osm_path, no_fail=True,)
download_file(
url=f"{OPEN_SIGNAL_URL}{osm_name}",
path=osm_path,
no_fail=True,
)
return osm_path


Expand Down
2 changes: 1 addition & 1 deletion bedboss/bedstat/bedstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def bedstat(
del plot["name"]
data.update({plot_id: plot})
bbc.bed.report(
sample_name=bed_digest,
record_identifier=bed_digest,
values=data,
force_overwrite=force_overwrite,
)
Expand Down
4 changes: 2 additions & 2 deletions bedboss/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from argparse import ArgumentParser
import logmuse

from bedboss import __version__, __package_name__
from bedboss._version import __version__


def build_argparser() -> ArgumentParser:
Expand All @@ -11,7 +11,7 @@ def build_argparser() -> ArgumentParser:
:retrun: Tuple[pipeline, arguments]
"""
parser = VersionInHelpParser(
prog=__package_name__,
prog="bedboss",
description="Warehouse of pipelines for BED-like files: "
"bedmaker, bedstat, and bedqc.",
epilog="",
Expand Down
77 changes: 77 additions & 0 deletions docs/how_run_script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# How to run bedboss as a Python API

## Install bedboss

```bash
pip install bedboss
```

## Run bedboss all

```python
from bedboss import run_all

run_all(
sample_name="example_sample_name",
input_file="example/path/to/input_file",
input_type="bed",
outfolder="example/path/to/outfolder",
genome="hg38",
bedbase_config="example/path/to/bedbase_config.yaml",
# + another optional arguments
)


```


## Run bedboss all-pep

```python
from bedboss import run_all_by_pep

run_all_by_pep(
pep="example/path/to/pep.yaml"
)
```

## Run bedboss make

```python
from bedboss import BedMaker

BedMaker(
input_file="example/path/to/input_file",
input_type="bed",
output_bed="example/path/to/output_bed",
output_bigbed="example/path/to/output_bigbed",
sample_name="example_sample_name",
genome="hg38",
)

```

## Run bedboss stat

```python
from bedboss import bedstat

bedstat(
bedfile="example/path/to/bedfile.bed",
bedbase_config="example/path/to/bedbase_config.yaml",
genome="hg38",
outfolder="example/path/to/outfolder",
)

```

## Run bedboss qc

```python
from bedboss import bedqc

bedqc(
bedfile="example/path/to/bedfile.bed",
outfolder="example/path/to/outfolder",
)
```
7 changes: 3 additions & 4 deletions requirements/requirements-all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ coloredlogs>=15.0.1
peppy>=0.40.0a4
yacman>=0.8.4
requests>=2.28.2
piper>=0.13.2
bbconf>=0.4.0a1
piper>=0.13.3a1
bbconf>=0.4.0a3
refgenconf>=0.12.2
pandas>=1.5.3
ubiquerg>=0.6.2
# geniml
ubiquerg>=0.6.2

0 comments on commit 7f1cf69

Please sign in to comment.