Quick start - Download - Overview - API - FAQ - How-To - Examples - Jython - Contact - Links - Release Notes - License

# Introduction

Java and Jython API for Ensembl's core, compara and variation (SNP) databases.

## Core databases

The ensembl core database types such as Gene and Sequence are defined in org.ensembl.datamodel and are retrieved via CoreDriver instances and adaptors defined in org.ensembl.driver. This code snippet shows how to retrieve some genes from the latest human data set published on ensembldb.ensembl.org.

    import org.ensembl.driver.CoreDriver;
    import org.ensembl.driver.CoreDriverFactory;
    ...
    CoreDriver humanCoreDriver = CoreDriverFactory.createCoreDriverUsingDatabasePrefix("ensembldb.ensembl.org",3306, "homo_sapiens_core", "anonymous", null);
    List genes = humanCoreDriver.getGeneAdaptor().fetch(new Location("chromosome:22:21m-22m"))

## Variation (SNP) databases

Ensembl variation (SNP) databases are accessed via the org.ensembl.variation package. Variation datatypes such as VariationFeature and Allele are defined in org.ensembl.variation.datamodel and are retrieved via VariationDriver instances and adaptors defined in org.ensembl.variation.driver. This code snippet shows how to retrieve some variation features (where variations appear on the genome) from the latest human data set published on ensembldb.ensembl.org.

    import org.ensembl.variation.driver.VariationDriver;
    import org.ensembl.variation.driver.VariationDriverFactory;
    ...
    VariationDriver humanVariationDriver = VariationDriverFactory.createVariationDriverUsingDatabasePrefix("ensembldb.ensembl.org",3306, "homo_sapiens_variation", "anonymous", null);
    List variationFeatures = humanVariationDriver.getVariationFeatureAdaptor().fetch(new Location("chromosome:22:21m-22m"))

## Compara databases

Ensembl compara databases are accessed via the org.ensembl.compara package. Compara datatypes such as Homology and DnaFragment are defined in org.ensembl.compara.datamodel and are retrieved via ComparaDriver instances and adaptors defined in org.ensembl.compara.driver.

## Examples

For more examples see Example.java (txt) which demonstrates how to connect to a ensembl databases with drivers and retrieve data via adaptors.