*/
package jalview.analysis;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Vector;
-
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.util.MapList;
import jalview.util.ShiftList;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Vector;
+
public class Dna
{
/**
{
if (cdp2 == null
|| (cdp1[0] == cdp2[0] && cdp1[1] == cdp2[1] && cdp1[2] == cdp2[2]))
+ {
return 0;
+ }
if (cdp1[0] < cdp2[0] || cdp1[1] < cdp2[1] || cdp1[2] < cdp2[2])
+ {
return -1; // one base in cdp1 precedes the corresponding base in the
+ }
// other codon
return 1; // one base in cdp1 appears after the corresponding base in the
// other codon.
}
}
if (codons.aaWidth == 0)
+ {
return null;
+ }
SequenceI[] newseqs = new SequenceI[pepseqs.size()];
pepseqs.copyInto(newseqs);
AlignmentI al = new Alignment(newseqs);
// generate seqstring for this sequence based on mapping
if (sqstr.length() > alwidth)
+ {
alwidth = sqstr.length();
+ }
cdnasqs.addElement(sqstr.toString());
cdnasqi.addElement(dna);
cdnaprod.addElement(intersect);
}
if (contrib > 1)
{
- annot.value /= (float) contrib;
+ annot.value /= contrib;
}
return annot;
}
* {@link #translateCodingRegion(SequenceI,String,int[],AlignedCodonFrame,char,DBRefEntry,boolean)}
* instead
*/
+ @Deprecated
public static SequenceI translateCodingRegion(SequenceI selection,
String seqstring, int[] viscontigs, AlignedCodonFrame codons,
char gapCharacter, DBRefEntry product)
scontigs = t;
}
if (vc <= 0)
+ {
scontigs = null;
+ }
}
if (scontigs != null)
{
scontigs[vc] = selection.findPosition(scontigs[vc]); // not from 1!
scontigs[vc + 1] = selection.findPosition(scontigs[vc + 1]); // exclusive
if (scontigs[vc + 1] == selection.getEnd())
+ {
break;
+ }
}
// trim trailing empty intervals.
if ((vc + 2) < scontigs.length)
private static void transferCodedFeatures(SequenceI dna, SequenceI pep,
MapList map, Hashtable featureTypes, Hashtable featureGroups)
{
- SequenceFeature[] sf = (dna.getDatasetSequence() != null ? dna
- .getDatasetSequence() : dna).getSequenceFeatures();
+ SequenceFeature[] sf = dna.getSequenceFeatures();
Boolean fgstate;
jalview.datamodel.DBRefEntry[] dnarefs = jalview.util.DBRefUtils
.selectRefs(dna.getDBRef(),