[Biojava-l] aligning sequences with ambiguous bases

Wim De Smet Wim.DeSmet at UGent.be
Tue Mar 29 08:22:16 UTC 2011


I believe I figured it out.

The constructor of DNASequence can take a CompoundSet and passing an 
AmbiguityDNACompoundSet in there seems to work. There's not a lot of 
documentation in the javadoc, but it seems to give the behaviour I want.

cheers
Wim

On 28-03-11 16:46, Wim De Smet wrote:
> Hi
>
> (sorry if you get 2 copies, I sent this to -request by mistake)
>
> Apologies if this has come up before, a quick search didn't turn
> anything up.
>
> I'm attempting to do a pairwise alignment between two DNA sequences
> using biojava 3. When I try to construct a DNASequence from a string
> that contains an ambiguous base though (in this case 'y'), I get the
> following stacktrace.
>
> Exception in thread "main"
> org.biojava3.core.exceptions.CompoundNotFoundError: Compound not found
> for: Cannot find compound for: y
> at
> org.biojava3.core.sequence.storage.ArrayListSequenceReader.setContents(ArrayListSequenceReader.java:196)
>
> at
> org.biojava3.core.sequence.template.AbstractSequence.<init>(AbstractSequence.java:88)
>
> at org.biojava3.core.sequence.DNASequence.<init>(DNASequence.java:64)
>
> Should I attempt to mask them somehow? What's the best way to deal with
> these?
>
> cheers
> Wim


-- 
Wim De Smet
http://www.straininfo.net/



More information about the Biojava-l mailing list