<commit_before># Importing the Seed Database

The next step is to populate your cBioPortal instance with all the required background data sets.  This includes, for example:  gene data, ID mappings, and network interactions.  Rather than importing each of these data sets individually, we have provided a simple "seed" database that you can import directly.

## Download the cBioPortal Database

A cBioPortal seed database can be found on [the datahub page](https://github.com/cbioportal/datahub/blob/master/seedDB/README.md).

After download, the files can be unzipped by entering the following command:

    gunzip *.sql.gz

## Import the cBioPortal Database

*Important:*  Before importing, make sure that you have [followed the pre-build steps](Pre-Build-Steps.md) for creating the `cbioportal` database (see section "Create the cBioPortal MySQL Databases and User").

Then import the seed database via the `mysql` commands:

    > mysql --user=cbio_user --password=<PASSWORD> cbioportal  < cgds.sql

and:

    > mysql --user=cbio_user --password=<PASSWORD> cbioportal  < seed-cbioportal_no-pdb_hg19.sql
    
and (this command takes a bit longer to import PDB data that will enable the visualization of PDB structures in the mutation tab): 

    > mysql --user=cbio_user --password=<PASSWORD> cbioportal  < seed-cbioportal_only-pdb.sql

:information_source: please be aware of the version of the seed DB. If it is different from what the cBioPortal system is expecting, the system will at some point ask you to run a migration step. The system will automatically give you a clear message (with instructions) about this (during startup or during data loading process) if a migration is needed. 

## Drug-target Data

Due to data provider specific restrictions on data re-distribution, the database setup, as outlined above, will lack some of the drug-gene relationships from specific data-resources. If you would like to obtain the complete the data sets from these resources, we encourage you to take advantage of [PiHelper](http://bitbucket.org/armish/pihelper) for aggregating drug-target associations and use the corresponding data importer `importPiHelperData.sh` which is distributed as part of cBioPortal.

[Next Step: Loading a Sample Study](Load-Sample-Cancer-Study.md)<commit_msg>Update documentation on importing the seed database<commit_after># Importing the Seed Database

The next step is to populate your cBioPortal instance with all the required background data sets. This includes for example gene data, ID mappings, and network interactions. Rather than importing each of these data sets individually, we have provided a simple "seed" database that you can import directly.

## Download the cBioPortal Seed Database

A cBioPortal seed database can be found on [the datahub page](https://github.com/cbioportal/datahub/blob/master/seedDB/README.md).

After download, the files can be unzipped by entering the following command:

    gunzip *.sql.gz

## Import the cBioPortal Seed Database

*Important:* Before importing, make sure that you have [followed the pre-build steps](Pre-Build-Steps.md) for creating the `cbioportal` database (see section "Create the cBioPortal MySQL Databases and User").

1. Import the database schema:

    ```
    mysql --user=cbio_user --password=<PASSWORD> cbioportal < cgds.sql
    ```

2. Import the main part of the seed database:

    ```
    mysql --user=cbio_user --password=<PASSWORD> cbioportal < seed-cbioportal_hg19_vX.Y.Z.sql
    ```

    *Important:* Replace `seed-cbioportal_hg19_vX.Y.Z.sql` with the downloaded version of the seed database, such as `seed-cbioportal_hg19_v2.1.0.sql`.

3. Import the protein database (PDB) part of the seed database. This will enable the visualization of PDB structures in the mutation tab. Loading this file takes more time than loading the previous files, and is optional for users that do not require PDB structures.

    ```
    mysql --user=cbio_user --password=<PASSWORD> cbioportal < seed-cbioportal_hg19_vX.Y.Z_only-pdb.sql
    ```
    *Important:* Replace `seed-cbioportal_hg19_vX.Y.Z_only-pdb.sql` with the downloaded version of the PDB database, such as `seed-cbioportal_hg19_v2.1.0_only-pdb.sql`.

:information_source: Please be aware of the version of the seed database. In the [README on datahub](https://github.com/cbioportal/datahub/blob/master/seedDB/README.md), we stated which version of cBioPortal is compatible with the current seed database.

If the database is older than what cBioPortal is expecting, the system will ask you (during startup or data loading) to migrate the database to a newer version. The migration process is described [here](Updating-your-cBioPortal-installation.md#running-the-migration-script).

## Drug-target Data

Due to data provider specific restrictions on data re-distribution, the database setup, as outlined above, will lack some of the drug-gene relationships from specific data-resources. If you would like to obtain the complete the data sets from these resources, we encourage you to take advantage of [PiHelper](http://bitbucket.org/armish/pihelper) for aggregating drug-target associations and use the corresponding data importer `importPiHelperData.sh` which is distributed as part of cBioPortal.

[Next Step: Loading a Sample Study](Load-Sample-Cancer-Study.md)
{'fraction_non_alphanumeric': 0.07087798458356834, 'fraction_numerical': 0.004324121075390111, 'mean_word_length': 4.594111461619348, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 12, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7226614', 'n_tokens_mistral': 1525, 'n_tokens_neox': 1443, 'n_words': 650}