broadinstitute/terra-tools
To run a script locally:
cd
into the terra-tools
directorypython3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
gcloud auth application-default login
python3 scripts/path_to_script/<script name.py> <arguments>
To run a script using Docker:
docker run --rm -it -v "$HOME"/.config:/.config -v "$HOME"/Documents/:/data broadinstitute/terra-tools:latest bash -c "cd data; python3 /scripts/path_to_script/<script name.py> <arguments>"
-v "$HOME"/.config:/.config
- allows for authentication within the Docker of your Google credentials in your local $HOME directory where they are stored by default-v "$HOME"/Documents/:/data
- mounts the directory named "Documents" to a folder named "data" within the Docker
- files generated by scripts will be written to your "Documents" directory
- change "Documents" to the path of any location on your local machinebash -c
- directs Docker to run the following bash commands (within quotes and separated by semi-colon)For example, to run the import_large_tsv.py
script:
<tsv_name>
) to Documents/
directory locallydocker run --rm -v "$HOME"/.config:/.config -v "$HOME"/Documents/:/data broadinstitute/terra-tools:latest bash -c "cd data; python3 scripts/import_large_tsv/import_large_tsv.py --tsv data/<tsv_name> --project <terra_project> --workspace <terra_workspace>"
gcloud auth application-default login
)When running without the docker, check the packages in requirements.txt
.
docker pull broadinstitute/terra-tools