boolean preserveUnmappedGaps)
{
// TODO should this method signature be the one in the interface?
- int count = 0;
boolean thisIsNucleotide = this.isNucleotide();
boolean thatIsProtein = !al.isNucleotide();
if (!thatIsProtein && !thisIsNucleotide)
{
return AlignmentUtils.alignProteinAsDna(this, al);
}
-
- char thisGapChar = this.getGapCharacter();
- String gap = thisIsNucleotide && thatIsProtein ? String
- .valueOf(new char[] { thisGapChar, thisGapChar, thisGapChar })
- : String.valueOf(thisGapChar);
-
- // TODO handle intron regions? Needs a 'holistic' alignment of dna,
- // not just sequence by sequence. But how to 'gap' intron regions?
-
- /*
- * Get mappings from 'that' alignment's sequences to this.
- */
- for (SequenceI alignTo : getSequences())
- {
- count += AlignmentUtils.alignSequenceAs(alignTo, al, gap,
- preserveMappedGaps, preserveUnmappedGaps) ? 1 : 0;
- }
- return count;
+ return AlignmentUtils.alignAs(this, al);
}
/**