## Ensj Quick Start

1. Install ensj-XX-Y.jar and mysql-XXX.jar in your classpath.
2. Get a driver connected to an ensembl database. e.g.
   - Use the default registry to get a driver for the latest human core database on ensembldb.ensembl.org (requires no user configuration):

         import org.ensembl.driver.CoreDriver;
         import org.ensembl.registry.Registry;
         ...
         Registry registry = Registry.createDefaultRegistry();
         CoreDriver coreDriver = registry.getGroup("human").getCoreDriver();

   - Use a configuration file with a factory method to specify the database (the database_prefix parameter means "use the latest human core database"):

         CoreDriver coreDriver = CoreDriverFactory.createCoreDriver("my_database.properties");
         ...

         #my_database.properties:
         host ensembldb.ensembl.org
         port 3306
         user anonymous
         database_prefix homo_sapiens_core

   - Use a standard factory method to specify the database:

         CoreDriver coreDriver =
         CoreDriverFactory.createCoreDriver("ensembldb.ensembl.org",
         3306, "homo_sapiens_core_25_34e", "anonymous", null);

3. Use an adaptor from the driver to retrieve data of interest. e.g.

       List genes = coreDriver.getGeneAdaptor().fetch(new Location("chromosome:2:20m-21m:1"))
       for (int j = 0; j < genes.size(); j++) {
         Gene g = (Gene) genes.get(j);
         System.out.println(g.getAccessionID());
       }