cBioPortal Galaxy Connector is a Python-based application that allows users to export data from cBioPortal to a Galaxy instance. The application processes tab-delimited data, prepares it, and uploads it to a specified Galaxy history.
- Environment Configuration: Configure Galaxy URL via environment variables.
- Data Preparation: Process and prepare tab-delimited data for upload.
- Retry Mechanism: Retry Galaxy instance creation on connection failure.
- File Upload: Upload prepared data to a specified Galaxy history.
Python 3.7+
pandas
requests
fastapi
uvicorn
bioblend
cbioportal-core
-
Clone the repository:
git clone https://github.com/jCHENEBY/cbioportal-galaxy-connector.git cd cbioportal-galaxy-connector
-
Create a conda environment from the environment file and activate it:
conda create --name cbioportal-galaxy-connector --file environment.yaml conda activate cbioportal-galaxy-connector
-
Run the application:
uvicorn main:app --reload --host 0.0.0.0 --port 3001
GALAXY_URL
: Specify the Galaxy instance URL.LIMIT_IP
: Set totrue
to enable IP filtering (default isfalse
).STUDY_DIRECTORY
: Path to the study directory (default is/study
).CBIOPORTAL_URL
: URL of the cBioPortal instance.CBIOPORTAL_CACHE_API_KEY
: API key for cBioPortal cache.
Set the GALAXY_URL
environment variable to specify the Galaxy instance URL:
export GALAXY_URL='http://your-galaxy-instance-url'
export PYLONE_API_KEY='your-pyclone-api-key'
export PYLONE_DATA_PATH='/path/to/your/data'
export LIMIT_IP='true'
The application includes middleware to limit access based on IP addresses. This feature can be enabled or disabled using the LIMIT_IP environment variable.
- When LIMIT_IP is set to true, IP filtering is applied.
- When LIMIT_IP is set to false (default), IP filtering is bypassed.
- GET /images/{image_name}: Accessible from anywhere.
- DELETE /images/{image_name}: Restricted by IP.
- /export-to-galaxy/: Accessible from anywhere.
- Other endpoints: Restricted by IP.
- ALLOWED_IPS: List of allowed IP addresses (default is ["127.0.0.1"]).
- Ensure the
GALAXY_URL
environment variable is set. - Start the application using the
uvicorn
command mentioned above. - Use the provided API endpoints to interact with the application and export data to Galaxy.
To build and run the application using Docker:
-
Build the Docker image:
docker build -t cbioportal-galaxy-connector .
-
Run the Docker container:
docker run -p 3001:3001 cbioportal-galaxy-connector