Setting up MariaDb
The following procedure is common for Amazon-RDS-based or local instances of MariaDb database.
- After setting up the MariaDb server, please create two users. The first one will be used by an admin person and will have all the write permissions to load the data using PersephoneShell. The other, mostly read-only, connection string will be used by the main Persephone application.
- Login to the database as the admin user and run the script below to give INSERT and UPDATE privileges on a few tables to the "read-only" user (in our case, persephoneviewer):
GRANT INSERT, UPDATE ON `user_session` TO 'persephoneviewer'@'%';
GRANT INSERT, UPDATE ON `app_exception` TO 'persephoneviewer'@'%';
GRANT INSERT, UPDATE ON `api_performance_event` TO 'persephoneviewer'@'%';
GRANT INSERT, UPDATE ON `environment_variable` TO 'persephoneviewer'@'%';
GRANT INSERT, UPDATE ON `event` TO 'persephoneviewer'@'%';
GRANT INSERT, UPDATE ON `performance_event` TO 'persephoneviewer'@'%';
- Log off.
- Configure PersephoneShell by adding the new connection string for the admin person to the configuration file. Find the section with connection strings and modify it to look similar to the following:
<add name="MYSQL" providerName="MySql.Data.MySqlClient" connectionString="admin/password@server:3306/persdb" />
Please see a separate documentation for PersephoneShell.
It is recommended to use cipher command tool that comes with PersephoneShell to encrypt the connection string.
- In case of MariaDb, the main Persephone application will access the database via an API-server (Cerberus). The latest version of Cerberus is implemented in a form of self-hosting server that does not require any pre-installed web server like Apache or IIS. The self-hosting version of Cerberus is called SelfHostingCerberus. It can run under Windows or linux.
- Now, it is time to initialize the schema (a 'database' in terms of MariaDb). From the computer that will host SelfHostingCerberus, please run PersephoneShell using the new connection string:
psh -s MYSQL
mono psh.exe -s MYSQL
In case of MariaDb, the genomic sequences are stored outside of the database, so it is important to run PersephoneShell on the same machine as the one that will be used to run SelfHostingCerberus, as both programs should have access to the same file system.
- The command init will initialize the database schema (command init). For the brand new database schema, PersephoneShell will need to set up the storage folders for the genomic sequences. They will be created on the same machine. If necessary, you can use several different locations for the files. Each storage location will be identified by its own Storage Id.
Copyright (C) 2014-2018 Persephone Software, LLC.
Invalid or uninitialized schema. Please use 'INIT' command to initialize database.
PS> init -v
Creating the Persephone schema onto the database...
Deleting objects... Completed
Creating objects... Completed
Inserting values... Completed
Schema have been successfully created.
Before you would be able to load any data, you should add at least one sequence storage.
NOTE: You can do it right now, or anytime later using 'add storage' command.
Do you really want to add the sequence storage now? (Y/N) Y
Storage Id? 1
Configuration (path to sequences folder)? d:\data\sequences\db1
Storage priority (leave blank for highest priority)?
Do you really want to add the storage? (Y/N) Y
Would you like to add a sample dataset (Arabidopsis thaliana)?
NOTE: You can do it anytime later by issuing following two commands:
add organism -v -c <PersephoneShellFolder>\Samples\Organism\add_Arabidopsis_thaliana.ini
add sequencedatabase -v -c <PersephoneShellFolder>\Samples\SequenceDatabase\add_TAIR10.ini
Do you really want to add the sample dataset? (Y/N) Y
Control file has been successfully parsed.
Organism (Arabidopsis thaliana: 3702) has been successfully inserted.
Adding sequences and annotations...
Control file has been successfully parsed.
Process Run (1) has been successfully created.
MapSet (TAIR10:1) has been successfully created.
Method [MRNA, (False, yan 0 255 255)] has been successfully created or updated.
- At this stage, the system is ready for loading the data. A typical workflow for adding a new genome is described here.