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
|
# PhenoDB Test
It is not necessary to test the validity of a database that has just been
cloned. The main reason for running tests are to test a database that has been
altered. The tests run are by no mean exhaustive and will not guarantee a valid
database.
This file will test the validity of the databases installed in the default
locations. These are:
- [resfinder app dir]/db_resfinder
- [resfinder app dir]/db_pointfinder
Where [resfinder app dir] is the root directory of the ResFinder application.
You will find the "run_resfinder.py" file in this directory.
Run the following command to test validity of databases.
```bash
python3 -m doctest database_test.md
```
*Note*: Change the database locations to be tested by changing the first three
lines of the python code below in this file.
```python
>>> db_resfinder = "db_resfinder/"
>>> db_pointfinder = "db_pointfinder/"
```
## Test phenotype.txt and resistens-overview.txt files
```python
>>> from cge.phenotype2genotype.res_profile import PhenoDB
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... acquired_file="{}phenotypes.txt".format(db_resfinder),
... point_file="{}campylobacter/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}enterococcus_faecalis/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}enterococcus_faecium/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}escherichia_coli/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}helicobacter_pylori/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}klebsiella/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}mycobacterium_tuberculosis/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}neisseria_gonorrhoeae/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}plasmodium_falciparum/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}salmonella/resistens-overview.txt".format(db_pointfinder))
>>> phenodb = PhenoDB(
... abclassdef_file="{}antibiotic_classes.txt".format(db_resfinder),
... point_file="{}staphylococcus_aureus/resistens-overview.txt".format(db_pointfinder))
```
|