Skip to content

Commit 6d8a348

Browse files
committed
- Modified typing.GeneResult.compare_translation() to translate in all 3 frames and choose the longest translation. Prevents a protein alignment error where the translation is only a single amino acid.
- Fixed partial logic.
1 parent 17d5816 commit 6d8a348

18 files changed

+334
-768
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Kaptive reports information about surface polysaccharide loci for _Klebsiella pn
77

88
A step-by-step tutorial is also available [here](https://bit.ly/kaptive-workshop).
99

10-
[![DOI](https://zenodo.org/badge/60247148.svg)](https://zenodo.org/badge/latestdoi/60247148)
10+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11257262.svg)](https://doi.org/10.5281/zenodo.11257262)

docs/source/Databases-distributed-with-Kaptive.rst

Lines changed: 0 additions & 196 deletions
This file was deleted.

docs/source/Databases.rst

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ same loci, the phenotype will instead be predicted as 'O1ab'.
123123
This logic is applied during the :ref:`phenotype prediction <Phenotype-prediction>` step of typing and is reported in
124124
the `Type` column of the Kaptive tabular output.
125125

126+
.. _Distributed-databases:
127+
126128
Databases distributed with Kaptive
127129
====================================
128130

@@ -331,51 +333,29 @@ Database Keywords
331333

332334
Extract
333335
====================================
334-
Kaptive 3.0.0 and above include a new command-line option ``--extract`` that allows you to extract features
336+
Kaptive 3.0.0 and above includes a new command-line mode ``extract`` that allows you to extract features
335337
from a Kaptive database in the following formats:
336338

337-
* **loci**: Locus nucleotide sequences in fasta (fna) format.
338-
* **genes**: Gene nucleotide sequences in fasta (fna) format.
339-
* **proteins**: Protein sequences in fasta (faa) format.
340-
* **genbank**: Genbank format (same as input but optionally filtered).
341-
342-
Simple usage is as follows::
343-
344-
kaptive extract <db> <format> [options]
345-
346-
For example, If I wanted to extract the gene nucleotide sequences from the *Klebsiella pneumoniae* K locus primary
347-
reference database in fasta format, I would run::
348-
349-
kaptive extract kp_k loci > k_loci.fna
350-
351-
If I wanted to extract all protein sequences from KL1 and KL2, I would run::
339+
* **fna**: Locus nucleotide sequences in fasta format.
340+
* **ffn**: Gene nucleotide sequences in fasta format.
341+
* **faa**: Protein sequences in fasta format.
352342

353-
kaptive extract kp_k proteins --filter "^KL(1|2)$" > KL1_KL2_proteins.faa
343+
Usage
344+
----------
345+
General usage is as follows::
354346

355-
If I wanted to do the same but output each locus to a separate file, I would run::
347+
kaptive extract <db> [formats] [options]
356348

357-
kaptive extract kp_k proteins --filter "^KL(1|2)$" -d KL1_KL2_proteins
358-
359-
Which would create two files: ``KL1.faa`` and ``KL2.faa``.
360-
361-
Inputs::
362-
363-
db path/keyword Kaptive database path or keyword
364-
format Format to extract database
365-
- loci: Loci (fasta nucleotide)
366-
- genes: Genes (fasta nucleotide)
367-
- proteins: Proteins (fasta amino acid)
368-
- genbank: Genbank format
369-
370-
.. note::
371-
Combine with ``--filter`` to select loci
349+
Formats::
372350

373-
Output options::
351+
Note, text outputs accept '-' for stdout
374352

375-
-o , --out Output file to write/append loci to (default: stdout)
376-
-d , --outdir Output directory for converted results
377-
- Note: This forces the output to be written to files (instead of stdout)
378-
and one file will be written per locus.
353+
--fna [] Convert to locus nucleotide sequences in fasta format
354+
Accepts a single file or a directory (default: cwd)
355+
--ffn [] Convert to locus gene nucleotide sequences in fasta format
356+
Accepts a single file or a directory (default: cwd)
357+
--faa [] Convert to locus gene protein sequences in fasta format
358+
Accepts a single file or a directory (default: cwd)
379359

380360
.. _Database-options:
381361

@@ -394,3 +374,27 @@ Other options::
394374
-V, --verbose Print debug messages to stderr
395375
-v , --version Show version number and exit
396376
-h , --help Show this help message and exit
377+
378+
For example, to extract the gene nucleotide sequences from the *Klebsiella pneumoniae* K locus primary
379+
reference database in fasta format, run::
380+
381+
kaptive extract kp_k --fna k_loci.fna
382+
383+
To extract all protein sequences from KL1 and KL2, run either one of the following::
384+
385+
kaptive extract kp_k --filter "^KL(1|2)$" --faa KL1_KL2_proteins.faa
386+
kaptive extract kp_k --filter "^KL(1|2)$" --faa - > KL1_KL2_proteins.faa
387+
388+
To do the same but output each locus to a separate file, run either::
389+
390+
kaptive extract kp_k --filter "^KL(1|2)$" --faa
391+
kaptive extract kp_k --filter "^KL(1|2)$" --faa protein_files/
392+
393+
Which would create two files: ``KL1.faa`` and ``KL2.faa``.
394+
395+
kaptive assembly kpsc_k assembly.fasta -j kaptive_results.json
396+
397+
.. warning::
398+
It is possible to write **all** text formats (FNA, FAA and FFN) to the same file (including stdout), however
399+
this is not recommended for downstream analysis.
400+

docs/source/How-does-Kaptive-work?.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/source/How-to-run.rst

Lines changed: 0 additions & 224 deletions
This file was deleted.

docs/source/Installation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Installation
55
Dependencies
66
=============
77

8-
Kaptive requires the following software and libraries to be installed and available in your path:
8+
Kaptive requires the following software and libraries, if installing from source they will need to be installed and
9+
available in your path:
910

1011
* `Python <https://python.org/>`_ >=3.9
1112
* `Biopython <https://biopython.org/>`_ >=1.83
@@ -16,16 +17,15 @@ Kaptive requires the following software and libraries to be installed and availa
1617
Download and install Kaptive
1718
=============================
1819

19-
With pip::
20+
From PyPI::
2021

2122
pip install kaptive
2223

23-
With conda::
24+
From Bioconda::
2425

2526
conda install -c bioconda kaptive
2627

2728
From source::
2829

29-
git clone https://github.com/klebgenomics/Kaptive.git
30-
python -m pip install Kaptive/
30+
pip install git+https://github.com/klebgenomics/Kaptive.git
3131

0 commit comments

Comments
 (0)