annotate resfinder/database_tests.md @ 0:a16d245332d6 draft default tip

Uploaded
author dcouvin
date Wed, 08 Dec 2021 01:46:07 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
1 # PhenoDB Test
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
2
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
3 It is not necessary to test the validity of a database that has just been
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
4 cloned. The main reason for running tests are to test a database that has been
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
5 altered. The tests run are by no mean exhaustive and will not guarantee a valid
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
6 database.
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
7
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
8 This file will test the validity of the databases installed in the default
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
9 locations. These are:
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
10 - [resfinder app dir]/db_resfinder
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
11 - [resfinder app dir]/db_pointfinder
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
12 Where [resfinder app dir] is the root directory of the ResFinder application.
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
13 You will find the "run_resfinder.py" file in this directory.
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
14
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
15 Run the following command to test validity of databases.
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
16
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
17 ```bash
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
18
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
19 python3 -m doctest database_test.md
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
20
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
21 ```
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
22
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
23 *Note*: Change the database locations to be tested by changing the first three
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
24 lines of the python code below in this file.
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
25
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
26 ```python
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
27
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
28 >>> db_resfinder = "db_resfinder/"
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
29 >>> db_pointfinder = "db_pointfinder/"
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
30 ```
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
31
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
32 ## Test phenotype.txt and resistens-overview.txt files
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
33
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
34 ```python
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
35
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
36 >>> from cge.phenotype2genotype.res_profile import PhenoDB
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
37
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
38 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
39 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
40 ... acquired_file="{}phenotypes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
41 ... point_file="{}campylobacter/resistens-overview.txt".format(db_pointfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
42
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
43 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
44 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
45 ... point_file="{}enterococcus_faecalis/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
46
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
47 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
48 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
49 ... point_file="{}enterococcus_faecium/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
50
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
51 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
52 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
53 ... point_file="{}escherichia_coli/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
54
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
55 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
56 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
57 ... point_file="{}helicobacter_pylori/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
58
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
59 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
60 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
61 ... point_file="{}klebsiella/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
62
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
63 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
64 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
65 ... point_file="{}mycobacterium_tuberculosis/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
66
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
67 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
68 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
69 ... point_file="{}neisseria_gonorrhoeae/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
70
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
71 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
72 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
73 ... point_file="{}plasmodium_falciparum/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
74
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
75 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
76 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
77 ... point_file="{}salmonella/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
78
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
79 >>> phenodb = PhenoDB(
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
80 ... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
81 ... point_file="{}staphylococcus_aureus/resistens-overview.txt".format(db_pointfinder))
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
82
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
83
a16d245332d6 Uploaded
dcouvin
parents:
diff changeset
84 ```