X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FDna.java;fp=src%2Fjalview%2Fanalysis%2FDna.java;h=9611a4cf99beaf07463b674fbd7f15e6efd3b8a6;hb=74393b51f368cb9f58589472d432a433d9c4386d;hp=2ad8487bcdec37ef0e84d4e83d68f1e573663155;hpb=7a0d503181fe41452120a8a02ca63476392aa08c;p=jalview.git diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java index 2ad8487..9611a4c 100644 --- a/src/jalview/analysis/Dna.java +++ b/src/jalview/analysis/Dna.java @@ -194,10 +194,11 @@ public class Dna } /** + * Translates cDNA using the specified code table * * @return */ - public AlignmentI translateCdna() + public AlignmentI translateCdna(GeneticCodeI codeTable) { AlignedCodonFrame acf = new AlignedCodonFrame(); @@ -209,7 +210,7 @@ public class Dna for (s = 0; s < sSize; s++) { SequenceI newseq = translateCodingRegion(selection.get(s), - seqstring[s], acf, pepseqs); + seqstring[s], acf, pepseqs, codeTable); if (newseq != null) { @@ -429,11 +430,12 @@ public class Dna * @param acf * Definition of global ORF alignment reference frame * @param proteinSeqs + * @param codeTable * @return sequence ready to be added to alignment. */ protected SequenceI translateCodingRegion(SequenceI selection, String seqstring, AlignedCodonFrame acf, - List proteinSeqs) + List proteinSeqs, GeneticCodeI codeTable) { List skip = new ArrayList<>(); int[] skipint = null; @@ -466,9 +468,8 @@ public class Dna /* * Filled up a reading frame... */ - AlignedCodon alignedCodon = new AlignedCodon(cdp[0], cdp[1], - cdp[2]); - String aa = ResidueProperties.codonTranslate(new String(codon)); + AlignedCodon alignedCodon = new AlignedCodon(cdp[0], cdp[1], cdp[2]); + String aa = codeTable.translate(new String(codon)); rf = 0; final String gapString = String.valueOf(gapChar); if (aa == null)