Bio_db works on current versions of SWI and Yap.
It serves re-packaged high quality bio-data in formats that are Prolog friendly: Prolog facts and database back ends. SQLite, Berkeley and ROcksDB databases are supported. The method used to serve the data is transparent to the user and depends on a single set-up call. The user can access the data as Prolog facts irrespective of how the library will serve the data.
bio_dp can be installed from within SWI using its
And then load by :
?- use_module( library(lib) ).
?- lib( bio_db ).
If you do not have bio_db_repo, individual data sets will be downloaded when you first try to querry them:
?- map_hgnc_hgnc_symb( 19295, Symb ). % prolog DB:table hgnc:map_hgnc_hgnc_symb/2 is not installed, do you want to download it (Y/n) ? % Continuing with: yes % Downloading dataset from server: http://stoics.org.uk/~nicos/sware/packs/bio_db_repo/data % Delete the zip file: '/usr/local/users/nicos/local/git/lib/swipl/pack/bio_db_repo/data/hs/maps/hgnc/map_hgnc_hgnc_symb.pl.zip' (y/N) ? % Continuing with: yes Symb = 'LMTK3'.
The new features in lib 2.0 were driven by the desire to include organism based bio_db cells.
Previously it served only human data. As of version 2.0, data for mouse is also included.
The new architecture makes it trivial to add data from other organisms (and databases within served organisms).
?- lib( & bio_db ).
only loads the skeleton module interface.
either of the following two
?- use_module( library(bio_db) )
. ?- lib( bio_db ).
provide access to all data predicates of the library.
[Only hot-swappable code is loaded in bio_db at this point.]
?- lib( & bio_db(mouse) ).
access to all mouse data.
?- lib( & bio_db(hs(hgnc)) ).
access to the HGNC datasets for human.
To see all available predicates along with their organism and primary cell:
?- bio_db_data_predicate( Pa, Pn, Org, Cell ).
Pa = map_ense_ensg_chrl,
Pn = 5,
Org = hs,
Cell = 'hs/ense.pl' ;
?- ['auxil/build_repo/std_repo'], std_repo.
?- [pack('bio_db/examples/tables_stats')]. ?- bio_db_stats. % edge_gont_is_a/2 has 77155 records. % map_hgnc_ensg_hgnc/2 has 37647 records. % edge_gont_regulates/2 has 3573 records. % map_hgnc_ccds_hgnc/2 has 19019 records. % map_mgim_mouse_mgim_genb/2 has 276279 records. % map_hgnc_entz_symb/2 has 41496 records. % map_mgim_mouse_mgim_symb/2 has 300103 records. ... % map_hgnc_hgnc_name/2 has 46016 records. % edge_gont_positively_regulates/2 has 3103 records. % Total number of predicates: 67, and records: 38710918 % ...halting as all predicates have been retracted.
Accessing biological data as Prolog facts
Nicos Angelopoulos and Jan Wielemaker
Proceedings of the 19th International Symposium on Principles and Practice of Declarative Programming (PPDP 2017)
Pages 29-38. Namur, Belgium. October 9-11, 2017
URL: ACM.org DOI:10.1145/3131851.3131857
A logical approach to working with biological databases
Nicos Angelopoulos and Georgios Giamas
Proceedings of the International Conference on Logic Programming
Accepted as a technical communication, Cork, September 2015.