[Biojava-dev] Alignments.getPairwiseAlignment seems a bit choosy

Hannes Brandstätter-Müller biojava at hannes.oib.com
Wed Feb 22 14:38:13 UTC 2012


On Tue, Feb 21, 2012 at 19:58, Andreas Prlic <andreas at sdsc.edu> wrote:
> Hi Hannes,
>
>> I recently ran into a bit of an annoyance when using
>> Alignments.getPairwiseAlignment with DNASequences
>>
>> If the DNASequences do not have the same CompoundSet, the alignment
>> fails (but silently, which is the annoying part) - you just get 0 as
>> Similars or Identicals.
>
> what gap penalties are you using?

      SubstitutionMatrix<NucleotideCompound> matrix =
SubstitutionMatrixHelper.getNuc4_4();
      SimpleGapPenalty gapP = new SimpleGapPenalty();
      gapP.setOpenPenalty((short) 5);
      gapP.setExtensionPenalty((short) 2);
      SequencePair<DNASequence, NucleotideCompound> psa =
              Alignments.getPairwiseAlignment(query, target,
              PairwiseSequenceAlignerType.LOCAL, gapP, matrix);

>
> I don't have had enough time to look at the
>> code in detail, but there should be something done here, at least
>> check and throw an exception or something if it can't be made to work
>> regardless.
>
> Can you provide an example to reproduce this?

use the above code, make:

query = new DNASequence("ATCGTAGCTAGTCGTGC",
AmbiguityDNACompoundSet.getDNACompoundSet()));
target = new DNASequence("ATCGTAGCTAGTCGTGT",
DNACompoundSet.getDNACompoundSet()));

This should (with 3.0.2) fail silently. I.e. psa.getSimilars() == 0


Hannes

ps: sorry for the triplepost, Andreas, I'm still not used to the
mailinglist not defaulting to "reply-to-list" and managed to get the
sender wrong in the second try.



More information about the biojava-dev mailing list