Re: IndexOutOfBounds Exception when performing Pairwise Alignment

Andreas Prlic <[email protected]>
Newsgroups gmane.comp.java.bio.general
Message-ID <CALthepw-f9ti0PDbn5xSE9AHNpGh6+pUoGibZjYTfT1aJ4y5kA@mail.gmail.com>
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
<[email protected]> 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  -  [email protected]
> http://lists.open-bio.org/mailman/listinfo/biojava-l

_______________________________________________
Biojava-l mailing list  -  [email protected]
http://lists.open-bio.org/mailman/listinfo/biojava-l
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.