Machine learning methods to predict the anti-microbial resistance of Salmonella.
- Clone repository (run
git clone https://github.com/superphy/AMR_Predictor.git
) - Download anaconda or miniconda (python 3.7), instructions for that are here
- Install dependecies: run
conda env create -f data/envi.yaml
If you do not have your own MIC labels and would like to use ours (from NCBI SRA May 2019) skip to step 5
If you only want predictions with no evaluations, remove predict/mic_labels.xlsx and skip to step 6
If you have your own mic labels, proceed with step 4
- Name your labels as mic_labels.xlsx and replace predict/mic_labels.xlsx
In mic_labels.xlsx the names of the genomes need to be in a column titled run and the MIC values need to be in columns labeled like MIC_AMP, MIC_AMC, etc
See predict/mic_labels.xlsx for acceptable MIC formats
- Run
snakemake -s predict/mic_clean.smk
- Place genomes in predict/genomes/raw
- Run
snakemake -j X -s predict/predict.smk
where X is the number of cores you wish to use - View results in predict/results.csv or predictions in predict/predictions.csv
-
Clone repository (run
git clone https://github.com/superphy/AMR_Predictor.git
) -
Download anaconda or miniconda (python 3.7), instructions for that are here
-
Install dependecies: run
conda env create -f data/envi.yaml
-
Move public genomes into AMR_Predictor/data/genomes/raw
-
Move grdi genomes in AMR_Predictor/data/grdi_genomes/raw (optional, but remove grdi rules from Snakefile)
-
Start conda environment: run
source activate skmer
-
Run the following command, where 'X' is the number of cores you wish to use
snakemake -j X
-
Run the following command to run all of the tests
snakemake -s src/run_tests.smk
orsnakemake -s src/run_XGB_SVM_tests_slurm.smk && hyperas.smk
(if using slurm) -
Run
all_data_figures.py all
to save all the results as figures
Figures can be found in figures/
To find the results of an individual test, run result_grabber.py --help
- If you would like to annotate the genomes and map back the top features:
run model.py with the -i flag, e.g. python src/model.py -x public -f 1000 -a AMP -i
Set the parameters in annotation/annotate.smk
run snakemake -j X -s annotation/annotate.smk
The resulting annotations and the location of the most import regions to the machine learning models can be found in annotation/
If you do not want to run all tests in step 8 above, run src/model.py --help
to see how to run the model for a specific set of parameters.