import jalview.datamodel.AlignmentOrder;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.ContactMatrixI;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SeqCigar;
}
public void showContactMapTree(AlignmentAnnotation aa,
- PAEContactMatrix cm)
+ ContactMatrixI cm)
{
int x = 4, y = 5;
int w = 400, h = 500;
{
NewickFile fin = new NewickFile(
new FileParse(cm.getNewick(), DataSourceType.PASTE));
- String title = "PAE Matrix Tree for "
- + cm.getReferenceSeq().getDisplayId(false);
+ String title = cm.getAnnotLabel() + " " + cm.getTreeMethod() + " tree"
+ + aa.sequenceRef != null
+ ? (" for " + aa.sequenceRef.getDisplayId(false))
+ : "";
showColumnWiseTree(fin, aa, title, w, h, x, y);
} catch (Throwable xx)
import java.util.Collections;
import java.util.Iterator;
import java.util.Locale;
+import java.util.concurrent.Callable;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenuItem;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.datamodel.ContactMatrixI;
+import jalview.datamodel.GroupSet;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
consclipbrd.addActionListener(this);
pop.add(consclipbrd);
}
- if (aa[selectedRow].graph == AlignmentAnnotation.CONTACT_MAP
- && PAEContactMatrix.PAEMATRIX
- .equals(aa[selectedRow].getCalcId()))
+ if (aa[selectedRow].graph == AlignmentAnnotation.CONTACT_MAP)
{
- final PAEContactMatrix cm = (PAEContactMatrix) av
- .getContactMatrix(aa[selectedRow]);
- if (cm != null && cm.hasTree())
+
+ final ContactMatrixI cm = av.getContactMatrix(aa[selectedRow]);
+ if (cm != null)
{
- item = new JMenuItem("Show Tree for Matrix");
- item.addActionListener(new ActionListener()
- {
+ pop.addSeparator();
- @Override
- public void actionPerformed(ActionEvent e)
+ if (cm.hasTree())
+ {
+ item = new JMenuItem("Show Tree for Matrix");
+ item.addActionListener(new ActionListener()
{
- ap.alignFrame.showContactMapTree(aa[selectedRow], cm);
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
- }
- });
- pop.addSeparator();
- pop.add(item);
- }
+ ap.alignFrame.showContactMapTree(aa[selectedRow], cm);
+ }
+ });
+ pop.add(item);
+ }
+ else
+ {
+ item = new JMenuItem("Calculate Tree for Matrix");
+ item.addActionListener(new ActionListener()
+ {
+ // TODO - refactor to analysis background thread
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ new Thread(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ AlignmentAnnotation alan = aa[selectedRow];
+ cm.setGroupSet(GroupSet.makeGroups(cm, 5f, true));
+ ap.alignFrame.showContactMapTree(alan, cm);
+ }
+ }).start();
+ }
+ });
+ pop.add(item);
+
+ }
+ // Show/Hide group shading on matrix view
+ // Set/adjust threshold for grouping ?
+ // colour alignment by this [type]
+ // select/hide columns by this row
+
+ }
}
}
pop.show(this, evt.getX(), evt.getY());
package jalview.ws.datamodel.alphafold;
-import java.awt.Color;
-import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.BitSet;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import org.json.simple.JSONObject;
-import jalview.analysis.AverageDistanceEngine;
-import jalview.bin.Console;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.BinaryNode;
import jalview.datamodel.ContactListI;
import jalview.datamodel.ContactListImpl;
import jalview.datamodel.ContactListProviderI;
import jalview.datamodel.ContactMatrixI;
import jalview.datamodel.GroupSet;
-import jalview.datamodel.GroupSetI;
-import jalview.datamodel.Mapping;
import jalview.datamodel.SequenceDummy;
import jalview.datamodel.SequenceI;
-import jalview.io.DataSourceType;
import jalview.io.FileFormatException;
-import jalview.io.FileParse;
import jalview.util.MapList;
import jalview.util.MapUtils;
import jalview.ws.dbsources.EBIAlfaFold;
@Override
public int getWidth()
{
- return length;
+ return maxcol;
}
@Override
public int getHeight()
{
- return length;
+ return maxrow;
}
public static void validateContactMatrixFile(String fileName)
throws FileFormatException, IOException
}
ContactMatrixI matrix = new PAEContactMatrix(sequence,
(Map<String, Object>) paeDict);
- matrix.setGroupSet(GroupSet.makeGroups(matrix, 5f, true));
AlignmentAnnotation cmannot = sequence.addContactList(matrix);
if (label != null)
SequenceI seq = sm.getSequence();
ContactMatrixI matrix = new PAEContactMatrix(seq,
(Map<String, Object>) pae_obj);
- matrix.setGroupSet(GroupSet.makeGroups(matrix, 5f, true));
AlignmentAnnotation cmannot = sm.getSequence().addContactList(matrix);
/* this already happens in Sequence.addContactList()
seq.addAlignmentAnnotation(cmannot);