org.utgenome.gwt.utgb.client.track.lib
Class ReadTrack

java.lang.Object
  extended by org.utgenome.gwt.utgb.client.track.TrackBase
      extended by org.utgenome.gwt.utgb.client.track.lib.ReadTrack
All Implemented Interfaces:
Track, TrackEntry, TrackGroupPropertyChangeListener
Direct Known Subclasses:
DASTrack

public class ReadTrack
extends TrackBase

Track for displaying read data in BED,SAM,BAM formats.

View Example

 -track
  -class: ReadTrack
  -name: (track name)
  -properties
    -path: (database path. e.g, db/imported/hg19/myread.bed)
    -onclick.url: http://www.google.com/search?q=%q
    -onclick.action: (none|link|info|set)
    -showLabels: (true|false)
    -onclick.p.key: current.read
    -onclick.p.value: %q
 

You can customize the behavior of the browser when clicking a read using onclick.action parameter:

On-Click Action Types

Type Action
none Disables click action
link Opens an URL specified in onclick.url parameter.
info Displays the detailed read information.
set Sets a track group property (specified by onclick.p.key) using the value onclick.p.value.

You can embed track or track group parameters in onclick.url and target.value:

Parameters for On-Click event

pattern to be replaced with
%q Clicked read name
%qstart Start position of the clicked read
%qend End position of the clicked read
%qlen Length of the clicked read
%species Species name
%ref Reference sequence name
%chr Chromosome/contig/scaffold name
%start Start position on the genome (inclusive)
%end End position on the genome (exclusive)
%len Sequence length currently displayed
%pixelwidth Pixel width of the tracks

Author:
leo

Nested Class Summary
 
Nested classes/interfaces inherited from class org.utgenome.gwt.utgb.client.track.TrackBase
TrackBase.TrackFrameConfig
 
Nested classes/interfaces inherited from interface org.utgenome.gwt.utgb.client.track.Track
Track.TrackFactory
 
Field Summary
 
Fields inherited from class org.utgenome.gwt.utgb.client.track.TrackBase
_frame, _trackGroup, _trackInfo, frameConfig
 
Constructor Summary
ReadTrack()
           
ReadTrack(String trackName, String dbType)
           
 
Method Summary
 void beforeChangeTrackWindow(TrackWindow newWindow)
          An event handler that will be invoked before the track window location change
static int calcXPositionOnWindow(long indexOnGenome, long startIndexOnGenome, long endIndexOnGenome, int windowWidth)
           
 void draw()
          draw the track widget
static Track.TrackFactory factory()
           
 GenomeDB getGenomeDB()
          Override this method to extend db info parameters
protected  String getPath()
           
protected  String getTrackURL(String trackBaseURL)
           
 com.google.gwt.user.client.ui.Widget getWidget()
           
protected  String getWIGPath()
           
 void onChangeTrackConfig(TrackConfigChange change)
          An event handler when some cofigurations of the track changes
 void onChangeTrackGroupProperty(TrackGroupPropertyChange change)
          An event handler when some properties shared within the track group has changed
 void onChangeTrackWindow(TrackWindow newWindow)
          An event handler when the track window location has changed
 String resolveURL(String urlTemplate, GenomeRange locus)
           
 void restoreProperties(CanonicalProperties properties)
          Override this method to restore internal state of the track
 void setUp(TrackFrame trackFrame, TrackGroup group)
          This method is invoked when TrackFrame and TrackGroup for this track become ready, that is, the track is drawable.
protected  void update(TrackWindow newWindow, boolean forceReload)
           
 
Methods inherited from class org.utgenome.gwt.utgb.client.track.TrackBase
error, getBrowserService, getClassName, getConfig, getCoordinate, getDefaultWindowHeight, getFrame, getMinimumWindowHeight, getName, getTrackGroup, getTrackGroupProperty, getTrackGroupProperty, getTrackInfo, getTrackWindow, isInitialized, isTrack, isTrackGroup, loadView, onChange, onChangeTrackHeight, refresh, resolvePropertyValues, saveProperties, setCenterOfTrackWindow, setConfig, setFrame, setTrackGroup, setTrackGroupProperty, toView, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadTrack

public ReadTrack()

ReadTrack

public ReadTrack(String trackName,
                 String dbType)
Method Detail

factory

public static Track.TrackFactory factory()

resolveURL

public String resolveURL(String urlTemplate,
                         GenomeRange locus)

getWidget

public com.google.gwt.user.client.ui.Widget getWidget()
Returns:
the track widget

setUp

public void setUp(TrackFrame trackFrame,
                  TrackGroup group)
Description copied from interface: Track
This method is invoked when TrackFrame and TrackGroup for this track become ready, that is, the track is drawable. Override this method to write initialization codes for your tracks.

Specified by:
setUp in interface Track
Overrides:
setUp in class TrackBase
group - the TrackGroup of this track

beforeChangeTrackWindow

public void beforeChangeTrackWindow(TrackWindow newWindow)
Description copied from interface: Track
An event handler that will be invoked before the track window location change

Specified by:
beforeChangeTrackWindow in interface Track
Overrides:
beforeChangeTrackWindow in class TrackBase

draw

public void draw()
Description copied from interface: Track
draw the track widget

Specified by:
draw in interface Track
Overrides:
draw in class TrackBase

getTrackURL

protected String getTrackURL(String trackBaseURL)

calcXPositionOnWindow

public static int calcXPositionOnWindow(long indexOnGenome,
                                        long startIndexOnGenome,
                                        long endIndexOnGenome,
                                        int windowWidth)

onChangeTrackWindow

public void onChangeTrackWindow(TrackWindow newWindow)
Description copied from interface: Track
An event handler when the track window location has changed

Specified by:
onChangeTrackWindow in interface Track
Overrides:
onChangeTrackWindow in class TrackBase

onChangeTrackGroupProperty

public void onChangeTrackGroupProperty(TrackGroupPropertyChange change)
Description copied from interface: Track
An event handler when some properties shared within the track group has changed

Specified by:
onChangeTrackGroupProperty in interface Track
Overrides:
onChangeTrackGroupProperty in class TrackBase

update

protected void update(TrackWindow newWindow,
                      boolean forceReload)

getPath

protected String getPath()

getWIGPath

protected String getWIGPath()

getGenomeDB

public GenomeDB getGenomeDB()
Override this method to extend db info parameters

Returns:

onChangeTrackConfig

public void onChangeTrackConfig(TrackConfigChange change)
Description copied from interface: Track
An event handler when some cofigurations of the track changes

Specified by:
onChangeTrackConfig in interface Track
Overrides:
onChangeTrackConfig in class TrackBase

restoreProperties

public void restoreProperties(CanonicalProperties properties)
Description copied from class: TrackBase
Override this method to restore internal state of the track

Specified by:
restoreProperties in interface Track
Overrides:
restoreProperties in class TrackBase


Copyright © 2007-2012 utgenome.org. All Rights Reserved.