Skip to content
Jules Kerssemakers edited this page Jul 28, 2015 · 29 revisions

The page describes how to import data into the cBioPortal using Python scripts found in our scripts directory. The follow assumptions have been made:

  1. The cBioPortal software has been correctly built from source.

  2. The MySQL JDBC driver file is present on your filesystem and the variable CONNECTOR_JAR is pointing to the jar:

    CONNECTOR_JAR=$(echo $CATALINA_HOME/lib/mysql-connector-java-*-bin.jar)
    echo $CONNECTOR_JAR
    # output e.g. /Library/Tomcat/lib/mysql-connector-java-5.1.35-bin.jar   
    
  3. The data to import is in the proper File Format.

  4. The PORTAL_HOME environment variable has been properly defined.

The following command is used to import cancer type metadata into the cBioPortal database:

$PORTAL_HOME/core/src/main/scripts/cbioportalImporter.py --jvm-args "-cp $CONNECTOR_JAR:$PORTAL_HOME/core/target/core-1.0-SNAPSHOT.jar" --command import-cancer-type --meta-filename /path-to-cancer-type-file/cancer_type.txt

The cancer_type.txt file should conform to the file format describe on the File Formats wiki page.

The following command is used to import cancer study metadata into the cBioPortal database:

$PORTAL_HOME/core/src/main/scripts/cbioportalImporter.py --jvm-args "-cp $CONNECTOR_JAR:$PORTAL_HOME/core/target/core-1.0-SNAPSHOT.jar" --command import-study --meta-filename /path-to-meta_study-file/meta_study.txt

The meta_study.txt file should conform to the file format describe on the File Formats wiki page.

The following command is used to remove a cancer study from the cBioPortal database:

$PORTAL_HOME/core/src/main/scripts/cbioportalImporter.py --jvm-args "-cp $CONNECTOR_JAR:$PORTAL_HOME/core/target/core-1.0-SNAPSHOT.jar" --command remove-study --meta-filename /path-to-meta_study-file/meta_study.txt

The meta_study.txt file should conform to the file format describe on the File Formats wiki page.

The following command is used to import all types of genomic data described on our File Formats wiki page. Below are examples of import copy number and mutation data:

$PORTAL_HOME/core/src/main/scripts/cbioportalImporter.py --jvm-args "-cp $CONNECTOR_JAR:$PORTAL_HOME/core/target/core-1.0-SNAPSHOT.jar" --command import-study-data --meta-filename /path-to-meta_CNA.txt/meta_CNA.txt --data-filename /path-to-data_CNA.txt/data_CNA.txt
$PORTAL_HOME/core/src/main/scripts/cbioportalImporter.py --jvm-args "-cp $CONNECTOR_JAR:$PORTAL_HOME/core/target/core-1.0-SNAPSHOT.jar" --command import-study-data --meta-filename /path-to-meta_mutations_extended.txt/meta_mutations_extended.txt --data-filename /path-to-data_mutations_extended.txt/data_mutations_extended.txt

The following command is used to import patient lists into the cBioPortal database:

$PORTAL_HOME/core/src/main/scripts/cbioportalImporter.py --jvm-args "-cp $CONNECTOR_JAR:$PORTAL_HOME/core/target/core-1.0-SNAPSHOT.jar" --command import-patient-list --meta-filename /path-to-patient-list/patient-list.txt

The patient-list.txt file should conform to the file format describe on the File Formats wiki page.

Note - the import-patient-list command can take a path to a folder that contains a set of patient-list files in addition to a single patient-list file.