import jalview.analysis.*;
import jalview.datamodel.*;
import jalview.schemes.*;
+import jalview.structure.StructureMapping;
public class PDBChain
{
}
}
}
-
/**
* copy over the RESNUM seqfeatures from the internal chain sequence to the mapped sequence
* @param seq
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 +
int count = 0;
StringBuffer seq = new StringBuffer();
Vector resFeatures = new Vector();
+ Vector resAnnotation = new Vector();
int i, iSize = atoms.size() - 1;
int resNumber = -1;
for (i = 0; i <= iSize; i++)
tmpat.resName + ":" + tmpat.resNumIns + " " +
pdbid + id,
"", offset + count, offset + count,
- MCview.PDBChain.PDBFILEFEATURE);
+ pdbid);
+
+ //MCview.PDBChain.PDBFILEFEATURE);
resFeatures.addElement(sf);
+ resAnnotation.addElement(new Annotation(tmpat.tfactor));
// Keep totting up the sequence
if (ResidueProperties.getAA3Hash().get(tmpat.resName) == null)
{
sequence.addSequenceFeature( (SequenceFeature) resFeatures.elementAt(i));
resFeatures.setElementAt(null, i);
}
+ Annotation[] annots = new Annotation[resAnnotation.size()];
+ float max=0;
+ for (i=0,iSize=annots.length; i<iSize; i++)
+ {
+ annots[i] = (Annotation) resAnnotation.elementAt(i);
+ if (annots[i].value>max)
+ max = annots[i].value;
+ resAnnotation.setElementAt(null, i);
+ }
+ AlignmentAnnotation tfactorann = new AlignmentAnnotation("PDB.CATempFactor","CA Temperature Factor for "+sequence.getName(),
+ annots, 0, max, AlignmentAnnotation.LINE_GRAPH);
+ tfactorann.setSequenceRef(sequence);
+ sequence.addAlignmentAnnotation(tfactorann);
}
public void setChargeColours()
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<k)
+ {
+ max=k;
+ }
+ }
+ }
+ sq.addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM", "PDB Residue Numbering for "+this.pdbid+":"+this.id, an, (float)min,(float)max, AlignmentAnnotation.LINE_GRAPH));
+ }
+ }
}