X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMCview%2FPDBChain.java;h=30712f2228f98d9dcf1e610d5dfa232b03e5f44b;hb=a96d51f58325f8429c5792ae554243de5628d62a;hp=aa404cce0dda8fc829ecb6fb704447f72e0e5879;hpb=86132ff6e4262123e5c89be4e33500d53265f557;p=jalview.git diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index aa404cc..30712f2 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -25,6 +25,7 @@ import java.awt.*; import jalview.analysis.*; import jalview.datamodel.*; import jalview.schemes.*; +import jalview.structure.StructureMapping; public class PDBChain { @@ -94,7 +95,6 @@ public class PDBChain } } } - /** * copy over the RESNUM seqfeatures from the internal chain sequence to the mapped sequence * @param seq @@ -126,7 +126,7 @@ public class PDBChain SequenceFeature[] features = sequence.getSequenceFeatures(); for (int i = 0; i < features.length; i++) { - if (features[i].getFeatureGroup().equals(PDBChain.PDBFILEFEATURE)) + if (features[i].getFeatureGroup().equals(pdbid)) { SequenceFeature tx = new SequenceFeature(features[i]); tx.setBegin(1 + @@ -235,9 +235,11 @@ public class PDBChain tmpat.resName + ":" + tmpat.resNumIns + " " + pdbid + id, "", offset + count, offset + count, - MCview.PDBChain.PDBFILEFEATURE); + pdbid); + + //MCview.PDBChain.PDBFILEFEATURE); resFeatures.addElement(sf); - resAnnotation.addElement(new Annotation("","",'\0',tmpat.tfactor)); + resAnnotation.addElement(new Annotation(tmpat.tfactor)); // Keep totting up the sequence if (ResidueProperties.getAA3Hash().get(tmpat.resName) == null) { @@ -277,7 +279,7 @@ public class PDBChain max = annots[i].value; resAnnotation.setElementAt(null, i); } - AlignmentAnnotation tfactorann = new AlignmentAnnotation("PDB.CATempFactor","CA Temperature Factor for "+sequence.getName(), + AlignmentAnnotation tfactorann = new AlignmentAnnotation("PDB.CATempFactor","CA Temperature Factor for "+sequence.getName(), annots, 0, max, AlignmentAnnotation.LINE_GRAPH); tfactorann.setSequenceRef(sequence); sequence.addAlignmentAnnotation(tfactorann); @@ -375,4 +377,51 @@ public class PDBChain tmp.endCol = col; } } + + public AlignmentAnnotation[] transferResidueAnnotation(SequenceI seq, String status) + { + AlignmentAnnotation[] transferred = null; + + return transferred; + + } + + /** + * copy any sequence annotation onto the sequence mapped using the provided StructureMapping + * @param mapping + */ + public void transferResidueAnnotation(StructureMapping mapping) + { + SequenceI sq = mapping.getSequence(); + if (sq!=null) + { + if (sequence!=null && sequence.getAnnotation()!=null) + { + + } + 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++) + { + int prn = mapping.getPDBResNum(k+1); + + an[k] = new Annotation((float)prn); + if (min==-1) + { + min=k; + max=k; + } else { + if (min>k) + { + min=k; + } else + if (max