[Biojava-dev] How to Use SixFrameRenderer and related classes?

hywang hywang at scbit.org
Sat Aug 2 17:59:19 EDT 2003


Hi, 

I had a test to view sequence feature in six frame mode.
But I failed and got a big mass of error info which are
not from my java code, so I couldn't even debug it.
Could you please give me a hand to show me the right way
to use SixFrameRenderer and related classes,please? 

Thanks ,
Haiyan Wang 

below is my codes: 

try{
six_panel = new SequencePanel();
six_panel.setSequence(seq);
MultiLineRenderer zml = new MultiLineRenderer();
SixFrameRenderer sixFramePane = new SixFrameRenderer();
SixFrameZiggyRenderer sixZig = new SixFrameZiggyRenderer   (sixFramePane);
FeatureFilter cdsFilter = new FeatureFilter.ByType("CDS"); 

FeatureBlockSequenceRenderer featureBin = new 
FeatureBlockSequenceRenderer(sixZig); 

zml.addRenderer(new OverlayRendererWrapper(new FilteringRenderer(featureBin, 
cdsFilter, true)));
zml.addRenderer(new OverlayRendererWrapper(new StopRenderer(sixFramePane, 0, 
StrandedFeature.POSITIVE)));
zml.addRenderer(new OverlayRendererWrapper(new StopRenderer(sixFramePane, 1, 
StrandedFeature.POSITIVE)));
zml.addRenderer(new OverlayRendererWrapper(new StopRenderer(sixFramePane, 2, 
StrandedFeature.POSITIVE)));
zml.addRenderer(new OverlayRendererWrapper(new StopRenderer(sixFramePane, 0, 
StrandedFeature.NEGATIVE)));
zml.addRenderer(new OverlayRendererWrapper(new StopRenderer(sixFramePane, 1, 
StrandedFeature.NEGATIVE)));
zml.addRenderer(new StopRenderer(sixFramePane, 2,StrandedFeature.NEGATIVE)); 

zml.addRenderer(new SymbolSequenceRenderer());
zml.addRenderer(new RulerRenderer()); 

six_panel.setRange(new RangeLocation(1, seq.length()));
six_panel.setRenderer(zml);
six_panel.setScale(15);//400.0/seq.length());
//System.out.println(seq.length());
sixframe_view.getViewport().add(six_panel);
}
catch(ChangeVetoException e) {
               e.printStackTrace();
} 

/**************************************/ 

below are parts of the error info: 

	at 
org.biojava.bio.seq.io.SubArraySymbolList.symbolAt(SubArraySymbolList.java:7 
7)
	at 
org.biojava.bio.seq.impl.SimpleSequence.symbolAt(SimpleSequence.java:101)
	at org.biojava.bio.gui.sequence.StopRenderer.isStop(StopRenderer.java:123)
	at 
org.biojava.bio.gui.sequence.StopRenderer.renderOneFrame(StopRenderer.java:1 
61)
	at org.biojava.bio.gui.sequence.StopRenderer.paint(StopRenderer.java:197)
	at 
org.biojava.bio.gui.sequence.LayeredRenderer.paint(LayeredRenderer.java:186)
	at 
org.biojava.bio.gui.sequence.MultiLineRenderer.paint(MultiLineRenderer.java: 
186)
	at 
org.biojava.bio.gui.sequence.SequencePanel.paintComponent(SequencePanel.java 
:471)
	at javax.swing.JComponent.paint(JComponent.java:808)
	at javax.swing.JComponent.paintChildren(JComponent.java:647)
... 

/***********************************************/ 



More information about the biojava-dev mailing list