X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fmc_view%2FPDBChain.java;h=97514e9d4dd6a36f6dc7f4177d2432ca20c654c2;hb=e42524a147f92c836a0a336dde394394976216d2;hp=a3c8bee12febbe2395f5f84323f0c563d4be38e5;hpb=1b98f7d9d004823a57b9e1c4e476123c2ea4a898;p=jalview.git diff --git a/src/mc_view/PDBChain.java b/src/mc_view/PDBChain.java index a3c8bee..97514e9 100755 --- a/src/mc_view/PDBChain.java +++ b/src/mc_view/PDBChain.java @@ -35,6 +35,7 @@ import jalview.util.Comparison; import java.awt.Color; import java.util.List; +import java.util.Locale; import java.util.Vector; public class PDBChain @@ -78,10 +79,27 @@ public class PDBChain public String pdbid = ""; - public PDBChain(String thePdbid, String theId) + String tfacName = "Temperature Factor"; + + + public PDBChain(String thePdbid, String theId, String tempFactorColumnName) { - this.pdbid = thePdbid == null ? thePdbid : thePdbid.toLowerCase(); + this.pdbid = thePdbid == null ? thePdbid : thePdbid.toLowerCase(Locale.ROOT); this.id = theId; + if (tempFactorColumnName!=null && tempFactorColumnName.length()>0) + { + tfacName = tempFactorColumnName; + } + } + + /** + * import chain data assuming Temperature Factor is in the Temperature Factor column + * @param thePdbid + * @param theId + */ + public PDBChain(String thePdbid, String theId) + { + this(thePdbid,theId, null); } /** @@ -212,10 +230,16 @@ public class PDBChain * @param seq * @param status * The Status of the transferred annotation + * + * @param altPDBID the group id for the features on the destination sequence (e.g. the official accession ID) */ public void transferRESNUMFeatures(SequenceI seq, - String status) + String status, String altPDBID) { + if (altPDBID==null) + { + altPDBID = pdbid; + } SequenceI sq = seq; while (sq != null && sq.getDatasetSequence() != null) { @@ -248,7 +272,7 @@ public class PDBChain int newEnd = 1 + residues.elementAt(feature.getEnd() - offset).atoms .elementAt(0).alignmentMapping; SequenceFeature tx = new SequenceFeature(feature, newBegin, newEnd, - feature.getFeatureGroup(), feature.getScore()); + altPDBID, feature.getScore()); tx.setStatus(status + ((tx.getStatus() == null || tx.getStatus().length() == 0) ? "" @@ -490,15 +514,18 @@ public class PDBChain min = Math.min(min, annots[i].value); resAnnotation.setElementAt(null, i); } - AlignmentAnnotation tfactorann = new AlignmentAnnotation( - "Temperature Factor", "Temperature Factor for " + pdbid + id, + tfacName, tfacName + " for " + pdbid + id, annots, min, max, AlignmentAnnotation.LINE_GRAPH); + + tfactorann.setCalcId(getClass().getName()); + tfactorann.setSequenceRef(sequence); sequence.addAlignmentAnnotation(tfactorann); } } + /** * Colour start/end of bonds by charge *