annotate resfinder/README.md @ 0:55051a9bc58d draft default tip

Uploaded
author dcouvin
date Mon, 10 Jan 2022 20:06:07 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
1 ResFinder documentation
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
2 =============
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
3
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
4 ResFinder identifies acquired antimicrobial resistance genes in total or partial
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
5 sequenced isolates of bacteria.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
6
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
7 ## Content of the repository
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
8 1. run_resfinder.py - Use this script to run ResFinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
9 2. tests/data - Contains fasta and fastq data for testing. More information in the "Test data" section
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
10 3. scripts/ - All scripts in this directory is unsupported but has been uploaded as they may be useful
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
11 4. cge/ - ResFinder code
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
12 5. dockerfile - Used to build ResFinder docker image (See Docker section near the end)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
13
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
14 ## Installation
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
15 The installation described here will first install the actual ResFinder software,
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
16 then the dependencies, and finally the databases. A more detailed breakdown of the
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
17 installation is provided below:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
18
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
19 1. Install ResFinder tool
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
20 2. Install python modules
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
21 3. Install BLAST (optional)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
22 4. install KMA (optional)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
23 5. Download ResFinder database
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
24 6. Download PointFinder database
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
25 7. Index databases with KMA (if installed)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
26 8. Test installation
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
27
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
28 A small script has been written to automate this process. It is available from the
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
29 scripts directory and is named install_resfinder.sh. It is very simple and might
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
30 not work in all environments. It is only meant as a supplement and no support will
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
31 be provided for any scripts in this directory. However, specific suggestions (with code)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
32 for improvement is very welcome.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
33
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
34 ### ResFinder tool
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
35 Setting up ResFinder script and database
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
36 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
37 # Go to wanted location for resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
38 cd /path/to/some/dir
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
39
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
40 # Clone the latest version and enter the resfinder directory
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
41 git clone https://git@bitbucket.org/genomicepidemiology/resfinder.git
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
42 cd resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
43
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
44 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
45
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
46 ### Dependencies:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
47 Depending on how you plan to run ResFinder BLAST and KMA can be optional.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
48 BLAST is used to analyse assemblies (ie. FASTA files).
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
49 KMA is used to analyse read data (ie. FASTQ files).
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
50
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
51 #### Python modules: Tabulate, BioPython, CGECore and Python-Git
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
52 To install the needed python modules you can use pip
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
53 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
54 pip3 install tabulate biopython cgecore gitpython python-dateutil
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
55 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
56 For more information visit the respective website
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
57 ```url
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
58 https://bitbucket.org/astanin/python-tabulate
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
59 https://biopython.org
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
60 https://bitbucket.org/genomicepidemiology/cge_core_module
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
61 https://gitpython.readthedocs.io/en/stable/index.html
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
62 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
63
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
64 #### BLAST (optional)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
65 If you don't want to specify the path of blastn every time you run
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
66 ResFinder, make sure that blastn is in you PATH.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
67
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
68 Blastn can be obtained from:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
69 ```url
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
70 ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
71 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
72
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
73 #### KMA (optional)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
74 The instructions here will install KMA in the default location ResFinder uses. KMA
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
75 can be installed in another location but the path to KMA will then need to be
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
76 specified every time you run ResFinder unless you add the kma program to your PATH.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
77 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
78 # Go to the directoy in which you installed the ResFinder tool
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
79 cd /path/to/some/dir/resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
80 cd cge
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
81 git clone https://bitbucket.org/genomicepidemiology/kma.git
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
82 cd kma && make
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
83 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
84
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
85 ### Databases
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
86 This section describes how to install the databases at the ResFinder default locations.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
87 The database locations can be changed, but must then be specified to ResFinder at run time.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
88
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
89 #### ResFinder database
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
90 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
91 # Go to the directoy in which you installed the ResFinder tool
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
92 cd /path/to/some/dir/resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
93 git clone https://git@bitbucket.org/genomicepidemiology/resfinder_db.git db_resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
94 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
95
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
96 #### PointFinder database
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
97 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
98 # Go to the directoy in which you installed the ResFinder tool
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
99 cd /path/to/some/dir/resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
100 git clone https://git@bitbucket.org/genomicepidemiology/pointfinder_db.git db_pointfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
101 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
102
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
103 #### Indexing databases with KMA
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
104 If you have KMA installed you either need to have the kma_index in your PATH or
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
105 you need to provide the path to kma_index to INSTALL.py
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
106
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
107 **NOTE**: The documentation given here describes the procedure for the ResFinder database, but the procedure is identical for the PointFinder database.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
108 **PointFinder database documentation**: [https://bitbucket.org/genomicepidemiology/pointfinder_db]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
109
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
110 ##### a) Run INSTALL.py in interactive mode
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
111 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
112 # Go to the database directory
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
113 cd path/to/db_resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
114 python3 INSTALL.py
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
115 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
116 If kma_index was found in your path a lot of indexing information will be
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
117 printed to your terminal, and will end with the word "done".
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
118
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
119 If kma_index wasn't found you will recieve the following output:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
120 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
121 KMA index program, kma_index, does not exist or is not executable
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
122 Please input path to executable kma_index program or choose one of the options below:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
123 1. Install KMA using make, index db, then remove KMA.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
124 2. Exit
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
125 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
126 You can now write the path to kma_index and finish with <enter> or you can
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
127 enter "1" or "2" and finish with <enter>.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
128
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
129 If "1" is chosen, the script will attempt to install kma in your systems
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
130 default temporary location. If the installation is successful it will proceed
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
131 to index your database, when finished it will delete the kma installation again.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
132
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
133 ##### b) Run INSTALL.py in non_interactive mode
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
134 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
135 # Go to the database directory
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
136 cd path/to/resfinder_db
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
137 python3 INSTALL.py /path/to/kma_index non_interactive
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
138 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
139 The path to kma_index can be omitted if it exists in PATH or if the script
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
140 should attempt to do an automatic temporary installation of KMA.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
141
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
142 ##### c) Index database manually (not recommended)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
143 It is possible to index the databases manually, but is generally not recommended
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
144 as it is more prone to error. If you choose to do so, be aware of the naming of
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
145 the indexed files.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
146
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
147 This is an example of how to index the ResFinder database files:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
148 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
149 # Go to the resfinder database directory
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
150 cd path/to/resfinder_db
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
151 # create indexing directory
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
152 mkdir kma_indexing
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
153 # Index files using kma_index
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
154 kma_index -i db_resfinder/fusidicacid.fsa -o db_resfinder/kma_indexing/fusidicacid
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
155 kma_index -i db_resfinder/phenicol.fsa -o db_resfinder/kma_indexing/phenicol
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
156 kma_index -i db_resfinder/glycopeptide.fsa -o db_resfinder/kma_indexing/glycopeptide
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
157 kma_index -i db_resfinder/trimethoprim.fsa -o db_resfinder/kma_indexing/trimethoprim
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
158 kma_index -i db_resfinder/oxazolidinone.fsa -o db_resfinder/kma_indexing/oxazolidinone
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
159 kma_index -i db_resfinder/tetracycline.fsa -o db_resfinder/kma_indexing/tetracycline
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
160 kma_index -i db_resfinder/quinolone.fsa -o db_resfinder/kma_indexing/quinolone
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
161 kma_index -i db_resfinder/nitroimidazole.fsa -o db_resfinder/kma_indexing/nitroimidazole
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
162 kma_index -i db_resfinder/fosfomycin.fsa -o db_resfinder/kma_indexing/fosfomycin
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
163 kma_index -i db_resfinder/aminoglycoside.fsa -o db_resfinder/kma_indexing/aminoglycoside
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
164 kma_index -i db_resfinder/macrolide.fsa -o db_resfinder/kma_indexing/macrolide
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
165 kma_index -i db_resfinder/sulphonamide.fsa -o db_resfinder/kma_indexing/sulphonamide
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
166 kma_index -i db_resfinder/rifampicin.fsa -o db_resfinder/kma_indexing/rifampicin
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
167 kma_index -i db_resfinder/colistin.fsa -o db_resfinder/kma_indexing/colistin
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
168 kma_index -i db_resfinder/beta-lactam.fsa -o db_resfinder/kma_indexing/beta-lactam
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
169 # Go to the pointfinder database directory
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
170 cd path/to/pointfinder_db
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
171 # Index files using kma_index
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
172 kma_index -i db_pointfinder/campylobacter/*.fsa -o db_pointfinder/campylobacter/campylobacter
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
173 kma_index -i db_pointfinder/escherichia_coli/*.fsa -o db_pointfinder/escherichia_coli/escherichia_coli
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
174 kma_index -i db_pointfinder/enterococcus_faecalis/*.fsa -o db_pointfinder/enterococcus_faecalis/enterococcus_faecalis
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
175 kma_index -i db_pointfinder/enterococcus_faecium/*.fsa -o db_pointfinder/enterococcus_faecium/enterococcus_faecium
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
176 kma_index -i db_pointfinder/neisseria_gonorrhoeae/*.fsa -o db_pointfinder/neisseria_gonorrhoeae/neisseria_gonorrhoeae
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
177 kma_index -i db_pointfinder/salmonella/*.fsa -o db_pointfinder/salmonella/salmonella
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
178 kma_index -i db_pointfinder/mycobacterium_tuberculosis/*.fsa -o db_pointfinder/mycobacterium_tuberculosis/mycobacterium_tuberculosis
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
179 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
180
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
181 ### Test ResFinder intallation
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
182 (This will not function with the docker installation.)
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
183 If you did not install BLAST, test 1 and 3 will fail. If you did not install KMA, test 2
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
184 and 4 will fail.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
185 The 4 tests will in total take approximately take 5-60 seconds, depending on your system.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
186 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
187 # Go to the directoy in which you installed the ResFinder tool
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
188 cd /path/to/some/dir/resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
189
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
190 # For seeing the unittest options for running the tests
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
191 python3 tests/functional_tests.py -h
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
192
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
193 # In case you need to point blastn or kma, or the resfinder or the pointfinder databases as they are not in the places indicated above, see the optional arguments for the test by:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
194 python3 tests/functional_tests.py -res_help
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
195
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
196 #Which outputs:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
197 usage: functional_tests.py [-res_help] [-db_res DB_PATH_RES] [-b BLAST_PATH]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
198 [-k KMA_PATH] [-db_point DB_PATH_POINT]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
199
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
200 Options:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
201 -res_help, --resfinder_help
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
202 -db_res DB_PATH_RES, --db_path_res DB_PATH_RES
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
203 Path to the databases for ResFinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
204 -b BLAST_PATH, --blastPath BLAST_PATH
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
205 Path to blastn
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
206 -k KMA_PATH, --kmaPath KMA_PATH
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
207 Path to KMA
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
208 -db_point DB_PATH_POINT, --db_path_point DB_PATH_POINT
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
209 Path to the databases for PointFinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
210
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
211 # Run tests
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
212 python3 tests/functional_tests.py
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
213
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
214 # Output from successful tests
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
215 ....
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
216 ----------------------------------------------------------------------
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
217 Ran 4 tests in 8.263s
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
218
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
219 OK
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
220 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
221
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
222 ### Test data
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
223 Test data can be found in the sub-dierectory /tests/data
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
224
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
225 ## Usage
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
226
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
227 You can run resfinder command line using python3.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
228
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
229 **NOTE**: Species should be entered with their full scientific names (e.g. "escherichia coli"), using quotation marks, not case sensitive.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
230 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.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
231
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
232
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
233 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
234
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
235 # Example of running resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
236 python3 run_resfinder.py -o path/to/outdir -s "Escherichia coli" -l 0.6 -t 0.8 --acquired --point -ifq test_isolate_01_*
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
237
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
238 # The program can be invoked with the -h option
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
239 usage: run_resfinder.py [-h] [-ifa INPUTFASTA]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
240 [-ifq INPUTFASTQ [INPUTFASTQ ...]] [-scripts SCRIPTS]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
241 [-o OUT_PATH] [-b BLAST_PATH] [-k KMA_PATH]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
242 [-s SPECIES] [-l MIN_COV] [-t THRESHOLD]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
243 [-db_res DB_PATH_RES] [-db_res_kma DB_PATH_RES_KMA]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
244 [-d DATABASES] [-acq] [-c] [-db_point DB_PATH_POINT]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
245 [-g SPECIFIC_GENE [SPECIFIC_GENE ...]] [-u]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
246
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
247 optional arguments:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
248 -h, --help show this help message and exit
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
249 -ifa INPUTFASTA, --inputfasta INPUTFASTA
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
250 Input fasta file.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
251 -ifq INPUTFASTQ [INPUTFASTQ ...], --inputfastq INPUTFASTQ [INPUTFASTQ ...]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
252 Input fastq file(s). Assumed to be single-end fastq if
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
253 only one file is provided, and assumed to be paired-
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
254 end data if two files are provided.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
255 -o OUT_PATH, --outputPath OUT_PATH
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
256 All output will be stored in this directory.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
257 -b BLAST_PATH, --blastPath BLAST_PATH
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
258 Path to blastn
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
259 -k KMA_PATH, --kmaPath KMA_PATH
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
260 Path to kma
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
261 -s SPECIES, --species SPECIES
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
262 Species in the sample
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
263 Available species: Campylobacter, Campylobacter jejuni, Campylobacter coli,
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
264 Enterococcus faecalis, Enterococcus faecium, Escherichia coli, Helicobacter pylori,
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
265 Klebsiella, Mycobacterium tuberculosis, Neisseria gonorrhoeae,
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
266 Plasmodium falciparum, Salmonella, Salmonella enterica, Staphylococcus aureus
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
267 -s "Other" can be used for metagenomic samples or samples with unknown species.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
268 -db_res DB_PATH_RES, --db_path_res DB_PATH_RES
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
269 Path to the databases for ResFinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
270 -db_res_kma DB_PATH_RES_KMA, --db_path_res_kma DB_PATH_RES_KMA
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
271 Path to the ResFinder databases indexed with KMA.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
272 Defaults to the 'kma_indexing' directory inside the
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
273 given database directory.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
274 -d DATABASES, --databases DATABASES
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
275 Databases chosen to search in - if none is specified
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
276 all is used
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
277 -acq, --acquired Run resfinder for acquired resistance genes
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
278 -l MIN_COV, --min_cov MIN_COV
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
279 Minimum (breadth-of) coverage of ResFinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
280 Valid interval: 0.00-1.00
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
281 -t THRESHOLD, --threshold THRESHOLD
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
282 Threshold for identity of ResFinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
283 Valid interval: 0.00-1.00
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
284 -c, --point Run pointfinder for chromosomal mutations
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
285 -db_point DB_PATH_POINT, --db_path_point DB_PATH_POINT
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
286 Path to the databases for PointFinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
287 -g SPECIFIC_GENE [SPECIFIC_GENE ...]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
288 Specify genes existing in the database to search for -
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
289 if none is specified all genes are included in the
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
290 search.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
291 -u, --unknown_mut Show all mutations found even if in unknown to the
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
292 resistance database
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
293 -l_p MIN_COV_POINT, --min_cov_point MIN_COV_POINT
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
294 Minimum (breadth-of) coverage of Pointfinder. If None
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
295 is selected, the minimum coverage of ResFinder will be
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
296 used.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
297 -t_p THRESHOLD_POINT, --threshold_point THRESHOLD_POINT
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
298 Threshold for identity of Pointfinder. If None is
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
299 selected, the minimum coverage of ResFinder will be
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
300 used.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
301
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
302 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
303
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
304 ### Web-server
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
305
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
306 A webserver implementing the methods is available at the [CGE
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
307 website](http://www.genomicepidemiology.org/) and can be found here:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
308 https://cge.cbs.dtu.dk/services/ResFinder/
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
309
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
310 ### Install ResFinder with Docker
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
311 If you would like to build a docker image with ResFinder, make sure you have cloned the ResFinder directory as well as installed and indexed the databases: `db_pointfinder` and `db_resfinder`. Then run the following commands:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
312 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
313 # Go to ResFinder directory
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
314 cd path/to/resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
315 # Build docker image with name resfinder
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
316 docker build -t resfinder .
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
317 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
318 When running the docker make sure to mount the `db_resfinder` and the `db_pointfinder` with the flag -v, as shown in the examples below.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
319
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
320 You can test the installation by running the docker with the test files:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
321 ```bash
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
322 cd path/to/resfinder/
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
323 mkdir results
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
324
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
325 # Run with raw data (this command mounts the results to the local directory "results")
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
326 docker run --rm -it -v $(pwd)/db_resfinder/:/usr/src/db_resfinder -v $(pwd)/results/:/usr/src/results resfinder -ifq /usr/src/tests/data/test_isolate_01_1.fq /usr/src/tests/data/test_isolate_01_2.fq -acq -db_res /usr/src/db_resfinder -o /usr/src/results
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
327
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
328 # Run with assembled data (this command mounts the results to the local directory "results")
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
329 docker run --rm -it -v $(pwd)/db_resfinder/:/usr/src/db_resfinder -v $(pwd)/results/:/usr/src/results resfinder -ifa /usr/src/tests/data/test_isolate_01.fa -acq -db_res /usr/src/db_resfinder -o /usr/src/results
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
330 ```
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
331
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
332 Citation
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
333 =======
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
334
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
335 When using the method please cite:
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
336
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
337 ResFinder 4.0 for predictions of phenotypes from genotypes.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
338 Bortolaia V, Kaas RF, Ruppe E, Roberts MC, Schwarz S, Cattoir V, Philippon A, Allesoe RL, Rebelo AR, Florensa AR, Fagelhauer L,
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
339 Chakraborty T, Neumann B, Werner G, Bender JK, Stingl K, Nguyen M, Coppens J, Xavier BB, Malhotra-Kumar S, Westh H, Pinholt M,
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
340 Anjum MF, Duggett NA, Kempf I, Nyk�senoja S, Olkkola S, Wieczorek K, Amaro A, Clemente L, Mossong J, Losch S, Ragimbeau C, Lund O, Aarestrup FM.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
341 Journal of Antimicrobial Chemotherapy. 2020 Aug 11.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
342 PMID: 32780112 doi: 10.1093/jac/dkaa345
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
343 [Epub ahead of print]
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
344
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
345 References
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
346 =======
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
347
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
348 1. Camacho C, Coulouris G, Avagyan V, Ma N, Papadopoulos J, Bealer K, Madden TL. BLAST+: architecture and applications. BMC Bioinformatics 2009; 10:421.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
349 2. Clausen PTLC, Aarestrup FM, Lund O. Rapid and precise alignment of raw reads against redundant databases with KMA. BMC Bioinformatics 2018; 19:307.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
350
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
351 License
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
352 =======
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
353
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
354 Licensed under the Apache License, Version 2.0 (the "License");
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
355 you may not use this file except in compliance with the License.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
356 You may obtain a copy of the License at
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
357
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
358 http://www.apache.org/licenses/LICENSE-2.0
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
359
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
360 Unless required by applicable law or agreed to in writing, software
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
361 distributed under the License is distributed on an "AS IS" BASIS,
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
362 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
363 See the License for the specific language governing permissions and
55051a9bc58d Uploaded
dcouvin
parents:
diff changeset
364 limitations under the License.