kaptive.py command not found

In this troubleshooting guide we learn how to fix kaptive.py command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

kaptive.py: command not found

or when using sudo you get the following error message

sudo: kaptive.py: command not found

Solutions to kaptive.py: command not found

How To Fix kaptive.py: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu kaptive.py is provided by kaptive package.

kaptive is:

Kaptive reports information about K and O types for Klebsiella genome assemblies.

Given a novel genome and a database of known loci (K or O), Kaptive will help a user to decide whether their sample has a known or novel locus. It carries out the following for each input assembly:

  • BLAST for all known locus nucleotide sequences (using blastn) to identify the best match (‘best’ defined as having the highest coverage).
  • Extract the region(s) of the assembly which correspond to the BLAST hits (i.e. the locus sequence in the assembly) and save it to a FASTA file.
  • BLAST for all known locus genes (using tblastn) to identify which expected genes (genes in the best matching locus) are present/missing and whether any unexpected genes (genes from other loci) are present.
  • Output a summary to a table file.

In cases where your input assembly closely matches a known locus, Kaptive should make that obvious. When your assembly has a novel type, that too should be clear. However, Kaptive cannot reliably extract or annotate locus sequences for totally novel types - if it indicates a novel locus is present then extracting and annotating the sequence is up to you! Very poor assemblies can confound the results, so be sure to closely examine any case where the locus sequence in your assembly is broken into multiple pieces.

To fix this problem, we can install more using the command below.

sudo apt-get -y install kaptive

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install kaptive.

sudo apt -y install kaptive

Or if you have aptitude installed you can use the following command.

sudo aptitude install kaptive

Summary

In this tutorial we learn how to fix kaptive.py command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.