[Biojava-l] Getting a Slice of an Alignment

Dexter Riley edbeaty at charter.net
Tue Jun 27 19:57:45 UTC 2006

Richard Holland-2 wrote:
> Ah...
> I just read the source code for the symbolListForLabel() method on sub
> alignments, and found what may well be a bug.
> BioJava list people, your help please! In my understanding,
> symbolListForLabel() should return the symbols from the given label that
> fall within the alignment. This is the case in all except sub
> alignments. Sub alignments, for whatever reason, are returning the
> symbols from the given label that fall within the parent alignment upon
> which the sub alignment is based, NOT just those that fall within the
> sub alignment itself.
> Is this a bug? I think it is.
> The solution would be for me to alter
> AbstractULAlignment.SubULAlignment.symbolListForLabel() to restrict the
> returned symbols to only include those in the area covered by the sub
> alignment. It would return EMPTY_SEQUENCE if the label didn't cover the
> area of the sub alignment, and it would return a truncated symbol list
> if it only partially covered it.
> Would this be acceptable?
> If so, once this change was made, it would fix Ed's problems below as
> subAlignment() would start returning vertical slices as I think it
> should probably have done so from the start, rather than the horizontal
> slices it is returning at present.
> cheers,
> Richard

I think that would provide just the functionality I was looking for!  Thanks
very much for all your help.
All the best,
View this message in context: http://www.nabble.com/Getting-a-Slice-of-an-Alignment-tf1849222.html#a5072893
Sent from the BioJava forum at Nabble.com.

More information about the Biojava-l mailing list