Skip to content

Commit

Permalink
Merge pull request #272 from pachterlab/devel
Browse files Browse the repository at this point in the history
Bump version: 0.29.0 → 0.29.1
  • Loading branch information
Yenaled authored Oct 21, 2024
2 parents 43eddc8 + fefa701 commit 786b2e1
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 20 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kb-python
![github version](https://img.shields.io/badge/Version-0.29.0-informational)
[![pypi version](https://img.shields.io/pypi/v/kb-python)](https://pypi.org/project/kb-python/0.28.0/)
![github version](https://img.shields.io/badge/Version-0.29.1-informational)
[![pypi version](https://img.shields.io/pypi/v/kb-python)](https://pypi.org/project/kb-python/0.29.1/)
![python versions](https://img.shields.io/pypi/pyversions/kb_python)
![status](https://github.com/pachterlab/kb_python/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/pachterlab/kb_python/branch/master/graph/badge.svg)](https://codecov.io/gh/pachterlab/kb_python)
Expand Down Expand Up @@ -98,9 +98,9 @@ The `kb info` command prints out package information including the version of `k

```bash
$ kb info
kb_python 0.28.0 ...
kallisto: 0.50.1 ...
bustools: 0.43.1 ...
kb_python 0.29.1 ...
kallisto: 0.51.1 ...
bustools: 0.44.1 ...
...
```
---
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = 'Kyung Hoi (Joseph) Min'

# The full version, including alpha/beta/rc tags
release = '0.29.0'
release = '0.29.1'
master_doc = 'index'

# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Welcome to kb-python's documentation!
=====================================

This page contains **DEVELOPER** documentation for ``kb-python`` version ``0.29.0``.
This page contains **DEVELOPER** documentation for ``kb-python`` version ``0.29.1``.
For user documentation and tutorials, please go to `kallisto | bustools <https://www.kallistobus.tools/>`_.

Development Prerequisites
Expand Down
2 changes: 1 addition & 1 deletion kb_python/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.29.0'
__version__ = '0.29.1'
Binary file modified kb_python/bins/darwin/bustools/bustools
Binary file not shown.
Binary file modified kb_python/bins/darwin/m1/bustools/bustools
Binary file not shown.
Binary file modified kb_python/bins/linux/bustools/bustools
Binary file not shown.
Binary file modified kb_python/bins/windows/bustools/bustools.exe
Binary file not shown.
29 changes: 22 additions & 7 deletions kb_python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ def parse_ref(
args.workflow,
files,
overwrite=args.overwrite,
temp_dir=temp_dir
temp_dir=temp_dir,
k=31 if not args.k else args.k
)
elif args.workflow == 'nac':
ref_nac(
Expand Down Expand Up @@ -1846,9 +1847,8 @@ def main():
logger.debug('Printing verbose output')

# Set binary paths
if args.command in ('ref', 'count', 'extract') and ('dry_run' not in args
or not args.dry_run):

if args.command in ('ref', 'count', 'extract'):
dry_run = not ('dry_run' not in args or not args.dry_run)
use_kmer64 = False
opt_off = False
if args.k and args.k > 32:
Expand All @@ -1870,7 +1870,21 @@ def main():
# Check
kallisto_path = get_kallisto_binary_path()
bustools_path = get_bustools_binary_path()
kallisto_ok, bustools_ok = test_binaries()
kallisto_ok = True
bustools_ok = True
if not dry_run:
kallisto_ok, bustools_ok = test_binaries()

# If kallisto binary is not OK, try one with opt-off if applicable
if not kallisto_ok and not opt_off and bustools_ok:
# Only do so if --kallisto not already provided
if not any(arg.startswith('--kallisto') for arg in sys.argv):
opt_off = True
set_special_kallisto_binary(use_kmer64, opt_off)
args.kallisto = get_provided_kallisto_path()
set_kallisto_binary_path(args.kallisto)
kallisto_path = get_kallisto_binary_path()
kallisto_ok, bustools_ok = test_binaries()

if not kallisto_path or not kallisto_ok:
raise UnsupportedOSError(
Expand All @@ -1885,8 +1899,9 @@ def main():
'run `kb compile`.'
)

logger.debug(f'kallisto binary located at {kallisto_path}')
logger.debug(f'bustools binary located at {bustools_path}')
if not dry_run:
logger.debug(f'kallisto binary located at {kallisto_path}')
logger.debug(f'bustools binary located at {bustools_path}')

temp_dir = args.tmp or (
os.path.join(args.o, TEMP_DIR)
Expand Down
19 changes: 16 additions & 3 deletions kb_python/ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ def download_reference(
workflow: str,
files: Dict[str, str],
temp_dir: str = 'tmp',
overwrite: bool = False
overwrite: bool = False,
k: int = 31
) -> Dict[str, str]:
"""Downloads a provided reference file from a static url.
Expand All @@ -395,6 +396,7 @@ def download_reference(
paths to download the given reference have been provided
temp_dir: Path to temporary directory, defaults to `tmp`
overwrite: Overwrite an existing index file, defaults to `False`
k: k-mer size, defaults to `31` (only `31` and `63` are supported)
Returns:
Dictionary containing paths to generated file(s)
Expand Down Expand Up @@ -424,8 +426,15 @@ def download_reference(
f'The following workflow option is not supported: {workflow}'
)

long = ""
if k == 63:
long = "_long"
elif k != 31:
logger.info(
"Only k-mer lengths 31 or 63 supported, defaulting to 31"
)
url = "https://github.com/pachterlab/kallisto-transcriptome-indices/"
url = url + f'releases/download/v1/{species}_index_{workflow}.tar.xz'
url = url + f'releases/download/v1/{species}_index_{workflow}{long}.tar.xz'
path = os.path.join(temp_dir, os.path.basename(url))
logger.info(
'Downloading files for {} ({} workflow) from {} to {}'.format(
Expand Down Expand Up @@ -627,7 +636,7 @@ def ref(

if len(fasta_paths) > 1:
raise RefError((
'Option `--a` does not support multiple FASTA files as input'
'Option `--aa` does not support multiple FASTA files as input'
'while no GTF file(s) provided'
))
else:
Expand Down Expand Up @@ -668,6 +677,8 @@ def ref(
if not glob.glob(f'{index_path}*') or overwrite:
t2g_result = create_t2g_from_fasta(cdna_path, t2g_path, aa_flag=aa)
results.update(t2g_result)
if index_path.upper() == "NONE":
return results

if k and k != 31:
logger.warning(
Expand Down Expand Up @@ -1009,6 +1020,8 @@ def ref_nac(
)
t2g_result = create_t2g_from_fasta(combined_path, t2g_path)
results.update(t2g_result)
if index_path.upper() == "NONE":
return results

if k and k != 31:
logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.29.0
current_version = 0.29.1
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def read(path):

setup(
name='kb_python',
version='0.29.0',
version='0.29.1',
url='https://github.com/pachterlab/kb_python',
author='Kyung Hoi (Joseph) Min',
author_email='[email protected]',
Expand Down

0 comments on commit 786b2e1

Please sign in to comment.