Skip to content

Commit 786b2e1

Browse files
authored
Merge pull request #272 from pachterlab/devel
Bump version: 0.29.0 → 0.29.1
2 parents 43eddc8 + fefa701 commit 786b2e1

File tree

12 files changed

+48
-20
lines changed

12 files changed

+48
-20
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# kb-python
2-
![github version](https://img.shields.io/badge/Version-0.29.0-informational)
3-
[![pypi version](https://img.shields.io/pypi/v/kb-python)](https://pypi.org/project/kb-python/0.28.0/)
2+
![github version](https://img.shields.io/badge/Version-0.29.1-informational)
3+
[![pypi version](https://img.shields.io/pypi/v/kb-python)](https://pypi.org/project/kb-python/0.29.1/)
44
![python versions](https://img.shields.io/pypi/pyversions/kb_python)
55
![status](https://github.com/pachterlab/kb_python/workflows/CI/badge.svg)
66
[![codecov](https://codecov.io/gh/pachterlab/kb_python/branch/master/graph/badge.svg)](https://codecov.io/gh/pachterlab/kb_python)
@@ -98,9 +98,9 @@ The `kb info` command prints out package information including the version of `k
9898

9999
```bash
100100
$ kb info
101-
kb_python 0.28.0 ...
102-
kallisto: 0.50.1 ...
103-
bustools: 0.43.1 ...
101+
kb_python 0.29.1 ...
102+
kallisto: 0.51.1 ...
103+
bustools: 0.44.1 ...
104104
...
105105
```
106106
---

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
author = 'Kyung Hoi (Joseph) Min'
2525

2626
# The full version, including alpha/beta/rc tags
27-
release = '0.29.0'
27+
release = '0.29.1'
2828
master_doc = 'index'
2929

3030
# -- General configuration ---------------------------------------------------

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Welcome to kb-python's documentation!
77
=====================================
88

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

1212
Development Prerequisites

kb_python/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.29.0'
1+
__version__ = '0.29.1'
112 Bytes
Binary file not shown.
112 Bytes
Binary file not shown.
1.34 KB
Binary file not shown.
512 Bytes
Binary file not shown.

kb_python/main.py

+22-7
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ def parse_ref(
263263
args.workflow,
264264
files,
265265
overwrite=args.overwrite,
266-
temp_dir=temp_dir
266+
temp_dir=temp_dir,
267+
k=31 if not args.k else args.k
267268
)
268269
elif args.workflow == 'nac':
269270
ref_nac(
@@ -1846,9 +1847,8 @@ def main():
18461847
logger.debug('Printing verbose output')
18471848

18481849
# Set binary paths
1849-
if args.command in ('ref', 'count', 'extract') and ('dry_run' not in args
1850-
or not args.dry_run):
1851-
1850+
if args.command in ('ref', 'count', 'extract'):
1851+
dry_run = not ('dry_run' not in args or not args.dry_run)
18521852
use_kmer64 = False
18531853
opt_off = False
18541854
if args.k and args.k > 32:
@@ -1870,7 +1870,21 @@ def main():
18701870
# Check
18711871
kallisto_path = get_kallisto_binary_path()
18721872
bustools_path = get_bustools_binary_path()
1873-
kallisto_ok, bustools_ok = test_binaries()
1873+
kallisto_ok = True
1874+
bustools_ok = True
1875+
if not dry_run:
1876+
kallisto_ok, bustools_ok = test_binaries()
1877+
1878+
# If kallisto binary is not OK, try one with opt-off if applicable
1879+
if not kallisto_ok and not opt_off and bustools_ok:
1880+
# Only do so if --kallisto not already provided
1881+
if not any(arg.startswith('--kallisto') for arg in sys.argv):
1882+
opt_off = True
1883+
set_special_kallisto_binary(use_kmer64, opt_off)
1884+
args.kallisto = get_provided_kallisto_path()
1885+
set_kallisto_binary_path(args.kallisto)
1886+
kallisto_path = get_kallisto_binary_path()
1887+
kallisto_ok, bustools_ok = test_binaries()
18741888

18751889
if not kallisto_path or not kallisto_ok:
18761890
raise UnsupportedOSError(
@@ -1885,8 +1899,9 @@ def main():
18851899
'run `kb compile`.'
18861900
)
18871901

1888-
logger.debug(f'kallisto binary located at {kallisto_path}')
1889-
logger.debug(f'bustools binary located at {bustools_path}')
1902+
if not dry_run:
1903+
logger.debug(f'kallisto binary located at {kallisto_path}')
1904+
logger.debug(f'bustools binary located at {bustools_path}')
18901905

18911906
temp_dir = args.tmp or (
18921907
os.path.join(args.o, TEMP_DIR)

kb_python/ref.py

+16-3
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ def download_reference(
383383
workflow: str,
384384
files: Dict[str, str],
385385
temp_dir: str = 'tmp',
386-
overwrite: bool = False
386+
overwrite: bool = False,
387+
k: int = 31
387388
) -> Dict[str, str]:
388389
"""Downloads a provided reference file from a static url.
389390
@@ -395,6 +396,7 @@ def download_reference(
395396
paths to download the given reference have been provided
396397
temp_dir: Path to temporary directory, defaults to `tmp`
397398
overwrite: Overwrite an existing index file, defaults to `False`
399+
k: k-mer size, defaults to `31` (only `31` and `63` are supported)
398400
399401
Returns:
400402
Dictionary containing paths to generated file(s)
@@ -424,8 +426,15 @@ def download_reference(
424426
f'The following workflow option is not supported: {workflow}'
425427
)
426428

429+
long = ""
430+
if k == 63:
431+
long = "_long"
432+
elif k != 31:
433+
logger.info(
434+
"Only k-mer lengths 31 or 63 supported, defaulting to 31"
435+
)
427436
url = "https://github.com/pachterlab/kallisto-transcriptome-indices/"
428-
url = url + f'releases/download/v1/{species}_index_{workflow}.tar.xz'
437+
url = url + f'releases/download/v1/{species}_index_{workflow}{long}.tar.xz'
429438
path = os.path.join(temp_dir, os.path.basename(url))
430439
logger.info(
431440
'Downloading files for {} ({} workflow) from {} to {}'.format(
@@ -627,7 +636,7 @@ def ref(
627636

628637
if len(fasta_paths) > 1:
629638
raise RefError((
630-
'Option `--a` does not support multiple FASTA files as input'
639+
'Option `--aa` does not support multiple FASTA files as input'
631640
'while no GTF file(s) provided'
632641
))
633642
else:
@@ -668,6 +677,8 @@ def ref(
668677
if not glob.glob(f'{index_path}*') or overwrite:
669678
t2g_result = create_t2g_from_fasta(cdna_path, t2g_path, aa_flag=aa)
670679
results.update(t2g_result)
680+
if index_path.upper() == "NONE":
681+
return results
671682

672683
if k and k != 31:
673684
logger.warning(
@@ -1009,6 +1020,8 @@ def ref_nac(
10091020
)
10101021
t2g_result = create_t2g_from_fasta(combined_path, t2g_path)
10111022
results.update(t2g_result)
1023+
if index_path.upper() == "NONE":
1024+
return results
10121025

10131026
if k and k != 31:
10141027
logger.warning(

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.29.0
2+
current_version = 0.29.1
33
commit = True
44
tag = True
55

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def read(path):
1010

1111
setup(
1212
name='kb_python',
13-
version='0.29.0',
13+
version='0.29.1',
1414
url='https://github.com/pachterlab/kb_python',
1515
author='Kyung Hoi (Joseph) Min',
1616
author_email='phoenixter96@gmail.com',

0 commit comments

Comments
 (0)