public String id;
- public Vector<Bond> bonds = new Vector<Bond>();
+ public Vector<Bond> bonds = new Vector<>();
- public Vector<Atom> atoms = new Vector<Atom>();
+ public Vector<Atom> atoms = new Vector<>();
- public Vector<Residue> residues = new Vector<Residue>();
+ public Vector<Residue> residues = new Vector<>();
public int offset;
boolean deoxyn = false;
boolean nucleotide = false;
StringBuilder seq = new StringBuilder(256);
- Vector<SequenceFeature> resFeatures = new Vector<SequenceFeature>();
- Vector<Annotation> resAnnotation = new Vector<Annotation>();
- int i, iSize = atoms.size() - 1;
+ Vector<SequenceFeature> resFeatures = new Vector<>();
+ Vector<Annotation> resAnnotation = new Vector<>();
+ int iSize = atoms.size() - 1;
int resNumber = -1;
char insCode = ' ';
- for (i = 0; i <= iSize; i++)
+
+ for (int i = 0; i <= iSize; i++)
{
Atom tmp = atoms.elementAt(i);
resNumber = tmp.resNumber;
offset = resNumber;
}
- Vector<Atom> resAtoms = new Vector<Atom>();
+ Vector<Atom> resAtoms = new Vector<>();
// Add atoms to a vector while the residue number
// remains the same as the first atom's resNumber (res)
while ((resNumber == res) && (ins == insCode) && (i < atoms.size()))
if (StructureImportSettings.isShowSeqFeatures())
{
- for (i = 0, iSize = resFeatures.size(); i < iSize; i++)
+ iSize = resFeatures.size();
+ for (int i = 0; i < iSize; i++)
{
sequence.addSequenceFeature(resFeatures.elementAt(i));
resFeatures.setElementAt(null, i);
if (visibleChainAnnotation)
{
Annotation[] annots = new Annotation[resAnnotation.size()];
- float max = 0;
- for (i = 0, iSize = annots.length; i < iSize; i++)
+ float max = 0f;
+ float min = 0f;
+ iSize = annots.length;
+ for (int i = 0; i < iSize; i++)
{
annots[i] = resAnnotation.elementAt(i);
- if (annots[i].value > max)
- {
- max = annots[i].value;
- }
+ max = Math.max(max, annots[i].value);
+ min = Math.min(min, annots[i].value);
resAnnotation.setElementAt(null, i);
}
AlignmentAnnotation tfactorann = new AlignmentAnnotation(
"Temperature Factor", "Temperature Factor for " + pdbid + id,
- annots, 0, max, AlignmentAnnotation.LINE_GRAPH);
+ annots, min, max, AlignmentAnnotation.LINE_GRAPH);
tfactorann.setSequenceRef(sequence);
sequence.addAlignmentAnnotation(tfactorann);
}
a3.resName = "ASP";
a3.resNumber = 41;
- Vector<Bond> v = new Vector<Bond>();
+ Vector<Bond> v = new Vector<>();
v.add(new Bond(a1, a2));
v.add(new Bond(a2, a3));
v.add(new Bond(a3, a1));
@Test(groups = { "Functional" })
public void testMakeResidueList_noAnnotation()
{
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
c.isNa = true;
atoms.add(makeAtom(4, "N", "MET"));
@Test(groups = { "Functional" })
public void testMakeResidueList_withTempFactor()
{
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
atoms.add(makeAtom(4, "N", "MET"));
atoms.get(atoms.size() - 1).tfactor = 1f;
atoms.add(makeAtom(5, "CA", "LYS"));
atoms.get(atoms.size() - 1).tfactor = 9f;
atoms.add(makeAtom(6, "O", "LEU"));
- atoms.get(atoms.size() - 1).tfactor = 4f;
+ atoms.get(atoms.size() - 1).tfactor = -4f;
atoms.add(makeAtom(6, "N", "LEU"));
atoms.get(atoms.size() - 1).tfactor = 5f;
atoms.add(makeAtom(6, "CA", "LEU"));
/*
* Verify annotations; note the tempFactor is read from the first atom in
- * each residue i.e. we expect values 1, 7, 4 for the residues
+ * each residue i.e. we expect values 1, 7, -4 for the residues
*/
AlignmentAnnotation[] ann = c.sequence.getAnnotation();
assertEquals(1, ann.length);
assertEquals("Temperature Factor for 1gaqA", ann[0].description);
assertSame(c.sequence, ann[0].sequenceRef);
assertEquals(AlignmentAnnotation.LINE_GRAPH, ann[0].graph);
- assertEquals(0f, ann[0].graphMin, 0.001f);
+ assertEquals(-4f, ann[0].graphMin, 0.001f);
assertEquals(7f, ann[0].graphMax, 0.001f);
assertEquals(3, ann[0].annotations.length);
assertEquals(1f, ann[0].annotations[0].value, 0.001f);
assertEquals(7f, ann[0].annotations[1].value, 0.001f);
- assertEquals(4f, ann[0].annotations[2].value, 0.001f);
+ assertEquals(-4f, ann[0].annotations[2].value, 0.001f);
}
/**
public void testMakeCaBondList()
{
c.isNa = true;
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
atoms.add(makeAtom(4, "N", "MET"));
atoms.add(makeAtom(4, "CA", "MET"));
public void testMakeCaBondList_nucleotide()
{
c.isNa = false;
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
atoms.add(makeAtom(4, "N", "G"));
atoms.add(makeAtom(4, "P", "G"));
@Test(groups = { "Functional" })
public void testMakeExactMapping()
{
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
atoms.add(makeAtom(4, "N", "MET"));
atoms.add(makeAtom(4, "CA", "MET"));