|
1 |
| -Here are the files pertaining to both the network and expression databases. Look within the README.md files of both folders for information pertinent to the schema that you intend to be using. |
| 1 | +# GRNsight Database |
| 2 | +Here are the files pertaining to both the network and expression databases. Look within the README.md files of both folders for information pertinent to the schema that you intend to be using. |
| 3 | +## Setting up a local postgres GRNsight Database |
| 4 | +1. Installing PostgreSQL on your computer |
| 5 | + - MacOS and Windows can follow these [instructions](https://dondi.lmu.build/share/db/postgresql-setup-day.pdf) on how to install postgreSQL. |
| 6 | + - Step 1 tells you how to install postgreSQL on your local machine, initialize a database, and how to start and stop running your database instance. |
| 7 | + - If your terminal emits a message that looks like `initdb --locale=C -E UTF-8 location-of-cluster` from Step 1B, then your installer has initialized a database for you. |
| 8 | + - Additionally, your installer may start the server for you upon installation. To start the server yourself run `pg_ctl start -D location-of-cluster`. To stop the server run `pg_ctl stop -D location-of-cluster`. |
| 9 | + - Linux users |
| 10 | + - The MacOS and Windows instructions will _probably_ not work for you. You can try at your own risk to check. |
| 11 | + - Linux users can try these [instructions](https://www.geeksforgeeks.org/install-postgresql-on-linux/) and that should work for you (...maybe...). If it doesn't try googling instructions with your specific operating system. Sorry! |
| 12 | +2. Loading data to your database |
| 13 | + 1. Adding the Schemas to your database. |
| 14 | + 1. Go into your database using the following command: |
| 15 | + |
| 16 | + ``` |
| 17 | + psql postgresql://localhost/postgres |
| 18 | + ``` |
| 19 | + |
| 20 | + From there, create the schemas using the following commands: |
| 21 | + |
| 22 | + ``` |
| 23 | + CREATE SCHEMA spring2022_network; |
| 24 | + ``` |
| 25 | + |
| 26 | + ``` |
| 27 | + CREATE SCHEMA fall2021; |
| 28 | + ``` |
| 29 | + |
| 30 | + Once they are created you can exit your database using the command `\q`. |
| 31 | + 2. Once your schema's are created, you can add the table specifications using the following commands: |
| 32 | + |
| 33 | + ``` |
| 34 | + psql postgresql://localhost/postgres -f <path to GRNsight/database/network-database>/schema.sql |
| 35 | + ``` |
| 36 | + |
| 37 | + ``` |
| 38 | + psql postgresql://localhost/postgres -f <path to GRNsight/database/expression-database>/schema.sql |
| 39 | + ``` |
| 40 | + |
| 41 | + Your database is now ready to accept expression and network data! |
| 42 | + |
| 43 | + 2. Loading the GRNsight Network Data to your local database |
| 44 | + 1. GRNsight generates Network Data from SGD through YeastMine. In order to run the script that generates these Network files, you must pip3 install the dependencies used. If you get an error saying that a module doesn't exist, just run `pip3 install <Module Name>` and it should fix the error. If the error persists and is found in a specific file on your machine, you might have to manually go into that file and alter the naming conventions of the dependencies that are used. _Note: So far this issue has only occured on Ubuntu 22.04.1, so you might be lucky and not have to do it!_ |
| 45 | + |
| 46 | + ``` |
| 47 | + pip3 install pandas requests intermine tzlocal |
| 48 | + ``` |
| 49 | + |
| 50 | + Once the dependencies have been installed, you can run |
| 51 | + |
| 52 | + ``` |
| 53 | + python3 <path to GRNsight/database/network-database/scripts>/generate_network.py |
| 54 | + ``` |
| 55 | + |
| 56 | + This will take a while to get all of the network data and generate all of the files. This will create a folder full of the processed files in `database/network-database/script-results`. |
| 57 | + |
| 58 | + 2. Load the processed files into your database. |
| 59 | + |
| 60 | + ``` |
| 61 | + python3 <path to GRNsight/database/network-database/scripts>/loader.py | psql postgresql://localhost/postgres |
| 62 | + ``` |
| 63 | + |
| 64 | + This should output a bunch of COPY print statements to your terminal. Once complete your database is now loaded with the network data. |
| 65 | + |
| 66 | + 3. Loading the GRNsight Expression Data to your local database |
| 67 | + 1. Create a directory (aka folder) in the database/expression-database folder called `source-files`. |
| 68 | + |
| 69 | + ``` |
| 70 | + mkdir <path to GRNsight/database/expression-database>/source-files |
| 71 | + ``` |
| 72 | + |
| 73 | + 2. Download the _"Expression 2020"_ folder from Box located in `GRNsight > GRNsight Expression > Expression 2020` to your newly created `source-files` folder |
| 74 | + 3. Run the pre-processing script on the data. This will create a folder full of the processed files in `database/expression-database/script-results`. |
| 75 | + |
| 76 | + ``` |
| 77 | + python3 <path to GRNsight/database/expression-database/scripts>/preprocessing.py |
| 78 | + ``` |
| 79 | + |
| 80 | + 4. Load the processed files into your database. |
| 81 | + |
| 82 | + ``` |
| 83 | + python3 <path to GRNsight/database/expression-database/scripts>/loader.py | psql postgresql://localhost/postgres |
| 84 | + ``` |
| 85 | + |
| 86 | + This should output a bunch of COPY print statements to your terminal. Once complete your database is now loaded with the expression data. |
| 87 | + |
0 commit comments