Skip to content

Scripting: Language Dependencies

ens-bwalts edited this page Feb 5, 2020 · 1 revision

Before writing Ensembl scripts in Python, Perl, or R, make sure you have the following dependencies for your chosen language:

Python Modules

To make requests in Python, you need the requests package: https://pypi.org/project/requests/.

To decode JSON, you need the json package: this should ship with standard Python installations.

To print JSON in an easy to read way, you need pprint: this should ship with standard Python installations.


import requests, sys, json
from pprint import pprint

R Libraries

To make requests in R, you need the httr library.

To decode JSON, you need the jsonlite package.

To get a more human readable format use the prettify function from the jsonlite package.


library(httr)
library(jsonlite)

Perl Modules

To make requests in Perl, you need the HTTP:Tiny module: this should ship with standard Perl installations.

To decode JSON, you need the JSON package: https://metacpan.org/pod/JSON.

To print JSON in an easy to read way, you need Data::Dumper : this should ship with standard Perl installations.

use Data::Dumper;
use HTTP::Tiny;
use JSON;