X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceGroup.java;h=326793d054437d76271172dfd8a7646603cd1cb7;hb=d4271d32477e99e9fbbfa5db3e11f1b79324e60d;hp=5e33229f6c87dc19bd2ab5db8fd8b08bed84d587;hpb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;p=jalview.git diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 5e33229..326793d 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -20,20 +20,21 @@ */ package jalview.datamodel; -import jalview.analysis.AAFrequency; -import jalview.analysis.Conservation; -import jalview.renderer.ResidueShader; -import jalview.renderer.ResidueShaderI; -import jalview.schemes.ColourSchemeI; - import java.awt.Color; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.List; import java.util.Map; +import jalview.analysis.AAFrequency; +import jalview.analysis.Conservation; +import jalview.renderer.ResidueShader; +import jalview.renderer.ResidueShaderI; +import jalview.schemes.ColourSchemeI; + /** * Collects a set contiguous ranges on a set of sequences * @@ -273,14 +274,6 @@ public class SequenceGroup implements AnnotatedCollectionI endRes + 1); if (seqipos != null) { - seqipos.setDescription(seq.getDescription()); - seqipos.setDBRefs(seq.getDBRefs()); - seqipos.setSequenceFeatures(seq.getSequenceFeatures()); - if (seq.getDatasetSequence() != null) - { - seqipos.setDatasetSequence(seq.getDatasetSequence()); - } - if (seq.getAnnotation() != null) { AlignmentAnnotation[] alann = align.getAlignmentAnnotation(); @@ -310,6 +303,11 @@ public class SequenceGroup implements AnnotatedCollectionI newannot.restrict(startRes, endRes); newannot.setSequenceRef(seqs[ipos]); newannot.adjustForAlignment(); + ContactMatrixI cm = seq.getContactMatrixFor(seq.getAnnotation()[a]); + if (cm!=null) + { + seqs[ipos].addContactListFor(newannot, cm); + } seqipos.addAlignmentAnnotation(newannot); } } @@ -1485,4 +1483,51 @@ public class SequenceGroup implements AnnotatedCollectionI { return (startRes <= apos && endRes >= apos) && sequences.contains(seq); } + + //// + //// Contact Matrix Holder Boilerplate + //// + ContactMapHolder cmholder = new ContactMapHolder(); + + @Override + public Collection getContactMaps() + { + return cmholder.getContactMaps(); + } + + @Override + public ContactMatrixI getContactMatrixFor(AlignmentAnnotation ann) + { + return cmholder.getContactMatrixFor(ann); + } + + @Override + public ContactListI getContactListFor(AlignmentAnnotation _aa, int column) + { + return cmholder.getContactListFor(_aa, column); + } + + @Override + public AlignmentAnnotation addContactList(ContactMatrixI cm) + { + AlignmentAnnotation aa = cmholder.addContactList(cm); + + Annotation _aa[] = new Annotation[getWidth()]; + Annotation dummy = new Annotation(0.0f); + for (int i = 0; i < _aa.length; _aa[i++] = dummy) + { + ; + } + aa.annotations = _aa; + // TODO passing annotations back to context to be added + return aa; + } + + @Override + public void addContactListFor(AlignmentAnnotation annotation, + ContactMatrixI cm) + { + cmholder.addContactListFor(annotation, cm); + } + }