Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ensembl
Class Example

    java.lang.Object
      org.ensembl.Example

public class Example
extends java.lang.Object

Example code demonstrating how to retrieve data from ensembl databases using ensj. The examples below retrieve data from the latest human core and variation databases on ensembldb.ensembl.org

Author:
  Craig Melsopp
See Also:
  Example.java source (txt)

Constructor Summary
`Example()` Creates an instance of Example with core and varition drivers configured.

Method Summary
`void` | `convertLocationToCoordinateSystemAndGetTheSeqRegionNames(Location sourceLoc, CoordinateSystem targetCS)` Converts location into the target coordinate system and prints the results.
`void` | `countGenesAndExonsInEachLocation()` Fetch the genes and exons in several locations and print how many there are in each one.
`static Location[]` | `createLocations()` Create and then return some ensj locations.
`void` | `displayDriversState()` Print details about the drivers' configurations.
`void` | `fetchDeletedGeneFromArchive()` Fetches information about a gene from the archive.
`void` | `fetchExonByInternalID()` Fetch an exon by it's internal id and print it.
`void` | `fetchGeneByStableIDAndViewPeptide()` Fetch a gene by it's stable ID and then print the peptide corresponding to its first transcript.
`void` | `fetchGenesByExternalRefs()` Fetch genes corresponding to various external references/identifier such as HUGO ids and Affymetrix probeset names.
`void` | `fetchGenesByLocation(Location location)` This method illustrates several ways to retrieve genes from a specified location.
`void` | `fetchKaryotypes(CoordinateSystem coordinateSystem, java.lang.String chromosomeName)` Fetches information about karyotypes (chromosome bands) for the specified chromosome.
`void` | `fetchSequenceRegionsSuchAsChromosomeOrContig(CoordinateSystem coordinateSystem)` Fetches information about the sequence regions.
`void` | `fetchVariationsOverlapingGenes()` Fetches all the variations that overlap a particular gene.
`void` | `fetchVariationsOverlapingLocation()` Fetches all the variations in a specified location from the variation driver.
`static void` | `main(java.lang.String[] args)` Prints some debug information before printing the output from the example methods in this class.
`void` | `showExternalRefsForAGene()` Fetches a gene from the database and prints a summary of it's external refs if it has any.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Example

    public Example()
            throws AdaptorException

  Creates an instance of Example with core and varition drivers configured.

Throws:
  `AdaptorException`

Method Detail

### main

    public static void main(java.lang.String[] args)
                     throws ConfigurationException,
                            AdaptorException,
                            java.text.ParseException

  Prints some debug information before printing the output from the example methods in this class.

  Parameters:
    `args` - ignored.
  Throws:
    `AdaptorException` - if a problem occurs retrieving data
    `ConfigurationException` - if a problem occurs initialising the driver(s)
    `java.text.ParseException` - if a problem occurs parsing the string used to construct a location

### fetchVariationsOverlapingGenes

    public void fetchVariationsOverlapingGenes()
                                        throws AdaptorException

  Fetches all the variations that overlap a particular gene.

  Throws:
    `AdaptorException`

### fetchVariationsOverlapingLocation

    public void fetchVariationsOverlapingLocation()
                                           throws AdaptorException,
                                                  java.text.ParseException

  Fetches all the variations in a specified location from the variation driver.

  Throws:
    `AdaptorException`
    `java.text.ParseException`

### fetchGenesByExternalRefs

    public void fetchGenesByExternalRefs()
                                  throws AdaptorException

  Fetch genes corresponding to various external references/identifier such as HUGO ids and Affymetrix probeset names.

  Throws:
    `AdaptorException`

### convertLocationToCoordinateSystemAndGetTheSeqRegionNames

    public void convertLocationToCoordinateSystemAndGetTheSeqRegionNames(Location sourceLoc,
                                                                         CoordinateSystem targetCS)
                                                                  throws AdaptorException

  Converts location into the target coordinate system and prints the results.

  Parameters:
    `sourceLoc` - source location to be converted
    `targetCS` - target coordinate system to convert location into.
  Throws:
    `AdaptorException` - if a problem occured during the conversion

### fetchExonByInternalID

    public void fetchExonByInternalID()
                               throws AdaptorException

  Fetch an exon by it's internal id and print it.

  Throws:
    `AdaptorException` - if a problem occured during the retrieval

### createLocations

    public static Location[] createLocations()

  Create and then return some ensj locations.

  Returns:
    array of locations that can used in queries.

### countGenesAndExonsInEachLocation

    public void countGenesAndExonsInEachLocation()
                                          throws AdaptorException

  Fetch the genes and exons in several locations and print how many there are in each one.

  Throws:
    `AdaptorException` - if problem occurs during retrieval

### fetchGeneByStableIDAndViewPeptide

    public void fetchGeneByStableIDAndViewPeptide()
                                           throws AdaptorException

  Fetch a gene by it's stable ID and then print the peptide corresponding to its first transcript.

  Throws:
    `AdaptorException` - if problem occurs during retrieval

### fetchGenesByLocation

    public void fetchGenesByLocation(Location location)
                              throws AdaptorException

  This method illustrates several ways to retrieve genes from a specified location. With locations containing few genes the memory and speed differences between the methods will be small but for locations containing many genes the difference is potentially huge.

  Parameters:
    `location` - location to fetch genes from
  Throws:
    `AdaptorException` - if problem occurs during retrieval

### fetchDeletedGeneFromArchive

    public void fetchDeletedGeneFromArchive()
                                     throws AdaptorException

  Fetches information about a gene from the archive.

  Throws:
    `AdaptorException` - if problem occurs during retrieval

### fetchKaryotypes

    public void fetchKaryotypes(CoordinateSystem coordinateSystem,
                                java.lang.String chromosomeName)
                         throws AdaptorException

  Fetches information about karyotypes (chromosome bands) for the specified chromosome.

  Parameters:
    `coordinateSystem` - coordinate system containing the chromosomeName
    `chromosomeName` - name of the chromosome of interest
  Throws:
    `AdaptorException` - if problem occurs during retrieval

### fetchSequenceRegionsSuchAsChromosomeOrContig

    public void fetchSequenceRegionsSuchAsChromosomeOrContig(CoordinateSystem coordinateSystem)
                                                      throws AdaptorException

  Fetches information about the sequence regions.

  Throws:
    `AdaptorException` - if problem occurs during retrieval

### showExternalRefsForAGene

    public void showExternalRefsForAGene()
                                  throws AdaptorException

  Fetches a gene from the database and prints a summary of it's external refs if it has any.

  Throws:
    `AdaptorException`

### displayDriversState

    public void displayDriversState()
                             throws AdaptorException

  Print details about the drivers' configurations.

  Throws:
    `AdaptorException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD