JS npm package

The MGnify npm JS package is an AMD module which can be built into to retrieve and display data directly from the MGnify api.

Current npm package version is 0.5.2

To develop using this package, please use wwwdev.ebi.ac.uk as the API domain name. For production uses, please contact metagenomics-help@ebi.ac.uk to get your domain whitelisted.

Installation

Server-side

npm install mgnify --save

Example usage

// To load data-fetch api only

const api = require('mgnify').api;
const study = new api.Study({accession: 'MGYS00000410'});

// To use charts:

const charts = require('mgnify').charts;

// using existing api instance
const qcChart = new charts.QcChart('containerID', {apiConfig: api});

// alternately:
const apiConfig = {API_URL: 'http://localhost:9000/metagenomics/api/v1/'};
const qcChart = new charts.QcChart('containerID', {apiConfig: apiConfig});

Client side

Getting started

Data retrieval

Studies

Retrieving a study by accession

Retrieving a list of all studies

Retrieving a list of studies related to a sample

Retrieve a list of sample geo-coordinates for a study

Retrieve a list of analyses for a study

Retrieve all available downloads for a study

Samples

Retrieving a sample by accession

Retrieving a list of all samples

Runs

Retrieve a run by accession

Retrieve a list of all runs

Retrieve a list of analyses for a run by accession

Retrieve a list of analyses of assemblies for a run by run accession

Analysis data

Retrieve an analysis by accession

Retrieve a list of all downloads for an analysis

Biomes

Retrieve a biome by lineage

Retrieve a list of all biomes

Retrieve a list of biomes rooted at specified lineage

Publications

Retrieve a publication by id

Retrieve a list of all publications

Retrieve a list of studies related to a publication

Data display

The following section lists examples of how to load data analysis charts seen on the MGnify website.

QC chart

Taxonomy charts

The taxonomy pie, column and stacked column charts can all be loaded using the same parameters; the following example is therefore compatible with any of the 3 classes by changing the instantiated class name (TaxonomyPie, TaxonomyColumn & TaxonomyColumnStacked)

Nucleotide position histogram

InterPro match pie chart

Reads length histogram and sequence length bar chart

Reads GC Distribution & GC/AT content

GO Term charts

The following chart can also be loaded in bar chart form using the GOTermBarChart class.

Sequence feature summary