public static final int LINE_GRAPH = 2;
- public static final int CUSTOMRENDERER = 4;
+ public static final int CONTACT_MAP = 4;
public boolean belowAlignment = true;
// viewmodel package
this.clear();
- if (ann_row.graph == AlignmentAnnotation.CUSTOMRENDERER && (filterParams
+ if (ann_row.graph == AlignmentAnnotation.CONTACT_MAP && (filterParams
.getThresholdType() == AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD
|| filterParams
.getThresholdType() == AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD))
AlignmentAnnotation aa = new AlignmentAnnotation(cm.getAnnotLabel(),
cm.getAnnotDescr(), new Annotation[0]);
- aa.graph = AlignmentAnnotation.CUSTOMRENDERER;
+ aa.graph = AlignmentAnnotation.CONTACT_MAP;
aa.graphMin = cm.getMin();
aa.graphMax = cm.getMax();
aa.editable = false;
+ aa.calcId=cm.getType();
contactmaps.put(aa.annotationId, cm);
// TODO: contact matrices could be intra or inter - more than one refseq
import java.util.ArrayList;
import java.util.List;
-public class ContactMatrix implements ContactMatrixI
+public abstract class ContactMatrix implements ContactMatrixI
{
/**
* are contacts reflexive ?
String getAnnotLabel();
+ /**
+ * string indicating how the contactMatrix should be rendered - stored in calcId
+ * @return
+ */
+ String getType();
+
}
*/
public class SeqDistanceContactMatrix implements ContactMatrixI
{
+ private static final String SEQUENCE_DISTANCE = "SEQUENCE_DISTANCE";
private int width = 0;
public SeqDistanceContactMatrix(int width)
{
return "Sequence Distance";
}
+
+ @Override
+ public String getType()
+ {
+ return SEQUENCE_DISTANCE;
+ }
}
if (graphStretch != -1)
{
- if (aa[graphStretch].graph == AlignmentAnnotation.CUSTOMRENDERER)
+ if (aa[graphStretch].graph == AlignmentAnnotation.CONTACT_MAP)
{
if (evt.isAltDown() || evt.isAltGraphDown())
{
* but could also be a matrix drag
*/
if ((evt.isAltDown() || evt.isAltGraphDown()) && (av.getAlignment()
- .getAlignmentAnnotation()[graphStretch].graph == AlignmentAnnotation.CUSTOMRENDERER))
+ .getAlignmentAnnotation()[graphStretch].graph == AlignmentAnnotation.CONTACT_MAP))
{
/*
* dragging in a matrix
tooltip = ann.annotations[column].description;
}
// TODO abstract tooltip generator so different implementations can be built
- if (ann.graph == AlignmentAnnotation.CUSTOMRENDERER)
+ if (ann.graph == AlignmentAnnotation.CONTACT_MAP)
{
ContactListI clist = av.getContactList(ann, column);
if (clist != null)
*/
public class PContactPredictionFile extends AlignFile
{
+ protected static final String CONTACT_PREDICTION = "CONTACT_PREDICTION";
+
public PContactPredictionFile(String inFile, DataSourceType fileSourceType)
throws IOException
{
if (cm == null)
{
- cm = new ContactMatrix(true);
+ cm = new ContactMatrix(true) {
+ @Override
+ public String getType()
+ {
+ return CONTACT_PREDICTION;
+ }
+ };
models.add(cm);
}
@Override
public AnnotationRowRendererI getRendererFor(AlignmentAnnotation row)
{
- if (row.graph == AlignmentAnnotation.CUSTOMRENDERER)
+ if (row.graph == AlignmentAnnotation.CONTACT_MAP)
{
return new ContactMapRenderer();
}
{
return "pAE Matrix";
}
+
+ public static final String PAEMATRIX="PAE_MATRIX";
+ @Override
+ public String getType()
+ {
+ return PAEMATRIX;
+ }
}
assertEquals("One sequence only", resp.getHeight(), 1);
for (AlignmentAnnotation aa : resp.getAlignmentAnnotation())
{
- if (aa.graph == AlignmentAnnotation.CUSTOMRENDERER)
+ if (aa.graph == AlignmentAnnotation.CONTACT_MAP)
{
assertTrue("Contact map didn't provide valid contact",
resp.getContactListFor(aa, 1).getContactAt(1) != -1d);