Skip to content

Commit

Permalink
Merge pull request #183 from refgenie/dev
Browse files Browse the repository at this point in the history
v0.9.2
  • Loading branch information
stolarczyk committed Jul 1, 2020
2 parents 9ced533 + 74ffca6 commit d54dc87
Show file tree
Hide file tree
Showing 14 changed files with 229 additions and 86 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build package

on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]

jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dev dependancies
run: if [ -f requirements/requirements-dev.txt ]; then pip install -r requirements/requirements-dev.txt; fi

# - name: Install test dependancies
# run: if [ -f requirements/requirements-test.txt ]; then pip install -r requirements/requirements-test.txt; fi

- name: Install package
run: python -m pip install .

# - name: Run pytest tests
# run: pytest tests --remote-data --cov=./ --cov-report=xml

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
# with:
# file: ./coverage.xml
# name: py-${{ matrix.python-version }}-${{ matrix.os }}
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/databio/refgenie.svg?branch=master)](https://travis-ci.org/databio/refgenie)
![Build package](https://github.com/refgenie/refgenie/workflows/Build%20package/badge.svg)
[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/refgenie/README.html)

<img src="https://raw.githubusercontent.com/databio/refgenie/master/docs/img/refgenie_logo.svg?sanitize=true" alt="Refgenie" height="70"/><br>
Expand Down
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
[![PEP compatible](https://pepkit.github.io/img/PEP-compatible-green.svg)](https://pepkit.github.io)
[![PyPi](https://img.shields.io/pypi/v/refgenie.svg)](https://pypi.org/project/refgenie/)

<iframe src="https://ghbtns.com/github-btn.html?user=refgenie&repo=refgenie&type=star&count=true" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>

## What is refgenie?

Refgenie manages storage, access, and transfer of reference genome resources. It provides command-line and Python interfaces to *download* pre-built reference genome "assets", like indexes used by bioinformatics tools. It can also *build* assets for custom genome assemblies. Refgenie provides programmatic access to a standard genome folder structure, so software can swap from one genome to another.
Expand Down
106 changes: 62 additions & 44 deletions docs/autodoc_build/refgenconf.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Create a block of text representing genome-to-asset mapping.
- `asset_sep` (`str`): the delimiter between names of types of assets,within each genome line
- `genome_assets_delim` (`str`): the delimiter to place betweenreference genome assembly name and its list of asset names
- `genome` (`list[str] | str`): genomes that the assets should be found for
- `order` (``): function(str) -> object how to key genome IDs and assetnames for sort
- `order` (`function(str) -> object`): how to key genome IDs and assetnames for sort


#### Returns:
Expand Down Expand Up @@ -209,7 +209,7 @@ def genomes_str(self, order=None)
Get as single string this configuration's reference genome assembly IDs.
#### Parameters:

- `order` (``): function(str) -> object how to key genome IDs for sort
- `order` (`function(str) -> object`): how to key genome IDs for sort


#### Returns:
Expand All @@ -219,36 +219,6 @@ Get as single string this configuration's reference genome assembly IDs.



```python
def get_asset(self, genome_name, asset_name, tag_name=None, seek_key=None, strict_exists=True, check_exist=<function RefGenConf.<lambda> at 0x7f3f69ae2d40>, enclosing_dir=False)
```

Get a path to the a specified genome-asset-tag. Note: enforces file existence checks by default
#### Parameters:

- `genome_name` (`str`): name of a reference genome assembly of interest
- `asset_name` (`str`): name of the particular asset to fetch
- `tag_name` (`str`): name of the particular asset tag to fetch
- `seek_key` (`str`): name of the particular subasset to fetch
- `strict_exists` (`bool | NoneType`): how to handle case in whichpath doesn't exist; True to raise IOError, False to raise RuntimeWarning, and None to do nothing at all
- `check_exist` (`function(callable) -> bool`): how to check forasset/path existence
- `enclosing_dir` (`bool`): whether a path to the entire enclosing directory should be returned, e.g.for a fasta asset that has 3 seek_keys pointing to 3 files in an asset dir, that asset dir is returned


#### Returns:

- `str`: path to the asset


#### Raises:

- `TypeError`: if the existence check is not a one-arg function
- `refgenconf.MissingGenomeError`: if the named assembly isn't knownto this configuration instance
- `refgenconf.MissingAssetError`: if the names assembly is known tothis configuration instance, but the requested asset is unknown




```python
def get_default_tag(self, genome, asset, use_existing=True)
```
Expand Down Expand Up @@ -293,7 +263,7 @@ List locally available reference genome IDs and assets by ID.
#### Parameters:

- `genome` (`list[str] | str`): genomes that the assets should be found for
- `order` (``): function(str) -> object how to key genome IDs and assetnames for sort
- `order` (`function(str) -> object`): how to key genome IDs and assetnames for sort


#### Returns:
Expand All @@ -304,15 +274,15 @@ List locally available reference genome IDs and assets by ID.


```python
def get_remote_data_str(self, genome=None, order=None, get_url=<function RefGenConf.<lambda> at 0x7f3f69ae6170>)
def get_remote_data_str(self, genome=None, order=None, get_url=<function RefGenConf.<lambda> at 0x1051476a8>)
```

List genomes and assets available remotely.
#### Parameters:

- `get_url` (`function(refgenconf.RefGenConf) -> str`): how to determineURL request, given RefGenConf instance
- `genome` (`list[str] | str`): genomes that the assets should be found for
- `order` (``): function(str) -> object how to key genome IDs and assetnames for sort
- `order` (`function(str) -> object`): how to key genome IDs and assetnames for sort


#### Returns:
Expand Down Expand Up @@ -403,7 +373,7 @@ def list(self, genome=None, order=None, include_tags=False)
List local assets; map each namespace to a list of available asset names
#### Parameters:

- `order` (`function(str) -> object`): how to key genome IDs for sort
- `order` (`callable(str) -> object`): how to key genome IDs for sort
- `genome` (`list[str] | str`): genomes that the assets should be found for
- `include_tags` (`bool`): whether asset tags should be included in the returned dict

Expand All @@ -423,7 +393,7 @@ List types/names of assets that are available for one--or all--genomes.
#### Parameters:

- `genome` (`str | NoneType`): reference genome assembly ID, optional;if omitted, the full mapping from genome to asset names
- `order` (``): function(str) -> object how to key genome IDs and assetnames for sort
- `order` (`function(str) -> object`): how to key genome IDs and assetnames for sort
- `include_tags` (`bool`): whether asset tags should be included in the returned dict


Expand All @@ -442,7 +412,7 @@ List assemblies for which a particular asset is available.
#### Parameters:

- `asset` (`str | NoneType`): name of type of asset of interest, optional
- `order` (``): function(str) -> object how to key genome IDs and assetnames for sort
- `order` (`function(str) -> object`): how to key genome IDs and assetnames for sort


#### Returns:
Expand All @@ -453,15 +423,15 @@ List assemblies for which a particular asset is available.


```python
def listr(self, genome=None, order=None, get_url=<function RefGenConf.<lambda> at 0x7f3f69ae6290>)
def listr(self, genome=None, order=None, get_url=<function RefGenConf.<lambda> at 0x1051477b8>)
```

List genomes and assets available remotely.
#### Parameters:

- `get_url` (`function(refgenconf.RefGenConf) -> str`): how to determineURL request, given RefGenConf instance
- `genome` (`list[str] | str`): genomes that the assets should be found for
- `order` (``): function(str) -> object how to key genome IDs and assetnames for sort
- `order` (`function(str) -> object`): how to key genome IDs and assetnames for sort


#### Returns:
Expand All @@ -472,7 +442,19 @@ List genomes and assets available remotely.


```python
def pull(self, genome, asset, tag, unpack=True, force=None, get_json_url=<function RefGenConf.<lambda> at 0x7f3f69ae6560>, build_signal_handler=<function _handle_sigint at 0x7f3f69ba07a0>)
def plugins(self)
```

Plugins registered by entry points in the current Python env
#### Returns:

- `dict[dict[function(refgenconf.RefGenConf)]]`: dict which keysare names of all possible hooks and values are dicts mapping registered functions names to their values




```python
def pull(self, genome, asset, tag, unpack=True, force=None, get_json_url=<function RefGenConf.<lambda> at 0x105147a60>, build_signal_handler=<function _handle_sigint at 0x1050a8ea0>)
```

Download and possibly unpack one or more assets for a given ref gen.
Expand Down Expand Up @@ -547,7 +529,19 @@ Remove any relationship links associated with the selected asset


```python
def seek(self, genome_name, asset_name, tag_name=None, seek_key=None, strict_exists=None, enclosing_dir=False, check_exist=<function RefGenConf.<lambda> at 0x7f3f69ae2c20>)
def run_plugins(self, hook)
```

Runs all installed plugins for the specified hook.
#### Parameters:

- `hook` (`str`): hook identifier




```python
def seek(self, genome_name, asset_name, tag_name=None, seek_key=None, strict_exists=None, enclosing_dir=False, check_exist=<function RefGenConf.<lambda> at 0x1051472f0>)
```

Seek path to a specified genome-asset-tag
Expand Down Expand Up @@ -714,7 +708,7 @@ A convenience method which wraps the update assets and uses it to update the ass
def update_seek_keys(self, genome, asset, tag=None, keys=None)
```

A convenience method which wraps the update assets and uses it to update the seek keys for a tagged asset.
A convenience method which wraps the updated assets and uses it to update the seek keys for a tagged asset.
#### Parameters:

- `genome` (`str`): genome to be added/updated
Expand Down Expand Up @@ -762,6 +756,30 @@ Return writability flag or None if not set



```python
def write(self, filepath=None)
```

Write the contents to a file. If pre- and post-update plugins are defined, they will be executed automatically
#### Parameters:

- `filepath` (`str`): a file path to write to


#### Returns:

- `str`: the path to the created files


#### Raises:

- `OSError`: when the object has been created in a read only mode or other process has locked the file
- `TypeError`: when the filepath cannot be determined.This takes place only if YacAttMap initialized with a Mapping as an input, not read from file.
- `OSError`: when the write is called on an object with no write capabilitiesor when writing to a file that is locked by a different object




## <a name="GenomeConfigFormatError"></a> Class `GenomeConfigFormatError`
Exception for invalid genome config file format.

Expand Down Expand Up @@ -815,4 +833,4 @@ Get path to genome configuration file.



*Version Information: `refgenconf` v0.7.0-dev, generated by `lucidoc` v0.4.2*
*Version Information: `refgenconf` v0.7.1-dev, generated by `lucidoc` v0.4.3*
9 changes: 9 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

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.9.2] - 2020-07-01

## Changed
- in `refgenie build` reduced the config file locking time to prevent problems in multi-build context
- dropped Python 2 support
## Added
- parametrized `kmer` in salmon recipes
- support for all genome configuration file parameter values initialization in `refgenie init`

## [0.9.1] - 2020-05-01

### Added
Expand Down
2 changes: 1 addition & 1 deletion refgenie/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.9.1"
__version__ = "0.9.2"

0 comments on commit d54dc87

Please sign in to comment.