-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from databio/dev
Updated bedbase docs
- Loading branch information
Showing
41 changed files
with
627 additions
and
41,199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# bbconf | ||
<h1 align="center">bbconf</h1> | ||
|
||
![Run pytests](https://github.com/databio/bbconf/workflows/Run%20pytests/badge.svg) | ||
[![pypi-badge](https://img.shields.io/pypi/v/bbconf?color=%2334D058)](https://pypi.org/project/bbconf/) | ||
[![pypi-version](https://img.shields.io/pypi/pyversions/bbconf.svg?color=%2334D058)](https://pypi.org/project/bbconf) | ||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | ||
[![Github badge](https://img.shields.io/badge/source-github-354a75?logo=github)](https://github.com/databio/bbconf) | ||
[![coverage](https://coverage-badge.samuelcolvin.workers.dev/databio/bbconf.svg)](https://coverage-badge.samuelcolvin.workers.dev/redirect/databio/bbconf) | ||
|
||
|
||
*BEDBASE* project configuration package (agent) | ||
|
||
## What is this? | ||
|
||
`bbconf` is a configuration and management tool for BEDbase, facilitating the reading of configuration files, | ||
setting up connections to PostgreSQL, PEPhub, S3, and Qdrant databases, managing file paths, and storing transformer models. | ||
It formalizes communication pathways for pipelines and downstream tools, ensuring seamless interaction." | ||
|
||
--- | ||
|
||
**Documentation**: <a href="https://docs.bedbase.org/bedboss" target="_blank">https://docs.bedbase.org/bedboss</a> | ||
|
||
**Source Code**: <a href="https://github.com/databio/bbconf" target="_blank">https://github.com/databio/bbconf</a> | ||
|
||
--- | ||
|
||
## Installation | ||
To install `bbclient` use this command: | ||
``` | ||
pip install bbclient | ||
``` | ||
or install the latest version from the GitHub repository: | ||
``` | ||
pip install git+https://github.com/databio/bbconf.git | ||
``` | ||
|
||
`bbconf` defines `BedBaseConf` class which is an in-memory representation of the configuration file for the *BEDBASE* project. This is the source of the project-wide constant variables. Additionally it implements multiple convenience methods for interacting with the database backend, i.e. [PostgreSQL](https://www.postgresql.org/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,191 +1 @@ | ||
Final targets: BedBaseConf, get_bedbase_cfg | ||
<script> | ||
document.addEventListener('DOMContentLoaded', (event) => { | ||
document.querySelectorAll('h3 code').forEach((block) => { | ||
hljs.highlightBlock(block); | ||
}); | ||
}); | ||
</script> | ||
|
||
<style> | ||
h3 .content { | ||
padding-left: 22px; | ||
text-indent: -15px; | ||
} | ||
h3 .hljs .content { | ||
padding-left: 20px; | ||
margin-left: 0px; | ||
text-indent: -15px; | ||
martin-bottom: 0px; | ||
} | ||
h4 .content, table .content, p .content, li .content { margin-left: 30px; } | ||
h4 .content { | ||
font-style: italic; | ||
font-size: 1em; | ||
margin-bottom: 0px; | ||
} | ||
|
||
</style> | ||
|
||
|
||
# Package `bbconf` Documentation | ||
|
||
## <a name="BedBaseConf"></a> Class `BedBaseConf` | ||
This class standardizes reporting of bedstat and bedbuncher results. It formalizes a way for these pipelines and downstream tools to communicate -- the produced results can easily and reliably become an input for the server. The object exposes API for interacting with the results and is backed by a [PostgreSQL](https://www.postgresql.org/) database. | ||
|
||
|
||
```python | ||
def __init__(self, config_path=None, database_only=False) | ||
``` | ||
|
||
Initialize the object | ||
#### Parameters: | ||
|
||
- `config_path` (`str`): path to the bedbase configuration file | ||
- `database_only` (`bool`): whether the database managers should notkeep an in-memory copy of the data in the database | ||
|
||
|
||
|
||
|
||
```python | ||
def bed(self) | ||
``` | ||
|
||
PipestatManager of the bedfiles table | ||
#### Returns: | ||
|
||
- `pipestat.PipestatManager`: manager of the bedfiles table | ||
|
||
|
||
|
||
|
||
```python | ||
def bedset(self) | ||
``` | ||
|
||
PipestatManager of the bedsets table | ||
#### Returns: | ||
|
||
- `pipestat.PipestatManager`: manager of the bedsets table | ||
|
||
|
||
|
||
|
||
```python | ||
def config(self) | ||
``` | ||
|
||
Config used to initialize the object | ||
#### Returns: | ||
|
||
- `yacman.YacAttMap`: bedbase configuration file contents | ||
|
||
|
||
|
||
|
||
```python | ||
def get_bedbuncher_output_path(self, remote=False) | ||
``` | ||
|
||
Get path to the output of the bedbuncher pipeline | ||
#### Parameters: | ||
|
||
- `remote` (`bool`): whether to use remote url base | ||
|
||
|
||
#### Returns: | ||
|
||
- `str`: path to the bedbuncher pipeline output | ||
|
||
|
||
|
||
|
||
```python | ||
def get_bedstat_output_path(self, remote=False) | ||
``` | ||
|
||
Get path to the output of the bedstat pipeline | ||
#### Parameters: | ||
|
||
- `remote` (`bool`): whether to use remote url base | ||
|
||
|
||
#### Returns: | ||
|
||
- `str`: path to the bedstat pipeline output | ||
|
||
|
||
|
||
|
||
```python | ||
def remove_relationship(self, bedset_id, bedfile_ids=None) | ||
``` | ||
|
||
Remove entries from the relationships table | ||
#### Parameters: | ||
|
||
- `bedset_id` (`str`): id of the bedset to remove | ||
- `bedfile_ids` (`list[str]`): ids of the bedfiles to remove for theselected bedset. If none provided, all the relationsips for the selected bedset will be removed. | ||
|
||
|
||
|
||
|
||
```python | ||
def report_relationship(self, bedset_id, bedfile_id) | ||
``` | ||
|
||
Report a bedfile for bedset. | ||
|
||
Inserts the ID pair into the relationship table, which allows to | ||
manage many to many bedfile bedset relationships | ||
#### Parameters: | ||
|
||
- `bedset_id` (`int`): id of the bedset to report bedfile for | ||
- `bedfile_id` (`int`): id of the bedfile to report | ||
|
||
|
||
|
||
|
||
```python | ||
def select_bedfiles_for_bedset(self, condition=None, condition_val=None, bedfile_col=None) | ||
``` | ||
|
||
Select bedfiles that are part of a bedset that matches the query | ||
#### Parameters: | ||
|
||
- `condition` (`str`): bedsets table query to restrict the results with,for instance `"id=%s"` | ||
- `condition_val` (`list[str]`): values to populate the condition stringwith | ||
- `bedfile_col` (`list[str] | str`): bedfile columns to include in theresult, if none specified all columns will be included | ||
|
||
|
||
#### Returns: | ||
|
||
- `list[psycopg2.extras.DictRow]`: matched bedfiles table contents | ||
|
||
|
||
|
||
|
||
```python | ||
def get_bedbase_cfg(cfg=None) | ||
``` | ||
|
||
Determine path to the bedbase configuration file | ||
|
||
The path can be either explicitly provided | ||
or read from a $BEDBASE environment variable | ||
#### Parameters: | ||
|
||
- `cfg` (`str`): path to the config file.Optional, the $BEDBASE config env var will be used if not provided | ||
|
||
|
||
#### Returns: | ||
|
||
- `str`: configuration file path | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
*Version Information: `bbconf` v0.1.0, generated by `lucidoc` v0.4.3* | ||
### 🚧 Docs in progress! Stay tuned for updates. We're working hard to bring you valuable content soon! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.