[Biojava-l] IndexOutOfBounds Exception when performing Pairwise Alignment

Andreas Prlic andreas at sdsc.edu
Fri Dec 2 22:04:56 UTC 2011


Hi Hannes,

Did you make sure to use the correct substitution matrix for the
alignment? You need substitution scores for all nucleotides in your
sequence to be present in the matrix...

Andreas

On Thu, Dec 1, 2011 at 4:59 AM, Hannes Brandstätter-Müller
<biojava at hannes.oib.com> wrote:
> What am I doing wrong? I get:
>
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index:
> 0, Size: 0
>        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
>        at java.util.ArrayList.get(ArrayList.java:322)
>        at org.biojava3.alignment.SimpleAlignedSequence.setLocation(SimpleAlignedSequence.java:362)
>        at org.biojava3.alignment.SimpleAlignedSequence.<init>(SimpleAlignedSequence.java:88)
>        at org.biojava3.alignment.SimpleProfile.<init>(SimpleProfile.java:118)
>        at org.biojava3.alignment.SimpleSequencePair.<init>(SimpleSequencePair.java:86)
>        at org.biojava3.alignment.SmithWaterman.setProfile(SmithWaterman.java:71)
>        at org.biojava3.alignment.template.AbstractMatrixAligner.align(AbstractMatrixAligner.java:342)
>        at org.biojava3.alignment.template.AbstractPairwiseSequenceAligner.getPair(AbstractPairwiseSequenceAligner.java:112)
>        at org.biojava3.alignment.Alignments.getPairwiseAlignment(Alignments.java:208)
>
> when calling Alignments.getPairwiseAlignment(dnaSequence, target,
> PairwiseSequenceAlignerType.LOCAL, new SimpleGapPenalty(), matrix);
>
> where matrix = new SimpleSubstitutionMatrix<NucleotideCompound>();,
> sequence and target are both DNASequence
>
> Possible causes I can think of: target might contain IUB-Codes (not
> just ACGTU, but also RYKM...)
>
> Hannes
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l




More information about the Biojava-l mailing list