[Biojava-l] Basis and Atomic Symbols

Schreiber, Mark mark.schreiber@agresearch.co.nz
Wed, 7 Mar 2001 12:25:48 +1300


> -----Original Message-----
> From: Thomas Down [mailto:td2@sanger.ac.uk]
> Sent: Wednesday, March 07, 2001 12:23 PM
> To: Schreiber, Mark
> Cc: 'biojava-l@biojava.org'
> Subject: Re: [Biojava-l] Basis and Atomic Symbols
> 
> 
> On Wed, Mar 07, 2001 at 11:44:53AM +1300, Schreiber, Mark wrote:
> > Hi
> > 
> > Is there anyway to convert a basis symbol into a list of 
> non-redundant
> > Atomic symbols that would make up the basis symbol.
> 
> I take it you mean "take the basis symbol 'awa' and return
> 'ata' and 'aaa'?
> 
> The getMatches method returns an Alphabet which contains
> these symbols.  You can iterate over it and populate
> a list if that's helpful.

OK that'll work


> 
> > Alternatively if a basis symbol is actually non-redundant 
> can this be
> > determined and is there a way to convert it to an Atomic 
> Symbol (casting is
> > not allowed).
> 
> A non-ambiguous basis symbol (I take it this is what you
> mean by non-redundant) IS an atomic symbol.  The behind-the-scenes
> Symbol construction code in AlphabetManager and friends should
> ensure that this is the case.  You can check with instanceof
> 
> This doesn't avoid the need for a cast, though.  What is the
> problem with casting?
> 


Actually there wasn't a problem with casting per se I just needed to
sensibly deal with the basis symbol objects by catching ClassCastExceptions
or via your idea of using instanceof.

Thanks

Mark