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.driver
Interface LocationConverter

All Superinterfaces:
  Adaptor, java.rmi.Remote

public interface LocationConverter
extends java.rmi.Remote, Adaptor

Converts locations between different coordinate systems.

Field Summary
`static java.lang.String` | `TYPE` Name of the default LocationConverteravailable from a driver.

Method Summary
`Location` | `assignSeqRegionNameAndCoordinateSystem(Location loc)` Sets the sequence region name and coordinate system on _loc_.
`void` | `cacheSeqRegion(java.lang.String seqRegionName, CoordinateSystem cs, long internalId, int regionLength)` Put given combination of things into a cache.
`Location` | `convert(Location location, CoordinateSystem coordinateSystem)` Converts location into target coordinate system with all gaps and all nodes
`Location` | `convert(Location sourceLocation, CoordinateSystem targetCS, boolean includeGaps, boolean allList, boolean includeSequenceRegion)` Create a new location in the target coordinate system that is equivalent to the sourceLocation.
`Location` | `convert(Location sourceLocation, java.lang.String coordinateSystemName)` Converts location into the target coordinate system.
`Location` | `convert(Location location, java.lang.String coordinateSystemName, boolean includeGaps, boolean allList, boolean setSequenceRegion)` Converts location to the specified coordinate system.
`Location` | `convertToTopLevel(Location location)` Fetch the location representing this one in the lowest ranking coordinate system.
`Location` | `dereference(Location loc)` Dereferences location into component locations.
`java.lang.String[]` | `fetchAssemblyNames()` Assemblies in dataset.
`Location` | `fetchComplete(Location location)` Ensures the location is fully specified by filling in missing values with data from the database.
`int` | `getLengthByLocation(Location loc)` Return the length of the used sequence region.
`Location` | `idToLocation(long id)` Make a location from the sequence region internal id, with start =1, end = sequence regon length and strand = 0.
`Location` | `idToLocation(long id, int start, int end, int strand)` Make a location from the sequence region internal id, start, end strand are passed into its constructor
`long[]` | `locationToIds(Location l)` Convenience function to get all ids from non gap nodes of the location.
`long[]` | `namesToIds(java.lang.String[] names, CoordinateSystem cs)` Convert a number of names in the same coordinate system into an array of internal ids.
`long` | `nameToId(java.lang.String seqRegionName, CoordinateSystem cs)` Convert to an internal id, request from database if not in cache
`Location` | `rereference(Location loc, SequenceRegion seqRegion)` References locations into the same sequence region specified by target location.

Methods inherited from interface org.ensembl.driver.Adaptor
`clearCache, closeAllConnections, getType`

Field Detail

### TYPE

    public static final java.lang.String TYPE

  Name of the default LocationConverteravailable from a driver.

  See Also:
    Constant Field Values

Method Detail

### convert

    public Location convert(Location sourceLocation,
                            CoordinateSystem targetCS,
                            boolean includeGaps,
                            boolean allList,
                            boolean includeSequenceRegion)
                     throws AdaptorException

  Create a new location in the target coordinate system that is equivalent to the sourceLocation.

  Parameters:
    `sourceLocation` -
    `targetCS` - This is where you want to convert to
    `includeGaps` - you include or omit gaps that would be in the converted Location
    `allList` - You may work just on the first node or on the full list
    `includeSequenceRegion` - If true, includes sequenceRegion attribute in returned location.
  Returns:
    Location in _targetCS_ corresponding to _sourceLocation_
  Throws:
    `AdaptorException`

### getLengthByLocation

    public int getLengthByLocation(Location loc)
                            throws AdaptorException

  Return the length of the used sequence region.

  Parameters:
    `loc` -
  Returns:
    length by location
  Throws:
    `AdaptorException` - if problem occured retrieving information

### locationToIds

    public long[] locationToIds(Location l)
                         throws AdaptorException

  Convenience function to get all ids from non gap nodes of the location.

  Parameters:
    `l` -
  Returns:
    ids from non gap nodes of the location
  Throws:
    `AdaptorException`

### convert

    public Location convert(Location sourceLocation,
                            java.lang.String coordinateSystemName)
                     throws AdaptorException

  Converts location into the target coordinate system.

  Returns:
    new location corresponding to loc in the specified coordinate system, null if no such location exists.
  Throws:
    `AdaptorException`

### convert

    public Location convert(Location location,
                            CoordinateSystem coordinateSystem)
                     throws AdaptorException

  Converts location into target coordinate system with all gaps and all nodes

  Parameters:
    `location` - source location.
    `coordinateSystem` - target coordinate system.
  Returns:
    new location corresponding to loc in the specified coordinate system, null if no such location exists.
  Throws:
    `AdaptorException`

### convert

    public Location convert(Location location,
                            java.lang.String coordinateSystemName,
                            boolean includeGaps,
                            boolean allList,
                            boolean setSequenceRegion)
                     throws AdaptorException

  Converts location to the specified coordinate system.

  Returns:
    equivalent location in coordinate system, or null if no equivalent exists.
  Throws:
    `AdaptorException`

### fetchAssemblyNames

    public java.lang.String[] fetchAssemblyNames()
                                          throws AdaptorException

  Assemblies in dataset.

  Returns:
    list of zero or more assemblies.
  Throws:
    `AdaptorException`

### cacheSeqRegion

    public void cacheSeqRegion(java.lang.String seqRegionName,
                               CoordinateSystem cs,
                               long internalId,
                               int regionLength)

  Put given combination of things into a cache. Enable quick retrieval of internal ids from LocationConverter.

  Parameters:
    `seqRegionName` - sequence region name
    `cs` - coordinate system
    `internalId` - sequence region internal id
    `regionLength` - sequence region length

### nameToId

    public long nameToId(java.lang.String seqRegionName,
                         CoordinateSystem cs)
                  throws AdaptorException

  Convert to an internal id, request from database if not in cache

  Parameters:
    `seqRegionName` -
    `cs` -
  Returns:
    internal id of the sequence region.
  Throws:
    `AdaptorException`

### namesToIds

    public long[] namesToIds(java.lang.String[] names,
                             CoordinateSystem cs)
                      throws AdaptorException

  Convert a number of names in the same coordinate system into an array of internal ids. Uses cache if possible.

  Parameters:
    `names` -
    `cs` -
  Returns:
    internal ids of the sequence regions.
  Throws:
    `AdaptorException`

### idToLocation

    public Location idToLocation(long id,
                                 int start,
                                 int end,
                                 int strand)
                          throws AdaptorException

  Make a location from the sequence region internal id, start, end strand are passed into its constructor

  Parameters:
    `id` - sequence region internalID
    `start` -
    `end` -
    `strand` -
  Returns:
    Location on that internal id
  Throws:
    `AdaptorException`

### idToLocation

    public Location idToLocation(long id)
                          throws AdaptorException

  Make a location from the sequence region internal id, with start =1, end = sequence regon length and strand = 0.

  Parameters:
    `id` - sequence region internalID
  Returns:
    Location on that internal id
  Throws:
    `AdaptorException`

### assignSeqRegionNameAndCoordinateSystem

    public Location assignSeqRegionNameAndCoordinateSystem(Location loc)
                                                    throws AdaptorException

  Sets the sequence region name and coordinate system on _loc_.

  Parameters:
    `loc` - location to be modified. seqRegionInternalID must be set and >0.
  Returns:
    loc.
  Throws:
    `AdaptorException`

### fetchComplete

    public Location fetchComplete(Location location)
                           throws AdaptorException

  Ensures the location is fully specified by filling in missing values with data from the database. A fully specified (complete) location has values for all these attributes: coordinate system name and version, sequence region name, start, end and strand. If any of these values are missing and can be extracted from the database then they will be set. If no corresponding complete location exists, e.g. the sequence region is not in the database, then null is returned. Perform an in place edit where necessary. Does nothing if the location is complete or can not be made complete.

  Parameters:
    `location` - potentially incomplete location.
  Returns:
    location with CoordinateSystem, seqRegionName, start and end set, or null if the location cannot be completed.
  Throws:
    `AdaptorException`

### convertToTopLevel

    public Location convertToTopLevel(Location location)
                               throws AdaptorException

  Fetch the location representing this one in the lowest ranking coordinate system.

  Parameters:
    `location` - source location to be converted
  Returns:
    The location with the lowest level coordinate system corresponding to the location, or null if non exists.
  Throws:
    `AdaptorException`

### rereference

    public Location rereference(Location loc,
                                SequenceRegion seqRegion)
                         throws AdaptorException

  References locations into the same sequence region specified by target location. Facade method that delegates to AssemblyExceptionAdaptor.

  Throws:
    `AdaptorException`
  See Also:
    `AssemblyExceptionAdaptor.rereference(Location, SequenceRegion)`, `dereference(Location)`

### dereference

    public Location dereference(Location loc)
                         throws AdaptorException

  Dereferences location into component locations. Facade method that delegates to AssemblyExceptionAdaptor.

  Throws:
    `AdaptorException`
  See Also:
    `AssemblyExceptionAdaptor.dereference(Location)`, `rereference(Location, SequenceRegion)`

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