Package: kameris
KamerisA fast, user-friendly analysis and evaluation pipeline for some DNA sequence classification tasks.InstallingThere 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):Runpip install kameris.2. If you do not have Python installed or are unable to install software:Click hereand download the version corresponding to your operating system.
If you use Linux or macOS, you may need to runchmod +x "path to downloaded program".3. If you are a developer or want to build your own version of Kameris:Clone this repository then runmake install.CitingIf 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 genomesStephen Solis-Reyes, Mariano Avino, Art Poon, Lila Karihttps://www.biorxiv.org/content/early/2018/07/05/362780Quick demoThis 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 option1above and the commandkamerisdoesn't work for you, try usingpython -m kamerisinstead.
If you followed option2above and downloaded an executable, replacekamerisin the instructions below with the name of the executable you downloaded.Classifying sequences with an existing modelFirst, 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.Runkameris classify hiv1-mlp "path to extracted files"This will output the top subtype match for each sequence and write all results to a new fileresults.json.Thehiv1-mlpmodel 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, trykameris classify hiv1-linearsvm "path to extracted files"To see other available models, go tohttps://github.com/stephensolis/kameris-experiments/tree/master/models.Training a new modelNow, let's train our own HIV-1 sequence classification models.Create an empty folder and open a terminal in the folder.Runkameris run-job https://raw.githubusercontent.com/stephensolis/kameris/master/demo/hiv1-lanl.yml https://raw.githubusercontent.com/stephensolis/kameris/master/demo/settings.ymlDepending 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 thehiv1/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, openoutput/hiv1-lanl-whole. You will notice folders were created for each value ofk. Within each folder are several files:fastacontains the FASTA files extracted from the downloaded dataset used for model training and evaluation.metadata.jsoncontains metadata on the FASTA files used to determine the class for each sequence.cgrs.mm-reprcontains feature vectors for each sequence. See the mentioned paper for more details on the computation of the vectors, andkameris-formatsfor reader/writer implementations and a description of the file format.classification-kmers.jsoncontains evaluation results after using cross-validation on the dataset. See the mentioned paper for more technical details.The.mm-modelfiles contain trained models which may be passed tokameris classifyin order to classify new sequences.Notethat models trained using Python 2 will not run under Python 3 and vice-versa.log.txtis a log file containing all the output printed during job execution.rerun-experiment.ymlis a file which may be passed tokameris run-jobin 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 runningkameris summarize output/hiv1-lanl-whole.You can change the settings used to train the model: first download the fileshiv1-lanl.ymlandsettings.yml.
Training settings are found inhiv1-lanl.yml-- try changing the value ofkor uncommenting different classifier types.
File storage and logging settings are found insettings.yml.
After making changes, runkameris run-job hiv1-lanl.yml settings.ymlto train your model.DependenciesThis project uses:stephensolis/kameris-backendto generate k-mer count vectors and distance matricesscikit-learnfor supervised classifiersWolfram Mathematicaand code based onstephensolis/modmap-generatorto generate interactive plotsNumPyandSciPyfor MultiDimensional Scaling (MDS)LicenseThe 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.