[Biojava-l] how to do multi-lined feature display

Keith James kdj at sanger.ac.uk
Thu Mar 27 20:05:07 EST 2003


>>>>> "Patrick" == Patrick McConnell <MCCon012 at mc.duke.edu> writes:

    Patrick> Let me be more specific.  I want to be able to reproduce
    Patrick> something like EnsEMBL, where I have one sequence and
    Patrick> multiple tracks of features.

    Patrick> Specifically, I have a sequence and a bunch of blast hits
    Patrick> from different databases.  I also have some other data,
    Patrick> such as quality scores for the sequence, that I need to
    Patrick> build custom renderers for (which will come later).

    Patrick> I think I need to use the MultiLineRenderer in
    Patrick> conjunction with a SequencePanel, but I cannot figure out
    Patrick> how to get multiple tracks of annotations.  Do I need to
    Patrick> add Features to the Sequence in a special manner?

Using a MultiLineRenderer will allow you to have multiple tracks. You
may then put a different SequenceRenderer in each track.

Take a SequencePanel (easier to implement scrolling -simply place into
a ScrollPane) or TranslatedSequencepanel (must have scrolling
implemented manually by hooking a JScrollBar to change the sequence
position of the area to be viewed, but last benchmarked 7x faster than
SequencePanel).

Set the Panel's SequenceRenderer to be a MultiLineRenderer. You can
then add more SequenceRenderers to the multi, each with different
views of the Sequence and its complement of Features. Make these
renderers FilteringRenderers (which are SequenceRendererWrappers) to
get different views per track. Specify a FeatureFilter for each
FilteringRenderer to determine waht to show in each track. You can
combine multiple FeatureFilters via the filtering API.

You can also use BeadFeatureRenderer (a SequenceRenderer) to show any
number of different Feature types, each rendered distinctively, all on
the same track. It also allows you to have different types of Feature
at different Y-axis displacements in the same track.

Does this help at all?

Keith

-- 

- Keith James <kdj at sanger.ac.uk> bioinformatics programming support -
- Pathogen Sequencing Unit, The Wellcome Trust Sanger Institute, UK -



More information about the Biojava-l mailing list