X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmc_view%2FPDBChain.java;h=425bc18a23df197c10ad443d35c8c947245697f9;hb=36f083dc674297be2157d9f291a7cddba9d3250a;hp=60c289e91ff89f6841d26e127032bc2613f9ed75;hpb=d46c8cbd1a5282ede9a0a94471f23ca002cf7df6;p=jalview.git diff --git a/src/mc_view/PDBChain.java b/src/mc_view/PDBChain.java index 60c289e..425bc18 100755 --- a/src/mc_view/PDBChain.java +++ b/src/mc_view/PDBChain.java @@ -78,11 +78,27 @@ public class PDBChain public String pdbid = ""; - public PDBChain(String thePdbid, String theId, boolean isAlphaFoldModel) + String tfacName = "Temperature Factor"; + + + public PDBChain(String thePdbid, String theId, String tempFactorColumnName) { this.pdbid = thePdbid == null ? thePdbid : thePdbid.toLowerCase(); this.id = theId; - this.alphaFoldModel = isAlphaFoldModel; + 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); } /** @@ -92,8 +108,6 @@ public class PDBChain public Mapping shadowMap; - private boolean alphaFoldModel; - public void setNewlineString(String nl) { newline = nl; @@ -215,10 +229,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) { @@ -251,7 +271,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) ? "" @@ -493,23 +513,17 @@ public class PDBChain min = Math.min(min, annots[i].value); resAnnotation.setElementAt(null, i); } - String tfacName = "Temperature Factor"; - if (isAlphaFoldModel()) - { - tfacName = "Alphafold Reliability"; - } AlignmentAnnotation tfactorann = new AlignmentAnnotation( tfacName, tfacName + " for " + pdbid + id, annots, min, max, AlignmentAnnotation.LINE_GRAPH); + + tfactorann.setCalcId(getClass().getName()); + tfactorann.setSequenceRef(sequence); sequence.addAlignmentAnnotation(tfactorann); } } - private boolean isAlphaFoldModel() - { - return alphaFoldModel; - } /** * Colour start/end of bonds by charge @@ -627,8 +641,10 @@ public class PDBChain for (AlignmentAnnotation ana : shadow.getAnnotation()) { - List transfer = sq - .getAlignmentAnnotations(ana.getCalcId(), ana.label); + // match on calcId, label and description so annotations from + // different structures are preserved + List transfer = sq.getAlignmentAnnotations( + ana.getCalcId(), ana.label, ana.description); if (transfer == null || transfer.size() == 0) { ana = new AlignmentAnnotation(ana); @@ -648,8 +664,11 @@ public class PDBChain { for (AlignmentAnnotation ana : sequence.getAnnotation()) { + // match on calcId, label and description so annotations from + // different structures are preserved List transfer = dsq - .getAlignmentAnnotations(ana.getCalcId(), ana.label); + .getAlignmentAnnotations(ana.getCalcId(), ana.label, + ana.description); if (transfer == null || transfer.size() == 0) { ana = new AlignmentAnnotation(ana);