The SpeciesFinder tool identifies species from raw sequencing reads (FASTQ) or assembled genomes (FASTA) by comparing them against a database generated using the KMA program. It reports the best matching species, along with additional taxonomic information if that option is selected.
Project description
SPECIESFINDER
The SpeciesFinder tool identifies species from raw sequencing reads (FASTQ) or assembled genomes (FASTA) by comparing them against a k-mer database generated using the KMA program. It reports the best matching species, along with additional taxonomic information if that option is selected.
From KmerFinder to SpeciesFinder - Migration guide
KmerFinder has undergone a major overhaul, and we are introducing a new and improved tool: SpeciesFinder.
The goal of this update is to improve the core functionality, stability, and long-term maintainability of the tool while preserving the underlying algorithm and user experience as much as possible.
Why the change?
Legacy KmerFinder depended heavily on the -Sparse KMA flag. This mode skips full alignment and instead performs a sparse k-mer mapping where scoring is based on k-mer hits. While fast, this approach has limitations and reduces downstream compatibility with other workflows (e.g., phylogenetics).
SpeciesFinder replaces the sparse mapping mode with a more robust and reproducible approach:
-
It uses KMA’s
-mem_mode, which bases ConClave scoring on mappings rather than full alignments—significantly reducing memory usage while maintaining accuracy. -
It also enables:
-
-nf— suppress creation of the fragment file -
-na— suppress output of the alignment file (alignment is still performed internally) -
-1t1— force each query to match to a single best template
-
This update not only improves performance and stability, but also enables future support for global phylogeny generation and other extensions.
What has changed:
- Tool name - SpeciesFinder
- Mapping strategy - No more sparse k-mer mapping (
-Sparse). SpeciesFinder now uses-mem_mode. - Command-line interface - The way the tool is executed has changed (see README usage section).
- Repository name change - SpeciesFinder
What remains the same:
- Versioning scheme
- Algorithmic principles — still based on KMA and ConClave scoring
- Overall purpose — identification of species from FASTQ/FASTA input
Installation
Pypi
# Go to wanted location for SpeciesFinder
cd /path/to/some/dir
pip install SpeciesFinder
Docker
# Go to wanted location for SpeciesFinder
cd /path/to/some/dir
# Clone and enter the SpeciesFinder directory
git clone https://bitbucket.org/genomicepidemiology/speciesfinder.git
cd speciesfinder
Build Docker image from Dockerfile
# Build container
docker build -t speciesfinder .
Dependencies
To run SpeciesFinder without Docker, you’ll need Python 3.5 or later and KMA installed.
The newest version of KMA can be installed from here:
https://bitbucket.org/genomicepidemiology/kma
Download and install SpeciesFinder database(s)
You can find instructions on how to download SpeciesFinder databases here
The databases are destributed as a single compressed archive:
speciesfinder_db.tar.gz
How to run
In order for SpeciesFinder to run, the user needs to specify the input, output, reference_database and, optionally, the extended taxonomic information.
- Input (-i): Single/Paired end reads, Assembly files
- Output (-o): Directory where speciesfinder results will be stored
- Reference database (-db): The reference databases KMA will look for hits. There are 4 options: bacteria, virus, archaea and eukaryotes.
- Taxonomic information (-tax): Taxonomy file with additional data for each template in all databases (family, taxid and organism) - This flag is optional
- Extended Output (-x): More informative output - Needs the -tax flag to run.
Docker
Examples
- Paired end reads
docker run --rm -v $(pwd):/app speciesfinder:latest -i read_1.fastq.gz read_2.fastq.gz -o results -db databases/reference_db/reference_db -x -tax databases/reference_db/reference_db.tax
- Single end reads
docker run --rm -v $(pwd):/app speciesfinder:latest -i read.fastq.gz -o results -db databases/reference_db/reference_db -x -tax databases/reference_db/reference_db.tax
- Assemblies
docker run --rm -v $(pwd):/app speciesfinder:latest -i assembly.fasta -o results -db databases/reference_db/reference_db -x -tax databases/reference_db/reference_db.tax
Pip package
Examples
- Paired end reads
speciesfinder -i read_1.fastq.gz read_2.fastq.gz -o results -db db databases/reference_db/reference_db -x -tax databases/reference_db/reference_db.tax
- Single end reads
speciesfinder -i read_1.fastq.gz -o results -db db databases/reference_db/reference_db -x -tax databases/reference_db/reference_db.tax
- Assemblies
speciesfinder -i assembly.fna -o results -db db databases/reference_db/reference_db -x -tax databases/reference_db/reference_db.tax
Notes: Example of a full command without docker:
speciesfinder -i reads/SRR10016848.fastq.gz -o results -db databases/bacteria_db/bacteria_14_ATG_110126 -x -tax databases/bacteria_db/bacteria_14_ATG_110126.tax
Notes2: Example of a full command with docker:
docker run --rm -v $(pwd):/app speciesfinder:latest -i reads/ERR760549_1.fastq.gz reads/ERR760549_2.fastq.gz -o results -db databases/virus/virus_14_TG_181124 -x -tax databases/virus/virus_14_TG_181124.tax
Notes3: Each reference database has a number of KMA indexed files. The -db flag needs the path of these files (without their extension).
For example in case one is using the bacteria database the files might have the following format:
- bacteria/bacteria_14_ATG_110126.comp.b
- bacteria/bacteria_14_ATG_110126.seq.b
- bacteria/bacteria_14_ATG_110126.length.b
- bacteria/bacteria_14_ATG_110126.name
The db flag will be -db bacteria/bacteria_14_ATG_110126
For example in case one is using the viral database the files might have the following format:
- virus_db/virus_ATG_110128.comp.b
- virus_db/virus_ATG_110128.seq.b
- virus_db/virus_ATG_110128.length.b
- virus_db/virus_ATG_110128.name
The db flag will be -db virus_db/virus_ATG_110128
Web-server
A webserver implementing the methods is available at the CGE website and can be found here:
Soon to come
Citation
When using the method please cite:
Benchmarking of Methods for Genomic Taxonomy. Larsen MV, Cosentino S, Lukjancenko O, Saputra D, Rasmussen S, Hasman H, Sicheritz-Pontén T, Aarestrup FM, Ussery DW, Lund O. J Clin Microbiol. 2014 Feb 26. [Epub ahead of print]
Rapid whole genome sequencing for the detection and characterization of microorganisms directly from clinical samples. Hasman H, Saputra D, Sicheritz-Ponten T, Lund O, Svendsen CA, Frimodt-Møller N, Aarestrup FM. J Clin Microbiol. 2014 Jan;52(1):139-46.
Rapid and precise alignment of raw reads against redundant databases with KMA Philip T.L.C. Clausen, Frank M. Aarestrup, Ole Lund.
License
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file speciesfinder-4.0.3.tar.gz.
File metadata
- Download URL: speciesfinder-4.0.3.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a272ed0510746ffadaa8a1f7a8a2e583b68cc438af3717cdaeeb0eaf4db5a1f
|
|
| MD5 |
2704a3522f036eef887ac0c7265cd61c
|
|
| BLAKE2b-256 |
1267d0801b0103334fcf5436a33e8792f127d8f78df6a1bde69149d61a7802e1
|
File details
Details for the file speciesfinder-4.0.3-py3-none-any.whl.
File metadata
- Download URL: speciesfinder-4.0.3-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d005a84b8c0f22e5d9798d81f29959e1c6433e592d7f93e44b9a26386ae1610
|
|
| MD5 |
e5b929d2d3d84a0965b6cc1f1eda168b
|
|
| BLAKE2b-256 |
5e70efe57a37b5c48235456200ce0a48aa11924ce8132732325f1cd601f32604
|