{
SequenceI newseq = translateCodingRegion(selection[s], seqstring[s],
viscontigs, codons, gapCharacter,
- (product != null) ? product[s] : null); // possibly anonymous
+ (product != null) ? product[s] : null, false); // possibly anonymous
// product
if (newseq != null)
{
* @param codons
* Definition of global ORF alignment reference frame
* @param gapCharacter
- * @param newSeq
* @return sequence ready to be added to alignment.
+ * @deprecated Use {@link #translateCodingRegion(SequenceI,String,int[],AlignedCodonFrame,char,DBRefEntry,boolean)} instead
*/
public static SequenceI translateCodingRegion(SequenceI selection,
String seqstring, int[] viscontigs, AlignedCodonFrame codons,
char gapCharacter, DBRefEntry product)
{
+ return translateCodingRegion(selection, seqstring, viscontigs, codons,
+ gapCharacter, product, false);
+ }
+
+ /**
+ * Translate a na sequence
+ *
+ * @param selection
+ * sequence displayed under viscontigs visible columns
+ * @param seqstring
+ * ORF read in some global alignment reference frame
+ * @param viscontigs
+ * mapping from global reference frame to visible seqstring ORF read
+ * @param codons
+ * Definition of global ORF alignment reference frame
+ * @param gapCharacter
+ * @param starForStop when true stop codons will translate as '*', otherwise as 'X'
+ * @return sequence ready to be added to alignment.
+ */
+ public static SequenceI translateCodingRegion(SequenceI selection,
+ String seqstring, int[] viscontigs, AlignedCodonFrame codons,
+ char gapCharacter, DBRefEntry product, final boolean starForStop)
+ {
java.util.List skip = new ArrayList();
int skipint[] = null;
ShiftList vismapping = new ShiftList(); // map from viscontigs to seqstring
}
if (aa.equals("STOP"))
{
- aa = "X";
+ aa = starForStop ? "*" : "X";
}
resSize++;
}