A fast, user-friendly analysis and evaluation pipeline for some DNA sequence classification tasks.
Project description
Kameris
A fast, user-friendly analysis and evaluation pipeline for some DNA sequence classification tasks.
Installing
There are three ways to install this software. Choose whichever one is best for your needs:
1. If you already have Python 2.7 or 3.4+ installed (recommended):
Run pip install kameris
.
2. If you do not have Python installed or are unable to install software:
Click here and download the version corresponding to your operating system.
If you use Linux or macOS, you may need to run chmod +x "path to downloaded program"
.
3. If you are a developer or want to build your own version of Kameris:
Clone this repository then run make install
.
Citing
If you use this software in your research, please cite:
An open-source k-mer based machine learning tool for fast and accurate subtyping of HIV-1 genomes
Stephen Solis-Reyes, Mariano Avino, Art Poon, Lila Kari
https://www.biorxiv.org/content/early/2018/07/05/362780
Quick demo
This software is able to train sequence classification models and use them to make predictions.
Before following these instructions, make sure you've installed the software.
If you followed option 1 above and the command kameris
doesn't work for you, try using python -m kameris
instead.
If you followed option 2 above and downloaded an executable, replace kameris
in the instructions below with the name of the executable you downloaded.
Classifying sequences with an existing model
First, let's classify some HIV-1 sequences.
- Start by downloading this zip file containing HIV-1 genomes, and extract it to a folder: https://raw.githubusercontent.com/stephensolis/kameris/master/demo/hiv1-genomes.zip.
- Run
kameris classify hiv1-mlp "path to extracted files"
This will output the top subtype match for each sequence and write all results to a new file results.json
.
The hiv1-mlp
model is able to give class probabilities and a ranked list of predictions, but some models are only able to report the top match. For example, try kameris classify hiv1-linearsvm "path to extracted files"
To see other available models, go to https://github.com/stephensolis/kameris-experiments/tree/master/models.
Training a new model
Now, let's train our own HIV-1 sequence classification models.
- Create an empty folder and open a terminal in the folder.
- Run
kameris run-job https://raw.githubusercontent.com/stephensolis/kameris/master/demo/hiv1-lanl.yml https://raw.githubusercontent.com/stephensolis/kameris/master/demo/settings.yml
Depending on your computer's performance and internet speed, it may take 5-10 minutes to run. This will automatically download the required datasets and train a simpler version of the hiv1/lanl-whole experiment from kameris-experiments. This was the exact job used to train the models from the previous section, and these are the same models used in the paper "An open-source k-mer based machine learning tool for fast and accurate subtyping of HIV-1 genomes".
Now, open output/hiv1-lanl-whole
. You will notice folders were created for each value of k
. Within each folder are several files:
fasta
contains the FASTA files extracted from the downloaded dataset used for model training and evaluation.metadata.json
contains metadata on the FASTA files used to determine the class for each sequence.cgrs.mm-repr
contains feature vectors for each sequence. See the mentioned paper for more details on the computation of the vectors, and kameris-formats for reader/writer implementations and a description of the file format.classification-kmers.json
contains evaluation results after using cross-validation on the dataset. See the mentioned paper for more technical details.- The
.mm-model
files contain trained models which may be passed tokameris classify
in order to classify new sequences. Note that models trained using Python 2 will not run under Python 3 and vice-versa. log.txt
is a log file containing all the output printed during job execution.rerun-experiment.yml
is a file which may be passed tokameris run-job
in order to re-run the job and obtain exactly the files found in this directory.
Kameris also includes functionality to summarize results in easy-to-read tables. Try it by running kameris summarize output/hiv1-lanl-whole
.
You can change the settings used to train the model: first download the files hiv1-lanl.yml and settings.yml.
Training settings are found in hiv1-lanl.yml
-- try changing the value of k
or uncommenting different classifier types.
File storage and logging settings are found in settings.yml
.
After making changes, run kameris run-job hiv1-lanl.yml settings.yml
to train your model.
Dependencies
This project uses:
- stephensolis/kameris-backend to generate k-mer count vectors and distance matrices
- scikit-learn for supervised classifiers
- Wolfram Mathematica and code based on stephensolis/modmap-generator to generate interactive plots
- NumPy and SciPy for MultiDimensional Scaling (MDS)
License
The MIT License (MIT)
Copyright (c) 2017 Stephen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file kameris-1.2.3-py2.py3-none-win_amd64.whl
.
File metadata
- Download URL: kameris-1.2.3-py2.py3-none-win_amd64.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 2, Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d13bb7b60e2c347522da0b87db6367df29b775af953c3ff92a852d2636753722 |
|
MD5 | f224c2dd01883f2f02ea5685ae94557c |
|
BLAKE2b-256 | 5dbad39760d35ebfd11138b821da3f9e4f7d34c4853d9400ec8f98cd50a4fdea |
File details
Details for the file kameris-1.2.3-py2.py3-none-manylinux1_x86_64.whl
.
File metadata
- Download URL: kameris-1.2.3-py2.py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 6.1 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c03f8b60bf405b926b86428119f4ae9cb1c696b53e93a160765f9508e3f893eb |
|
MD5 | 30ebafcf670a32cae85b46dfcd52ca35 |
|
BLAKE2b-256 | 50238895357108800cd3e606627f447fc1385d7af557f34940e0e2764d170358 |
File details
Details for the file kameris-1.2.3-py2.py3-none-macosx_10_6_intel.whl
.
File metadata
- Download URL: kameris-1.2.3-py2.py3-none-macosx_10_6_intel.whl
- Upload date:
- Size: 416.9 kB
- Tags: Python 2, Python 3, macOS 10.6+ intel
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25a6ef2852e8c9d731298078664568abbdbe54d4971d83ac6de305a0c895a031 |
|
MD5 | 81d134c671848e6592314aa283fa9213 |
|
BLAKE2b-256 | 64c8c76e89ecdf3ba96557d33bf896438242634aaf0cc09c348da10a528089a6 |