diff --git a/README.md b/README.md index a661fbb..1149a03 100755 --- a/README.md +++ b/README.md @@ -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) @@ -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 ... ... ``` --- diff --git a/docs/conf.py b/docs/conf.py index 54aeb59..6cbe446 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 --------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index e6d5cd6..c17c7a1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 `_. Development Prerequisites diff --git a/kb_python/__init__.py b/kb_python/__init__.py index 9093e4e..5bb330e 100644 --- a/kb_python/__init__.py +++ b/kb_python/__init__.py @@ -1 +1 @@ -__version__ = '0.29.0' +__version__ = '0.29.1' diff --git a/kb_python/bins/darwin/bustools/bustools b/kb_python/bins/darwin/bustools/bustools index d192ab6..b7a3152 100755 Binary files a/kb_python/bins/darwin/bustools/bustools and b/kb_python/bins/darwin/bustools/bustools differ diff --git a/kb_python/bins/darwin/m1/bustools/bustools b/kb_python/bins/darwin/m1/bustools/bustools index d192ab6..b7a3152 100755 Binary files a/kb_python/bins/darwin/m1/bustools/bustools and b/kb_python/bins/darwin/m1/bustools/bustools differ diff --git a/kb_python/bins/linux/bustools/bustools b/kb_python/bins/linux/bustools/bustools index c4b0ce3..038d41a 100755 Binary files a/kb_python/bins/linux/bustools/bustools and b/kb_python/bins/linux/bustools/bustools differ diff --git a/kb_python/bins/windows/bustools/bustools.exe b/kb_python/bins/windows/bustools/bustools.exe index 95e79e0..df5ce36 100755 Binary files a/kb_python/bins/windows/bustools/bustools.exe and b/kb_python/bins/windows/bustools/bustools.exe differ diff --git a/kb_python/main.py b/kb_python/main.py index 9337b84..026fc5f 100755 --- a/kb_python/main.py +++ b/kb_python/main.py @@ -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( @@ -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: @@ -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( @@ -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) diff --git a/kb_python/ref.py b/kb_python/ref.py index 783bd99..1a747d6 100755 --- a/kb_python/ref.py +++ b/kb_python/ref.py @@ -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. @@ -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) @@ -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( @@ -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: @@ -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( @@ -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( diff --git a/setup.cfg b/setup.cfg index aa41b2a..6d832b8 100755 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.29.0 +current_version = 0.29.1 commit = True tag = True diff --git a/setup.py b/setup.py index 0ed6daa..07d223e 100755 --- a/setup.py +++ b/setup.py @@ -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='phoenixter96@gmail.com',