X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmc_view%2FPDBChain.java;h=2970ccf05e136b2b3a04a9d5f2a19e62c7b8ae55;hb=958a0e91dec242191ec7543ab3f23b7e508e1112;hp=72d276effc349e5481f556ef21ae66fc5eeda635;hpb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;p=jalview.git diff --git a/src/mc_view/PDBChain.java b/src/mc_view/PDBChain.java index 72d276e..2970ccf 100755 --- a/src/mc_view/PDBChain.java +++ b/src/mc_view/PDBChain.java @@ -20,23 +20,26 @@ */ 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.ContactMatrixI; import jalview.datamodel.Mapping; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import jalview.datamodel.annotations.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; +import jalview.ws.datamodel.MappableContactMatrixI; public class PDBChain { @@ -79,17 +82,16 @@ public class PDBChain public String pdbid = ""; - String tfacName = "Temperature Factor"; + AnnotationRowBuilder tfacTemplate = new AnnotationRowBuilder( + "Temperature Factor"); 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; } } @@ -102,7 +104,9 @@ public class PDBChain */ public PDBChain(String thePdbid, String theId) { - this(thePdbid, theId, null); + this.pdbid = thePdbid == null ? thePdbid + : thePdbid.toLowerCase(Locale.ROOT); + this.id = theId; } /** @@ -516,14 +520,24 @@ public class PDBChain 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.setTFType(tfacTemplate.getTFType()); tfactorann.setCalcId(getClass().getName()); tfactorann.setSequenceRef(sequence); @@ -653,10 +667,16 @@ public class PDBChain ana.getCalcId(), ana.label, ana.description); if (transfer == null || transfer.size() == 0) { + ContactMatrixI cm = shadow.getContactMatrixFor(ana); ana = new AlignmentAnnotation(ana); + // TODO map contact matrix under mapping ana.liftOver(sequence, shadowMap); ana.liftOver(dsq, sqmpping); dsq.addAlignmentAnnotation(ana); + if (cm != null) + { + dsq.addContactListFor(ana, cm); + } } else { @@ -677,10 +697,15 @@ public class PDBChain ana.description); if (transfer == null || transfer.size() == 0) { + ContactMatrixI cm = sequence.getContactMatrixFor(ana); ana = new AlignmentAnnotation(ana); ana.liftOver(dsq, sqmpping); dsq.addAlignmentAnnotation(ana); - // mapping.transfer(ana); + if (cm != null && cm instanceof MappableContactMatrixI) + { + dsq.addContactListFor(ana, ((MappableContactMatrixI) cm) + .liftOver(dsq, sqmpping)); + } } else {