cBioPortal
Search…
2.4 Integration with Other Webservices
5.2 Datasets
6. Web API and Clients
Powered By GitBook
Using the metaImport Script

Importing Data into cBioPortal

The metaImport script should be used to automate the process of validating and loading datasets. It also has some nice features like an extra option to only load datasets that completely pass validation (i.e. with no errors, while warnings can be explicitly allowed by the user).

Running the metaImport Script

To run the metaImport script first go to the importer folder <your_cbioportal_dir>/core/src/main/scripts/importer and then run the following command:
1
./metaImport.py -h
Copied!
This will tell you the parameters you can use:
1
$./metaImport.py -h
2
usage: metaImport.py [-h] -s STUDY_DIRECTORY
3
[-u URL_SERVER | -p PORTAL_INFO_DIR | -n]
4
[-jar JAR_PATH] [-html HTML_TABLE]
5
[-v] [-o] [-r] [-m]
6
7
cBioPortal meta Importer
8
9
optional arguments:
10
-h, --help show this help message and exit
11
-s STUDY_DIRECTORY, --study_directory STUDY_DIRECTORY
12
path to directory.
13
-u URL_SERVER, --url_server URL_SERVER
14
URL to cBioPortal server. You can set this if your URL
15
is not http://localhost/cbioportal
16
-p PORTAL_INFO_DIR, --portal_info_dir PORTAL_INFO_DIR
17
Path to a directory of cBioPortal info files to be
18
used instead of contacting the web API
19
-n, --no_portal_checks
20
Skip tests requiring information from the cBioPortal
21
installation
22
-jar JAR_PATH, --jar_path JAR_PATH
23
Path to scripts JAR file (default: locate it relative
24
to the import script)
25
-html HTML_TABLE, --html_table HTML_TABLE
26
path to html report
27
-v, --verbose report status info messages while validating
28
-o, --override_warning
29
override warnings and continue importing
30
-r, --relaxed_clinical_definitions
31
Option to enable relaxed mode for validator when
32
validating clinical data without header definitions
33
-m, --strict_maf_checks
34
Option to enable strict mode for validator when
35
validating mutation data
Copied!

Example of Importing a study

Export PORTAL_HOME as explained here, e.g.
1
export PORTAL_HOME=<cbioportal_configuration_folder>
Copied!
and then run (this simple command only works if your cBioPortal is running at http://localhost/cbioportal - if this is not the case, follow the advanced example):
1
./metaImport.py -s ../../../test/scripts/test_data/study_es_0/
Copied!

Advanced Example

This example imports the study to the localhost, creates an html report and shows status messages.
1
./metaImport.py -s ../../../test/scripts/test_data/study_es_0/ -u http://localhost:8080 -html myReport.html -v
Copied!
By adding -o, warnings will be overridden and import will start after validation.

Development / debugging mode

For developers and specific testing purposes, an extra script, cbioportalImporter.py, is available which imports data regardless of validation results. Check this page for more information on how to use it.
Last modified 1mo ago