Package: resfinder
ResFinder documentationResFinder identifies acquired antimicrobial resistance genes in total or partial
sequenced isolates of bacteria.Important if you are updating from a previous ResFinder versionIt is no longer recommended to clone the ResFinder bitbucket repository unless you plan to do development work on ResFinder.Instead we recommend installing ResFinder using pip as described below.There are several good reasons why the recommended installation procedure has changed, among those are the increasing size of the repository that has risen to several hundreds of megabytes, due to the long history of ResFinder. Its easier for users. And it makes sure your installation will be a tested release of the application.InstallationResFinder consists of an application and 1-3 databases. The databases can be used without the application, but not the other way around. Below ResFinder, the application, will be installed first and then the databases will be installed and configured to work with ResFinder the application.DependenciesResFinder uses two external alignment tools that must be installed.BLASTKMABLASTIf you don't want to specify the path of BLAST every time you run ResFinder, make sure that "blastn" is in you PATH or set the environment variable specified in the "Environment Variables Table" in this README.Blastn can be obtained from:https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/# Example of how to set the environment variable in the bash shell. Remember this is only temporary, if you want it set every time you log in you need to add this line to your .bashrc, .zshrc file.exportCGE_BLASTN="/path/to/some/dir/blastn"KMAIf you don't want to specify the path of KMA every time you run ResFinder, make sure that KMA is in you PATH or set the environment variable specified in the "Environment Variables Table" in this README.KMA can be obtained from:https://bitbucket.org/genomicepidemiology/kma.git# Example of how to set the environment variable in the bash shell. Remember this is only temporary, if you want it set every time you log in you need to add this line to  your .bashrc, .zshrc file.exportCGE_KMA="/path/to/some/dir/kma/kma"Install ResFinder the application using pipImportant: This will install ResFinder in the environment where you run pip and potenitally update the python modules ResFinder depends on. It is recommended to run ResFinder in its own environment, in order to avoid breaking existing installations and prevent ResFinder from getting broken by future unrelated pip installations. This is described in the optional step below.Optional: Create virtual environmentGo to the location where you want to store your environment.# Create environmentpython3-mvenvresfinder_env# Activate environmentsourceresfinder_env/bin/activate# When you are finished using ResFinder deactivate the environmentdeactivateInstall ResFinderpipinstallresfinderDatabasesIf you don't want to specify the path to the databases every time you run ResFinder, you need to set the environment variable specified in the "Environment Variables Table" in this README.Go to the location where you want to store the databases. Clone the datbases you need.Note: We are currently working on hosting tarballed versions of the databases that can be downloaded, so that cloning can be avoided.gitclonehttps://bitbucket.org/genomicepidemiology/resfinder_db/
gitclonehttps://bitbucket.org/genomicepidemiology/pointfinder_db/
gitclonehttps://bitbucket.org/genomicepidemiology/disinfinder_db/Set approximate environment variables.# Example of how to set the environment variable in the bash shell. Remember this is only temporary, if you want it set every time you log in you need to add this line to for example your .bashrc file.exportCGE_RESFINDER_RESGENE_DB="/path/to/some/dir/resfinder_db"exportCGE_RESFINDER_RESPOINT_DB="/path/to/some/dir/pointfinder_db"exportCGE_DISINFINDER_DB="/path/to/some/dir/disinfinder_db"Install ResFinder with DockerThe ResFinder application and the 3 databases has been build into a single image on docker hub named "genomicepidemiology/resfinder". Below is an example run, where the current working directory is bound to the container "/app" path which is the container working directory.dockerrun-v"$(pwd):/app"genomicepidemiology/resfinder-ifadata/test_isolate_01.fa-otest1-secoli--acquired--pointTest dataTest data can be found in the sub-directory tests/dataUsageYou can run resfinder command line using python.NOTE: Species should be entered with their full scientific names (e.g. "escherichia coli"), using quotation marks, not case sensitive.
An attempt has been made to capture some deviations like "ecoli" and "e.coli", but it is far from all deviations that will be captured.# Example of running resfinderpython-mresfinder-opath/to/outdir-s"Escherichia coli"-l0.6-t0.8--acquired--point-ifqtest_isolate_01_*# The program can be invoked with the -h optionusage:__main__.py[-h][-ifaINPUTFASTA][-ifqINPUTFASTQ[INPUTFASTQ...]][--nanopore]-oOUTPUTPATH[-jOUT_JSON][-bBLASTPATH][-kKMAPATH][-sSPECIES][--ignore_missing_species][-db_resDB_PATH_RES][-db_res_kmaDB_PATH_RES_KMA][-acq][-aoACQ_OVERLAP][-lMIN_COV][-tTHRESHOLD][-d][-db_disinfDB_PATH_DISINF][-db_disinf_kmaDB_PATH_DISINF_KMA][-c][-db_pointDB_PATH_POINT][-db_point_kmaDB_PATH_POINT_KMA][-gSPECIFIC_GENE[SPECIFIC_GENE...]][-u][-l_pMIN_COV_POINT][-t_pTHRESHOLD_POINT][--ignore_indels][--ignore_stop_codons][-v][--pickle]options:-h,--helpshowthishelpmessageandexit-ifaINPUTFASTA,--inputfastaINPUTFASTAInputfastafile.-ifqINPUTFASTQ[INPUTFASTQ...],--inputfastqINPUTFASTQ[INPUTFASTQ...]Inputfastqfile(s).Assumedtobesingle-endfastqifonlyonefileisprovided,andassumedtobepaired-enddataiftwofilesareprovided.--nanoporeIfnanoporedataisused-oOUTPUTPATH,--outputPathOUTPUTPATHOutputdirectory.Ifitdoesntexist,itwillbecreated.-jOUT_JSON,--out_jsonOUT_JSONSpecifyJSONfilenameandoutputdirectory.Ifthedirectorydoesntexist,itwillbecreated.-bBLASTPATH,--blastPathBLASTPATHPathtoblastn-kKMAPATH,--kmaPathKMAPATHPathtoKMA-sSPECIES,--speciesSPECIESSpeciesinthesample--ignore_missing_speciesIfset,speciesisprovidedand--pointflagisset,willnotthrowanerrorifnodatabaseisfoundfortheprovidedspecies.Ifspeciesisnotfound.Pointmutationswillsilentlybeignored.-db_resDB_PATH_RES,--db_path_resDB_PATH_RESPathtothedatabasesforResFinder.-db_res_kmaDB_PATH_RES_KMA,--db_path_res_kmaDB_PATH_RES_KMAPathtotheResFinderdatabasesindexedwithKMA.Defaultstothevalueofthe--db_resflag.-acq,--acquiredRunresfinderforacquiredresistancegenes-aoACQ_OVERLAP,--acq_overlapACQ_OVERLAPGenesareallowedtooverlapthisnumberofnucleotides.Default:30.-lMIN_COV,--min_covMIN_COVMinimum(breadth-of)coverageofResFinderwithintherange0-1.-tTHRESHOLD,--thresholdTHRESHOLDThresholdforidentityofResFinderwithintherange0-1.-d,--disinfectantRunresfinderfordisinfectantresistancegenes-db_disinfDB_PATH_DISINF,--db_path_disinfDB_PATH_DISINFPathtothedatabasesforDisinFinder.-db_disinf_kmaDB_PATH_DISINF_KMA,--db_path_disinf_kmaDB_PATH_DISINF_KMAPathtotheDisinFinderdatabasesindexedwithKMA.Defaultstothevalueofthe--db_resflag.-c,--pointRunpointfinderforchromosomalmutations-db_pointDB_PATH_POINT,--db_path_pointDB_PATH_POINTPathtothedatabasesforPointFinder-db_point_kmaDB_PATH_POINT_KMA,--db_path_point_kmaDB_PATH_POINT_KMAPathtothePointFinderdatabasesindexedwithKMA.Defaultstothevalueofthe--db_path_pointflag.-gSPECIFIC_GENE[SPECIFIC_GENE...],--specific_geneSPECIFIC_GENE[SPECIFIC_GENE...]Specifygenesexistinginthedatabasetosearchfor-ifnoneisspecifiedallgenesareincludedinthesearch.-u,--unknown_mutShowallmutationsfoundevenifinunknowntotheresistancedatabase-l_pMIN_COV_POINT,--min_cov_pointMIN_COV_POINTMinimum(breadth-of)coverageofPointfinderwithintherange0-1.IfNoneisselected,theminimumcoverageofResFinderwillbeused.-t_pTHRESHOLD_POINT,--threshold_pointTHRESHOLD_POINTThresholdforidentityofPointfinderwithintherange0-1.IfNoneisselected,theminimumcoverageofResFinderwillbeused.--ignore_indelsIgnoreframeshift-causingindelsinPointfinder.--ignore_stop_codonsIgnoreprematurestopcodonsinPointfinder.-v,--versionShowprogramsversionnumberandexit--pickleCreateapickledumpoftheIsolateobject.CurrentlyneededintheCGEwebserver.Dependencyandthisoptionisbeingremoved.Environment VariablesEnvironment variables recognized by ResFinder, the flag they replace and the default value for the flag. Provided commandline flags will always take precedence. Set environment variables takes precedence over default flag values.Additional Environment variables can be added by appending entries to the file named "environment_variables.md".Environment Variables TableEnvironment VariabelFlagDefault ValueCGE_KMAkmaPathkmaCGE_BLASTNblastPathblastnCGE_RESFINDER_RESGENE_DBdb_path_resNoneCGE_RESFINDER_RESPOINT_DBdb_path_pointNoneCGE_RESFINDER_GENE_COVmin_cov0.60CGE_RESFINDER_GENE_IDthreshold0.80CGE_RESFINDER_POINT_COVmin_cov_point0.60CGE_RESFINDER_POINT_IDthreshold_point0.80CGE_DISINFINDER_DBdb_path_disinfNoneCGE_DISINFINDER_DB_KMAdb_path_disinf_kmakmaSpecies AbbreviationsResFinder understands the species abbreviations listed in the Species Abbreviations Table. Additional species abbreviations can be added by appending entries to the file "species_abbreviations.md".Species Abbreviations TableSpeciesAbbreviationcampylobacter jejunic. jejunicampylobacter jejunic.jejunicampylobacter jejunic jejunicampylobacter jejunicjejunicampylobacter colic. colicampylobacter colic.colicampylobacter colic colicampylobacter coliccoliescherichia colie. coliescherichia colie.coliescherichia colie coliescherichia coliecolisalmonella entericas. entericasalmonella entericas.entericasalmonella entericas entericasalmonella entericasentericaWeb-serverA webserver implementing the methods is available at theCGE
websiteand can be found here:https://cge.food.dtu.dk/services/ResFinder/ResFinder result filesResFinder outputs several files. A brief description of these is given below.pheno_table_species.txt: table with species specific AMR phenotypes.pheno_table.txt: table with all AMR phenotypes.PointFinder_prediction.txt: tab seperated table. 1 is given to a predicted resistance against an antibiotic class, 0 is given to not resistance detected.PointFinder_results.txt: tab seperated table with predicted point mutations leading to antibiotic resistance.PointFinder_table.txt: predicted point mutations grouped into genes to which they belong.ResFinder_Hit_in_genome_seq.fsa: fasta sequence of resistance gene hits found in the input data (query).ResFinder_Resistance_gene_seq.fsa: fasta sequence of resistance gene hits found in the database (reference).ResFinder_results_table.txt: predicted resistance genes grouped by antibiotic class.ResFinder_results_tab.txt: tab seperated table with predicted resistance genes.ResFinder_results.txt: predicted resistance genes grouped by antibiotic class and hit alignments to reference resistance genes.<input_filename>.json: Output written to a CGE standardized json file. All results can be derived from this file. The format is defined here:https://bitbucket.org/genomicepidemiology/cgelib/src/master/src/cgelib/output/templates_json/beone/CitationWhen using the method please cite:ResFinder 4.0 for predictions of phenotypes from genotypes.Bortolaia V, Kaas RS, Ruppe E, Roberts MC, Schwarz S, Cattoir V, Philippon A, Allesoe RL, Rebelo AR, Florensa AR, Fagelhauer L,
Chakraborty T, Neumann B, Werner G, Bender JK, Stingl K, Nguyen M, Coppens J, Xavier BB, Malhotra-Kumar S, Westh H, Pinholt M,
Anjum MF, Duggett NA, Kempf I, Nykasenoja S, Olkkola S, Wieczorek K, Amaro A, Clemente L, Mossong J, Losch S, Ragimbeau C, Lund O, Aarestrup FM.
Journal of Antimicrobial Chemotherapy. 2020 Aug 11.PMID: 32780112			doi: 10.1093/jac/dkaa345[Epub ahead of print]ReferencesCamacho C, Coulouris G, Avagyan V, Ma N, Papadopoulos J, Bealer K, Madden TL. BLAST+: architecture and applications. BMC Bioinformatics 2009; 10:421.Clausen PTLC, Aarestrup FM, Lund O. Rapid and precise alignment of raw reads against redundant databases with KMA. BMC Bioinformatics 2018; 19:307.LicenseLicensed 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 athttp://www.apache.org/licenses/LICENSE-2.0Unless 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.