1001 Genomes REST API

The REST API provides programmatic access to the 1135 strains data.

Please note that we are still in BETA phase. If you encounter any issues, please contact joffrey.fitz@tuebingen.mpg.de. As well, any suggestions are welcome.

Overview

Currently we provide the following services. More to come.

GET pseudogenomes/strains/:strains/gids/:gids

Download pseudogenome sequences for the given strains and gene identifiers.

Resource URL

http://tools.1001genomes.org/api/v1/pseudogenomes/strains/:strains/gids/:gids

Parameters

strains

gids

Response format

Plain text FASTA

Examples

http://tools.1001genomes.org/api/v1/pseudogenomes/strains/88/gids/At1G01070.1 http://tools.1001genomes.org/api/v1/pseudogenomes/strains/88,108/gids/At1G01070.1,AT1G01060.2

GET pseudogenomes/strains/:strains/regions/:regions

Download pseudogenome sequences for the given strains and chromosome regions.

Resource URL

http://tools.1001genomes.org/api/v1/pseudogenomes/strains/:strains/regions/:regions

Parameters

strains

regions

Response format

Plain text FASTA

Examples

http://tools.1001genomes.org/api/v1/pseudogenomes/strains/88,108/regions/Chr1:10000..10100

http://tools.1001genomes.org/api/v1/pseudogenomes/strains/88,108/regions/Chr2:100..200,Chr4:220..300

POST pseudogenomes/

If you need to mix gene identifier and chromosome regions, you can specifiy these as POST parameters.

Resource URL

http://tools.1001genomes.org/api/v1/pseudogenomes

Parameters

strains

gids

regions

Response format

Plain text FASTA

Example

$ curl -X POST -d "strains=88,108&gids=AT1G01070.1&regions=Chr1:3631..5899" \
http://tools.1001genomes.org/api/v1/pseudogenomes

GET vcfsubset/strains/:strains/gids/:gids/type/:type/format/:format

Download subsets of variants in VCF/BCF format for given strains and gene identifiers.

Resource URL

http://tools.1001genomes.org/api/v1/vcfsubset/strains/:strains/gids/:gids/type/:type/format/:format

Parameters

strains

gids

type

format

Response format

Plain text VCF, gzipped VCF or BCF as set by the format parameter.

Examples

http://tools.1001genomes.org/api/v1/vcfsubset/strains/9998,9999/gids/AT1G01070.1,AT1G01070.2/type/fullgenome/format/vcf

http://tools.1001genomes.org/api/v1/vcfsubset/strains/9998,9999/gids/AT1G01070.1,AT1G01070.2/type/snpeff/format/bcf

GET vcfsubset/strains/:strains/regions/:regions/type/:type/format/:format

Download subsets of variants in VCF/BCF format for given strains and regions.

Resource URL

http://tools.1001genomes.org/api/v1/vcfsubset/strains/:strains/regions/:regions/type/:type/format/:format

Parameters

strains

regions

type

format

Response format

Plain text VCF, gzipped VCF or BCF according set by the format parameter.

Examples

http://tools.1001genomes.org/api/v1/vcfsubset/strains/9998,9999/regions/Chr1:1000..1010,Chr2:2000..2010/type/fullgenome/format/vcf

http://tools.1001genomes.org/api/v1/vcfsubset/strains/9998,9999/regions/Chr1:1000..1010,Chr2:2000..2010/type/snpeff/format/bcf

POST vcfsubset/

Download subsets of variants in VCF/BCF format for given strains and/or regions.

Resource URL

http://tools.1001genomes.org/api/v1/vcfsubset/

Parameters

strains

regions

gids

type

format

Response format

Plain text VCF, gzipped VCF or BCF according set by the format parameter.

Example

curl -X POST piton.eb.local/api/v1/vcfsubset/ \
-d "strains=9998,9999&regions=1:200-220,3:390-400&type=fullgenome&format=vcf"

GET gi2coords/:gi

Convert gene identifiers to region coordinates.

Resource URL

http://tools.1001genomes.org/api/v1/gi2coords/:gi

Parameters

gi

Response format

The region string in the format ^Chr:\d+\.\.\d+$ , e.g. Chr1:3000..4000, and the direction (+/-) as JSON string.

Example:

{
    "regions": [{
        "reg_str": "Chr1:38752..40944",
        "dir": "-"
    }, {
        "reg_str": "Chr1:38752..40927",
        "dir": "-"
    }]
}

Example

http://tools.1001genomes.org/api/v1/gi2coords/AT1G01070.1

http://tools.1001genomes.org/api/v1/gi2coords/AT1G01070.1,AT1G01070.2

Error Codes

202: Gene identifiers

If the requested gene identifier was not found, an error with code 202 will be returned as JSON:

{
    "errors": [{
        "code": 202,
        "message": "Gene identifier not found: At1G01070"
    }
}

203: Regions

If a malformed region string was submitted, an error with code 203 will be returned:

{
    "errors": [{
        "code": 203,
        "message": "Invalid region: Chr1:20"
    }]
}

204: Strains

If a requested strain was not found, an error with code 204 will be returned as JSON:

{
    "errors": [{
        "code": 204,
        "message": "Strain not found: Tomato1"
    }]
}   

205: Strains

A strain id must be numeric, otherwise an error with code 205 will be returned as JSON:

{
    "errors": [{
        "code": 205,
        "message": "Invalid strain id: 9999a"
    }]
}

206: VCF Format

If a not supported format is requested, ae error with code 206 will be returned. Currently supported formats are vcf, bcf and vcf.gz.

{
    "errors": [{
        "code": 206,
        "message": "Format 'vf' not supported"
    }]
}

207: VCF Data Source

If an other data type as fullgenome or snpeff is requested, an error with code 207 will be returned:

{
    "errors": [{
        "code": 207,
        "message": "Type 'foo' not supported"
    }]
}

Rate limits

At this time, users can make 2 requests/queries per second.


Version 1.0 — © 2016 Max Planck Institute for Developmental Biology — Contact: joffrey.fitz@tuebingen.mpg.de