[Biojava-l] ComponentFeature.Template

Thomas Down td2@sanger.ac.uk
Tue, 5 Jun 2001 13:14:20 +0100


On Tue, Jun 05, 2001 at 01:12:14PM +0100, Dr S.M. Huen wrote:
> Yes it is.
> 
> But the reason I gained the impression that strand wasn't supported was
> from this part of AssembledSymbolList.java:-
> 
>     public Symbol symbolAt(int pos) {
> 	Location l = locationOfPoint(pos);
> 	if (l != null) {
> 	    SymbolList syms = getComponentSymbols(l);
> 	    return syms.symbolAt(pos - l.getMin() + 1);
> 	}
> 
> 	return N;
>     }
> 
> The symbol returned is always relative to the getMin end irrespective of
> strand.
> 
> However, it appears that coordinate conversion happens at the
> ProjectedFeatureHolder which you refer to.  I'll read the source of this
> thoroughly to see that I have understood it correctly.

No, I think that code is correct.

If you trace a bit further, it's calling the getSymbols() method
on the ComponentFeature.  This returns a SymbolList which has
already been trimmed (and flipped, if necessary).  This isn't
necessarily the best way to handle it, but it is hidden under
the hood, and it does (to the best of my knowledge ;) give the
correct answer.

   Thomas.


PS. I'm just checking in the GAME stuff at the moment -- will
turn up in anonymous CVS in the next hour or so.  Thanks for
all that!