Anaconda Python environment in the Sandbox
Last updated
Was this helpful?
Last updated
Was this helpful?
Anaconda Python environment is available in the sandbox wrapped through . Apart from the , there is also Anaconda Python environment as docker image available in Sandbox with specific packages loaded. Details of the packages along with creation of docker image can be found in .
To run Anaconda Python environment release 1.0 type in the Terminal
docker run -v $PWD:/home/ivm -v /finngen:/finngen -it eu.gcr.io/finngen-sandbox-v3-containers/anaconda_python/anaconda3:1.0 /bin/bash
The above command takes you inside the docker image with mounted volumes of your home folder as well as finngen folder with all FinnGen data releases. Keep in mind there is only one python version which is 3.9.13. Any virtual environment created will be by default 3.9.13. There is no python2. Both python and python3 will load 3.9.13 version.
Once you are in the docker image, you can list the installed packages using the following command
pip list
You can also see a specific Python package and the version using the following command
pip show <YOUR_PACKAGE_NAME>
Anaconda Python comes with google cloud bigquery and pandas_gbq packages which makes SQL query output to dataframe easy by running single line calls.
You can test pandas_gbq by running the query using the following command within interactive terminal
python -c 'from google.cloud import bigquery; import pandas_gbq; client = bigquery.Client(); query = """ SELECT FINNGENID FROM finngen-production-library.sandbox_tools_r10.finngen_r10_minimum_v1 LIMIT 10 """; df = pandas_gbq.read_gbq(query, project_id = client.project); print(df) '
You can also do upset plots using package installed in the Anaconda Python environment.
Users can also request any packages that they want to be added into the Anaconda environment which will be updated every few months. Request can be sent tohumgen-servicedesk@helsinki.fi
Also, you can install a python package from the source by following the instructions from handbook page .