X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignedCodonFrame.java;h=6048808c02d2ed6bf08c571b7aa086c594afa92e;hb=93de2a3b535decd5f5d7b24e5618806f4e99c46e;hp=f65f068d55d0ff18843e34702560ef3910392f86;hpb=759d83a940b86333a264437462a2b0c8bc662d97;p=jalview.git diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index f65f068..6048808 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -33,14 +33,19 @@ public class AlignedCodonFrame { /** - * array of nucleotide positions for aligned codons at column of aligned - * proteins. + *
+   * Aligned nucleotide positions for codons mapped to column positions of of aligned
+   * proteins. e.g.
+   * codons[3] = [12, 14, 15] means:
+   *     column 4 in the protein alignment translates cols 13, 15, 16 in cDNA
+   * codons[5] = null means column 6 in the protein alignment is a gap
+   * 
*/ public int[][] codons = null; /** - * width of protein sequence alignement implicit assertion that codons.length - * >= aaWidth + * Width of protein sequence alignment (implicit assertion that codons.length + * >= aaWidth) */ public int aaWidth = 0; @@ -100,6 +105,11 @@ public class AlignedCodonFrame for (SequenceI seq : acf.a_aaSeqs) { boolean found = false; + // TODO may not correctly handle the case where the same sequence appears + // twice in the source alignment i.e. same dataset sequence + // the copy will reference the first aligned sequence for both + // ?not solvable if realignment may reorder the sequences + // or check on sequence name as well???? for (SequenceI newseq : alignment) { if (seq.getDatasetSequence() == newseq.getDatasetSequence()) @@ -125,6 +135,8 @@ public class AlignedCodonFrame */ public int[][] checkCodonFrameWidth(int aslen) { + // TODO why not codons.length < aslen ? + // should codons expand if length is 2 or 3 and aslen==2 ? if (codons.length <= aslen + 1) { // probably never have to do this ? @@ -165,7 +177,6 @@ public class AlignedCodonFrame seq.insertCharAt(aspos, gapCharacter); } - checkCodonFrameWidth(aspos); if (aspos < aaWidth) { aaWidth++;