summaryrefslogtreecommitdiff
path: root/python-arg-ranker.spec
blob: 37e1a968b190750f4a1fd345d2e7e5fa448854a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
%global _empty_manifest_terminate_build 0
Name:		python-arg-ranker
Version:	3.3
Release:	1
Summary:	Ranking the risk of antibiotic resistance for genomes/metagenomes
License:	MIT
URL:		https://github.com/caozhichongchong/ARG_Ranker
Source0:	https://mirrors.aliyun.com/pypi/web/packages/98/7d/cc0ec417cd56279c677763dd177b7dbb158014239048dcdb68f78177fb07/arg_ranker-3.3.tar.gz
BuildArch:	noarch


%description
# arg_ranker
arg_ranker evaluates the risk of ARGs in genomes and metagenomes

## Install
experimental version using SARGv3\
`pip install arg_ranker`\
Long term support version using SARGv1\
`pip install arg-ranker==3.0.2`
### Please make sure to install arg_ranker >= v3
To all users,\
We have noticed an error of arg_ranker.v2 when reporting the total ARG abundance in metagenomes.\
If the total abundance is used in your research, please update arg_ranker to v3 and re-run your metagenomes (`arg_ranker -i $INPUT -kkdb $KRAKENDB`).\
Alternatively, you can fix arg_ranker.v2 by replacing its original ARG_table.sum.py with [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py)\
and re-run the last two commands in arg_ranker.sh `python $PATH_to_arg_ranker/bin/ARG_table.sum.py -i ...` and `arg_ranker -i ...`.\
You can find the path to ARG_table.sum.py in arg_ranker.sh.\
Note that this [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py) is only meant for fixing arg_ranker.v2 and the results of arg_ranker.v2.\
Please do not replace ARG_table.sum.py in arg_ranker.v3 with this [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py).\
We are really sorry about this inconvenience.\
Please feel free to reach out to anniz44@mit.edu if you have any questions.

To check installed version `pip show arg_ranker`\
To upgrade `pip install arg_ranker --upgrade`

## Requirement
* python 3
* diamond: `conda install -c bioconda diamond=0.9.36` (https://github.com/bbuchfink/diamond)
* blast+: `conda install -c bioconda blast` (https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/)
* For metagenomes:
    * kraken2: `conda install -c bioconda kraken2`(https://github.com/DerrickWood/kraken2/wiki)
        * to compute the abundance of ARGs as copy number of ARGs per bacterial cell (recommended)
            * download the kraken2 standard database (50 GB of disk space): `kraken2-build --standard --db $KRAKENDB` \
            where $KRAKENDB is your preferred database name/location
            * MicrobeCensu: `git clone https://github.com/snayfach/MicrobeCensus && cd MicrobeCensus && python setup.py install` to estimate the average genome size for metagenomes.
            (https://github.com/snayfach/MicrobeCensus)
        * to compute the abundance of ARGs as copy number of ARGs per 16S
            * download the kraken2 16S database (73.2 MB of disk space): `kraken2-build --db $DBNAME --special greengenes`

## How to use it
* put all your genomes (.fa or .fasta) and metagenomes (.fq or .fastq) into one folder ($INPUT)
* run `arg_ranker -i $INPUT` (genomes only)
* run `arg_ranker -i $INPUT -kkdb $KRAKENDB` (genomes/metagenomes + kraken2 standard database)
    * or run `arg_ranker -i $INPUT -kkdb $KRAKENDB -kkdbtype 16S` (kraken2 16S database)
* run `sh arg_ranking/script_output/arg_ranker.sh`

## Output
* Sample_ranking_results.txt (Table 1) - LTS SARGv1 version
    * arg_ranker = 3.0.2
    * python >= 3.5
    * diamond = 0.9.36
    * blast = 2.13.0
    * kraken2 = 2.1.2
   
    |Sample|Rank_I_per|Rank_II_per|Rank_III_per|Rank_IV_per|Unassessed_per|Total_abu|Rank_code|Rank_I_risk|Rank_II_risk|Rank_III_risk|Rank_IV_risk|ARGs_unassessed_risk|note1|
    | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: |
    |WEE300_all-trimmed-decont_1.fastq|4.6E-02|0.0E+00|6.8E-02|7.5E-01|1.3E-01|1.9E+00|1.5-0.0-0.4-1.7-0.4|1.5|0.0|0.4|1.7|0.4|hospital_metagenome|
    |EsCo_genome.fasta|0.0E+00|0.0E+00|2.4E-01|7.6E-01|0.0E+00|2.1E+01|0.0-0.0-1.6-1.7-0.0|0.0|0.0|1.6|1.7|0.0|E.coli_genome|

1. Rank_I_per - Unassessed_per: percentage of ARGs of a risk Rank\
Total_abu: total abundance of all ARGs
2. For genomes, we output the copy number of ARGs detected in each genome.
3. For metagenomes, we compute the abundance of ARGs as the copy number of ARGs divided by the bacterial cell number or 16S copy number in the same metagenome.\
If you downloaded the kraken2 standard database, we compute the copy number of ARGs divided by the bacterial cell number.\
If you downloaded the kraken2 16S database, we compute the copy number of ARGs divided by the 16S copy number.\
The copy number of ARGs, 16S, and bacterial cells were computed as the number of reads mapped to them divided by their gene/genome length.
4. We compute the contribution of each ARG risk Rank as the average abundance of ARGs of a risk Rank divided by the average abundance of all ARGs\
Rank_I_risk - Unassessed_risk: the contribution of ARGs of a risk Rank\
Rank_code: a code of contribution from Rank I to Unassessed

* Sample_ARGpresence.txt:\
The abundance, the gene family, and the antibiotic of resistance of ARGs detected in the input samples

## Test
run `arg_ranker -i example -kkdb $KRAKENDB`\
run `sh arg_ranking/script_output/arg_ranker.sh`\
The arg_ranking/Sample_ranking_results.txt should look like Table 1 (using kraken2 standard database)

## Metadata for your samples (optional)
arg_ranker can merge your sample metadata into the results of ARG ranking (i.e. note1 in Table 1).\
Simply put all information you would like to include into a tab-delimited table\
Make sure that your sample names are listed as the first column (check example/metadata.txt).

## Copyright
Dr. An-Ni Zhang (MIT), Prof. Eric Alm (MIT), Prof. Tong Zhang* (University of Hong Kong)

## Citation
Zhang, AN., Gaston, J.M., Dai, C.L. et al. An omics-based framework for assessing the health risk of antimicrobial resistance genes. Nat Commun 12, 4765 (2021). https://doi.org/10.1038/s41467-021-25096-3\
Correction: bacA is a bacitracin resistance gene, not a beta-lactamase (Fig 3).
## Contact
anniz44@mit.edu or caozhichongchong@gmail.com

%package -n python3-arg-ranker
Summary:	Ranking the risk of antibiotic resistance for genomes/metagenomes
Provides:	python-arg-ranker
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-arg-ranker
# arg_ranker
arg_ranker evaluates the risk of ARGs in genomes and metagenomes

## Install
experimental version using SARGv3\
`pip install arg_ranker`\
Long term support version using SARGv1\
`pip install arg-ranker==3.0.2`
### Please make sure to install arg_ranker >= v3
To all users,\
We have noticed an error of arg_ranker.v2 when reporting the total ARG abundance in metagenomes.\
If the total abundance is used in your research, please update arg_ranker to v3 and re-run your metagenomes (`arg_ranker -i $INPUT -kkdb $KRAKENDB`).\
Alternatively, you can fix arg_ranker.v2 by replacing its original ARG_table.sum.py with [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py)\
and re-run the last two commands in arg_ranker.sh `python $PATH_to_arg_ranker/bin/ARG_table.sum.py -i ...` and `arg_ranker -i ...`.\
You can find the path to ARG_table.sum.py in arg_ranker.sh.\
Note that this [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py) is only meant for fixing arg_ranker.v2 and the results of arg_ranker.v2.\
Please do not replace ARG_table.sum.py in arg_ranker.v3 with this [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py).\
We are really sorry about this inconvenience.\
Please feel free to reach out to anniz44@mit.edu if you have any questions.

To check installed version `pip show arg_ranker`\
To upgrade `pip install arg_ranker --upgrade`

## Requirement
* python 3
* diamond: `conda install -c bioconda diamond=0.9.36` (https://github.com/bbuchfink/diamond)
* blast+: `conda install -c bioconda blast` (https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/)
* For metagenomes:
    * kraken2: `conda install -c bioconda kraken2`(https://github.com/DerrickWood/kraken2/wiki)
        * to compute the abundance of ARGs as copy number of ARGs per bacterial cell (recommended)
            * download the kraken2 standard database (50 GB of disk space): `kraken2-build --standard --db $KRAKENDB` \
            where $KRAKENDB is your preferred database name/location
            * MicrobeCensu: `git clone https://github.com/snayfach/MicrobeCensus && cd MicrobeCensus && python setup.py install` to estimate the average genome size for metagenomes.
            (https://github.com/snayfach/MicrobeCensus)
        * to compute the abundance of ARGs as copy number of ARGs per 16S
            * download the kraken2 16S database (73.2 MB of disk space): `kraken2-build --db $DBNAME --special greengenes`

## How to use it
* put all your genomes (.fa or .fasta) and metagenomes (.fq or .fastq) into one folder ($INPUT)
* run `arg_ranker -i $INPUT` (genomes only)
* run `arg_ranker -i $INPUT -kkdb $KRAKENDB` (genomes/metagenomes + kraken2 standard database)
    * or run `arg_ranker -i $INPUT -kkdb $KRAKENDB -kkdbtype 16S` (kraken2 16S database)
* run `sh arg_ranking/script_output/arg_ranker.sh`

## Output
* Sample_ranking_results.txt (Table 1) - LTS SARGv1 version
    * arg_ranker = 3.0.2
    * python >= 3.5
    * diamond = 0.9.36
    * blast = 2.13.0
    * kraken2 = 2.1.2
   
    |Sample|Rank_I_per|Rank_II_per|Rank_III_per|Rank_IV_per|Unassessed_per|Total_abu|Rank_code|Rank_I_risk|Rank_II_risk|Rank_III_risk|Rank_IV_risk|ARGs_unassessed_risk|note1|
    | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: |
    |WEE300_all-trimmed-decont_1.fastq|4.6E-02|0.0E+00|6.8E-02|7.5E-01|1.3E-01|1.9E+00|1.5-0.0-0.4-1.7-0.4|1.5|0.0|0.4|1.7|0.4|hospital_metagenome|
    |EsCo_genome.fasta|0.0E+00|0.0E+00|2.4E-01|7.6E-01|0.0E+00|2.1E+01|0.0-0.0-1.6-1.7-0.0|0.0|0.0|1.6|1.7|0.0|E.coli_genome|

1. Rank_I_per - Unassessed_per: percentage of ARGs of a risk Rank\
Total_abu: total abundance of all ARGs
2. For genomes, we output the copy number of ARGs detected in each genome.
3. For metagenomes, we compute the abundance of ARGs as the copy number of ARGs divided by the bacterial cell number or 16S copy number in the same metagenome.\
If you downloaded the kraken2 standard database, we compute the copy number of ARGs divided by the bacterial cell number.\
If you downloaded the kraken2 16S database, we compute the copy number of ARGs divided by the 16S copy number.\
The copy number of ARGs, 16S, and bacterial cells were computed as the number of reads mapped to them divided by their gene/genome length.
4. We compute the contribution of each ARG risk Rank as the average abundance of ARGs of a risk Rank divided by the average abundance of all ARGs\
Rank_I_risk - Unassessed_risk: the contribution of ARGs of a risk Rank\
Rank_code: a code of contribution from Rank I to Unassessed

* Sample_ARGpresence.txt:\
The abundance, the gene family, and the antibiotic of resistance of ARGs detected in the input samples

## Test
run `arg_ranker -i example -kkdb $KRAKENDB`\
run `sh arg_ranking/script_output/arg_ranker.sh`\
The arg_ranking/Sample_ranking_results.txt should look like Table 1 (using kraken2 standard database)

## Metadata for your samples (optional)
arg_ranker can merge your sample metadata into the results of ARG ranking (i.e. note1 in Table 1).\
Simply put all information you would like to include into a tab-delimited table\
Make sure that your sample names are listed as the first column (check example/metadata.txt).

## Copyright
Dr. An-Ni Zhang (MIT), Prof. Eric Alm (MIT), Prof. Tong Zhang* (University of Hong Kong)

## Citation
Zhang, AN., Gaston, J.M., Dai, C.L. et al. An omics-based framework for assessing the health risk of antimicrobial resistance genes. Nat Commun 12, 4765 (2021). https://doi.org/10.1038/s41467-021-25096-3\
Correction: bacA is a bacitracin resistance gene, not a beta-lactamase (Fig 3).
## Contact
anniz44@mit.edu or caozhichongchong@gmail.com

%package help
Summary:	Development documents and examples for arg-ranker
Provides:	python3-arg-ranker-doc
%description help
# arg_ranker
arg_ranker evaluates the risk of ARGs in genomes and metagenomes

## Install
experimental version using SARGv3\
`pip install arg_ranker`\
Long term support version using SARGv1\
`pip install arg-ranker==3.0.2`
### Please make sure to install arg_ranker >= v3
To all users,\
We have noticed an error of arg_ranker.v2 when reporting the total ARG abundance in metagenomes.\
If the total abundance is used in your research, please update arg_ranker to v3 and re-run your metagenomes (`arg_ranker -i $INPUT -kkdb $KRAKENDB`).\
Alternatively, you can fix arg_ranker.v2 by replacing its original ARG_table.sum.py with [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py)\
and re-run the last two commands in arg_ranker.sh `python $PATH_to_arg_ranker/bin/ARG_table.sum.py -i ...` and `arg_ranker -i ...`.\
You can find the path to ARG_table.sum.py in arg_ranker.sh.\
Note that this [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py) is only meant for fixing arg_ranker.v2 and the results of arg_ranker.v2.\
Please do not replace ARG_table.sum.py in arg_ranker.v3 with this [ARG_table.sum.py](https://github.com/caozhichongchong/arg_ranker/tree/v2.0/arg_ranker/bin_v2only/ARG_table.sum.py).\
We are really sorry about this inconvenience.\
Please feel free to reach out to anniz44@mit.edu if you have any questions.

To check installed version `pip show arg_ranker`\
To upgrade `pip install arg_ranker --upgrade`

## Requirement
* python 3
* diamond: `conda install -c bioconda diamond=0.9.36` (https://github.com/bbuchfink/diamond)
* blast+: `conda install -c bioconda blast` (https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/)
* For metagenomes:
    * kraken2: `conda install -c bioconda kraken2`(https://github.com/DerrickWood/kraken2/wiki)
        * to compute the abundance of ARGs as copy number of ARGs per bacterial cell (recommended)
            * download the kraken2 standard database (50 GB of disk space): `kraken2-build --standard --db $KRAKENDB` \
            where $KRAKENDB is your preferred database name/location
            * MicrobeCensu: `git clone https://github.com/snayfach/MicrobeCensus && cd MicrobeCensus && python setup.py install` to estimate the average genome size for metagenomes.
            (https://github.com/snayfach/MicrobeCensus)
        * to compute the abundance of ARGs as copy number of ARGs per 16S
            * download the kraken2 16S database (73.2 MB of disk space): `kraken2-build --db $DBNAME --special greengenes`

## How to use it
* put all your genomes (.fa or .fasta) and metagenomes (.fq or .fastq) into one folder ($INPUT)
* run `arg_ranker -i $INPUT` (genomes only)
* run `arg_ranker -i $INPUT -kkdb $KRAKENDB` (genomes/metagenomes + kraken2 standard database)
    * or run `arg_ranker -i $INPUT -kkdb $KRAKENDB -kkdbtype 16S` (kraken2 16S database)
* run `sh arg_ranking/script_output/arg_ranker.sh`

## Output
* Sample_ranking_results.txt (Table 1) - LTS SARGv1 version
    * arg_ranker = 3.0.2
    * python >= 3.5
    * diamond = 0.9.36
    * blast = 2.13.0
    * kraken2 = 2.1.2
   
    |Sample|Rank_I_per|Rank_II_per|Rank_III_per|Rank_IV_per|Unassessed_per|Total_abu|Rank_code|Rank_I_risk|Rank_II_risk|Rank_III_risk|Rank_IV_risk|ARGs_unassessed_risk|note1|
    | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: | :--------: |
    |WEE300_all-trimmed-decont_1.fastq|4.6E-02|0.0E+00|6.8E-02|7.5E-01|1.3E-01|1.9E+00|1.5-0.0-0.4-1.7-0.4|1.5|0.0|0.4|1.7|0.4|hospital_metagenome|
    |EsCo_genome.fasta|0.0E+00|0.0E+00|2.4E-01|7.6E-01|0.0E+00|2.1E+01|0.0-0.0-1.6-1.7-0.0|0.0|0.0|1.6|1.7|0.0|E.coli_genome|

1. Rank_I_per - Unassessed_per: percentage of ARGs of a risk Rank\
Total_abu: total abundance of all ARGs
2. For genomes, we output the copy number of ARGs detected in each genome.
3. For metagenomes, we compute the abundance of ARGs as the copy number of ARGs divided by the bacterial cell number or 16S copy number in the same metagenome.\
If you downloaded the kraken2 standard database, we compute the copy number of ARGs divided by the bacterial cell number.\
If you downloaded the kraken2 16S database, we compute the copy number of ARGs divided by the 16S copy number.\
The copy number of ARGs, 16S, and bacterial cells were computed as the number of reads mapped to them divided by their gene/genome length.
4. We compute the contribution of each ARG risk Rank as the average abundance of ARGs of a risk Rank divided by the average abundance of all ARGs\
Rank_I_risk - Unassessed_risk: the contribution of ARGs of a risk Rank\
Rank_code: a code of contribution from Rank I to Unassessed

* Sample_ARGpresence.txt:\
The abundance, the gene family, and the antibiotic of resistance of ARGs detected in the input samples

## Test
run `arg_ranker -i example -kkdb $KRAKENDB`\
run `sh arg_ranking/script_output/arg_ranker.sh`\
The arg_ranking/Sample_ranking_results.txt should look like Table 1 (using kraken2 standard database)

## Metadata for your samples (optional)
arg_ranker can merge your sample metadata into the results of ARG ranking (i.e. note1 in Table 1).\
Simply put all information you would like to include into a tab-delimited table\
Make sure that your sample names are listed as the first column (check example/metadata.txt).

## Copyright
Dr. An-Ni Zhang (MIT), Prof. Eric Alm (MIT), Prof. Tong Zhang* (University of Hong Kong)

## Citation
Zhang, AN., Gaston, J.M., Dai, C.L. et al. An omics-based framework for assessing the health risk of antimicrobial resistance genes. Nat Commun 12, 4765 (2021). https://doi.org/10.1038/s41467-021-25096-3\
Correction: bacA is a bacitracin resistance gene, not a beta-lactamase (Fig 3).
## Contact
anniz44@mit.edu or caozhichongchong@gmail.com

%prep
%autosetup -n arg_ranker-3.3

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-arg-ranker -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 3.3-1
- Package Spec generated