ALGAE Protocol: An automated protocol for assigning early life exposures to longitudinal cohort studies

An automated protocol for assigning early life exposures to longitudinal cohort studies


by Kevin Garwood

ALGAE should run on most operating systems, but at present the scripts assume that you will work from a directory located at C:/algae_protocol.
  1. Click this button, and save the zip file to your computer. Unzip it so that you have a folder C:/algae_protocol.

Create a new database and load the ALGAE code

  1. In the left-hand panel marked "Object Browser" in PG Admin, right-click on the "Databases" item. Then click "New database..."
  2. You should now see the following dialog. Choose some meaningful name for the test database you're about to create (eg: algae_15012016). Click the "OK" button. You should now see an entry for your new database in the Object Browser.
  3. Double click on the Object Browser entry for your database (eg: the part of the tree that would say algae_15012016). You should see the following items under the heading for your new database.
  4. Click on the Tools menu and choose "Query Tool". The following dialog appears:
  5. Now we're going to load all the code you need to run the ALGAE test cases. In your download, find and open the text file:
  6. Using your favourite text editor (or use Eclipse), select all of the text in the file and copy it into the Query tool window.

    Within the Query tool window, you should now see the top lines of the Load_All_ALGAE_Code.txt file.

  7. Click on the "Query" menu, then click "Execute".
  8. Very quickly, you should see the message "Query returned successfully with no result in xxx ms". This just tells you that PostgreSQL loaded all the code correctly and didn't encounter any problems.

    You should now be able to see the result of loading the code. In the Objecct browser panel, click first on your database (eg: algae_15102016). Then click on "Schemas" and finally click on "Functions". You should dozens of database functions listed. These are responsible for processing your cohort data.

  9. We now want to run the test suites to make sure that you've installed ALGAE correctly and that the program works. Paste the following line of code into the Query tool window and press Execute (ie press F5 button):
    SELECT "run_test_suite"('C:\algae_protocol\test_environment');
  10. Verify that the program ran correctly. When the program finishes running, you should see a row marked "1" in the Data Output panel at the bottom of the Query Tool screen.

    If you want to see more information telling you about how it ran, click on the "Messages" panel that appear along with the "Data Output" tab.

If you finish these steps, it means you've successfully installed ALGAE and verified that it can run on the test data sets that come with the download bundle.