Skip to content

Commit

Permalink
umbrella docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Feb 2, 2024
1 parent 524becf commit fac05c9
Show file tree
Hide file tree
Showing 52 changed files with 4,341 additions and 39 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish docs to GitHub pages
on:
push:
branches:
- master

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs.bedbase.org
4 changes: 0 additions & 4 deletions docs/README.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/bbconf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# bbconf

`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/)
191 changes: 191 additions & 0 deletions docs/bbconf/bbc_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
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*
51 changes: 51 additions & 0 deletions docs/bbconf/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Changelog

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.4.0] - 2023-10-17
### Change
- bbconf to use pipestat v0.4.1 and SQLModel
- Added qdrant search, and insert methods
- Fixed tests

## [0.3.0] - 2022-08-18
### Change
- update select_bedfiles_for_distance
- update database table schema

## [0.2.1] - 2021-11-11
### Fix
- attempt to fix database connection error

## [0.2.0] - 2021-10-25
**This release introduces backwards incompatible changes**
### Changed
- switched to object-relational mapping approach (ORM) for database interface


## [0.1.1] - 2021-04-15
### Added
- added new fields in the bedfiles and bedsets schema

## [0.1.0] - 2021-02-22
**This release introduces backwards incompatible changes**
### Changed
- `BedBaseConf` backend (database) to [PostgreSQL](https://www.postgresql.org/)
- complete `BedBaseConf` class redesign

## [0.0.2] - 2020-05-28
### Added
- index deleting methods:
- `delete_bedsets_index`
- `delete_bedfiles_index`
- multiple new keys constants

### Changed
- make `search_bedfiles` and `search_bedsets` methods return all hits by default instead of just 10. Parametrize it.
- added more arguments to `insert_bedfiles_data` and `insert_bedsets_data` method interfaces: `doc_id` and `force_update`
- Elasticsearch documents are inserted into the indices more securily, `insert_*` methods prevent documents duplication


## [0.0.1] - 2020-02-05
### Added
- initial project release
Loading

0 comments on commit fac05c9

Please sign in to comment.