*/
package mc_view;
+import java.awt.Color;
+import java.util.List;
+import java.util.Locale;
+import java.util.Vector;
+
import jalview.analysis.AlignSeq;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.datamodel.annotations.AnnotationRowBuilder.AnnotationRowBuilder;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ResidueProperties;
import jalview.structure.StructureImportSettings;
import jalview.structure.StructureMapping;
import jalview.util.Comparison;
-import java.awt.Color;
-import java.util.List;
-import java.util.Locale;
-import java.util.Vector;
-
public class PDBChain
{
public static final String RESNUM_FEATURE = "RESNUM";
public String pdbid = "";
- String tfacName = "Temperature Factor";
+ AnnotationRowBuilder tfacTemplate = new AnnotationRowBuilder(
+ "TemperatureFactor");
public PDBChain(String thePdbid, String theId,
- String tempFactorColumnName)
+ AnnotationRowBuilder template)
{
- this.pdbid = thePdbid == null ? thePdbid
- : thePdbid.toLowerCase(Locale.ROOT);
- this.id = theId;
- if (tempFactorColumnName != null && tempFactorColumnName.length() > 0)
+ this(thePdbid, theId);
+ if (template != null)
{
- tfacName = tempFactorColumnName;
+ tfacTemplate = template;
}
}
*/
public PDBChain(String thePdbid, String theId)
{
- this(thePdbid, theId, null);
+ this.pdbid = thePdbid == null ? thePdbid
+ : thePdbid.toLowerCase(Locale.ROOT);
+ this.id = theId;
}
/**
for (int i = 0; i < iSize; i++)
{
annots[i] = resAnnotation.elementAt(i);
+ tfacTemplate.processAnnotation(annots[i]);
max = Math.max(max, annots[i].value);
min = Math.min(min, annots[i].value);
resAnnotation.setElementAt(null, i);
}
- AlignmentAnnotation tfactorann = new AlignmentAnnotation(tfacName,
- tfacName + " for " + pdbid + id, annots, min, max,
- AlignmentAnnotation.LINE_GRAPH);
+ if (tfacTemplate.isHasMinMax())
+ {
+ max = tfacTemplate.getMax();
+ min = tfacTemplate.getMin();
+ }
+ AlignmentAnnotation tfactorann = new AlignmentAnnotation(
+ tfacTemplate.getName(),
+ (tfacTemplate.isHasDescription()
+ ? tfacTemplate.getDescription()
+ : tfacTemplate.getName()) + " for " + pdbid + id,
+ annots, min, max, AlignmentAnnotation.LINE_GRAPH);
tfactorann.setCalcId(getClass().getName());
tfactorann.setSequenceRef(sequence);
// Useful for debugging mappings - adds annotation for mapped position
float min = -1, max = 0;
Annotation[] an = new Annotation[sq.getEnd() - sq.getStart() + 1];
- for (int i = sq.getStart(), j = sq
- .getEnd(), k = 0; i <= j; i++, k++)
+ for (int i = sq.getStart(), j = sq.getEnd(),
+ k = 0; i <= j; i++, k++)
{
int prn = mapping.getPDBResNum(k + 1);