label.principal_component_analysis = Principal Component Analysis
label.average_distance_identity = Average Distance Using % Identity
label.neighbour_joining_identity = Neighbour Joining Using % Identity
-label.choose_tree = Choose Tree Calculation
+label.choose_calculation = Choose Calculation
label.treecalc_title = {0} Using {1}
label.tree_calc_av = Average Distance
label.tree_calc_nj = Neighbour Joining
action.scale_right = Escala derecha
action.by_tree_order = Por orden del árbol
action.sort = Ordenar
-action.calculate_tree = Calcular árbol
+action.calculate_tree = Calcular árbol...
+action.calculate_tree_pca = Calcular árbol o ACP...
action.help = Ayuda
action.by_annotation = Por anotación...
action.invert_sequence_selection = Invertir selección de secuencias
label.principal_component_analysis = Análisis del Componente Principal
label.average_distance_identity = Distancia Media Usando % de Identidad
label.neighbour_joining_identity = Unir vecinos utilizando % de Identidad
-label.choose_tree = Elegir el cálculo del árbol
+label.choose_calculation = Elegir el cálculo
label.treecalc_title = {0} utilizando {1}
label.tree_calc_av = Distancia media
label.tree_calc_nj = Unir vecinos
label.selection_output_command = Seleccionar salida - {0}
label.annotation_for_displayid = <p><h2>Anotación para {0} </h2></p><p>
label.pdb_sequence_mapping = PDB - Mapeado de secuencia
-label.pca_details = detalles de la PCA
+label.pca_details = detalles de la ACP
label.redundancy_threshold_selection = Selección del umbral de redundancia
label.user_defined_colours = Colores definidos del usuario
label.jalviewLite_release = JalviewLite - versión {0}
label.no_features_added_to_this_alignment = No hay funciones asociadas a este alineamiento!!
label.features_can_be_added_from_searches_1 = (Las funciones pueden ser añadidas de búsquedas o
label.features_can_be_added_from_searches_2 = de ficheros de funciones Jalview / GFF)
-label.calculating_pca= Calculando PCA
+label.calculating_pca= Calculando ACP
label.jalview_cannot_open_file = Jalview no puede abrir el fichero
label.jalview_applet = Aplicación Jalview
label.loading_data = Cargando datos
label.set_as_default = Establecer por defecto
label.show_labels = Mostrar etiquetas
label.associate_nodes_with = Asociar nodos con
-label.jalview_pca_calculation = Cálculo del PCA por Jalview
+label.jalview_pca_calculation = Cálculo del ACP por Jalview
label.link_name = Nombre del enalce
label.pdb_file = Fichero PDB
label.colour_with_jmol = Colorear con Jmol
label.error_whilst_saving_current_state_to = Error mientras se guardaba el estado a {0}
label.error_whilst_loading_project_from = Error cargando el proyecto desde {0}
label.couldnt_load_project = No es posible cargar el proyecto
-label.pca_sequences_not_aligned = Las secuencias deben estar alineadas antes de calcular el PCA.\nPruebe a utilizar la funci\u00F3n de rellenar huecos en el men\u00FA Editar,\no cualquiera de los servicios web de alineamiento m\u00FAltiple.
+label.pca_sequences_not_aligned = Las secuencias deben estar alineadas antes de calcular el ACP.\nPruebe a utilizar la funci\u00F3n de rellenar huecos en el men\u00FA Editar,\no cualquiera de los servicios web de alineamiento m\u00FAltiple.
label.invalid_name_preset_exists = Nombre no válido - esta preconfiguración ya existe.
label.invalid_name = Nombre no válido
label.set_proxy_settings = Por favor, configure su proxy en la pestaña 'Conexiones' de la ventana de Preferencia
label.empty_alignment_job = Trabajo de alineamiento vacío
label.add_new_sbrs_service = Añadir un nuevo SBRS
label.edit_sbrs_entry = Editar entrada SBRS
-label.pca_recalculating = Recalculando PCA
-label.pca_calculating = Calculando PCA
+label.pca_recalculating = Recalculando ACP
+label.pca_calculating = Calculando ACP
label.select_foreground_colour = Escoger color del primer plano
label.select_colour_for_text = Seleccione el color del texto
label.adjunst_foreground_text_colour_threshold = Ajustar el umbral del color del texto en primer plano
import jalview.analysis.AlignmentSorter;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
-import jalview.analysis.NJTree;
+import jalview.analysis.TreeBuilder;
import jalview.api.AlignViewControllerGuiI;
import jalview.api.AlignViewControllerI;
import jalview.api.AlignViewportI;
public void averageDistanceTreeMenuItem_actionPerformed()
{
- NewTreePanel(NJTree.AVERAGE_DISTANCE, "PID",
+ NewTreePanel(TreeBuilder.AVERAGE_DISTANCE, "PID",
"Average distance tree using PID");
}
public void neighbourTreeMenuItem_actionPerformed()
{
- NewTreePanel(NJTree.NEIGHBOUR_JOINING, "PID",
+ NewTreePanel(TreeBuilder.NEIGHBOUR_JOINING, "PID",
"Neighbour joining tree using PID");
}
protected void njTreeBlosumMenuItem_actionPerformed()
{
- NewTreePanel(NJTree.NEIGHBOUR_JOINING, "BL",
+ NewTreePanel(TreeBuilder.NEIGHBOUR_JOINING, "BL",
"Neighbour joining tree using BLOSUM62");
}
protected void avTreeBlosumMenuItem_actionPerformed()
{
- NewTreePanel(NJTree.AVERAGE_DISTANCE, "BL",
+ NewTreePanel(TreeBuilder.AVERAGE_DISTANCE, "BL",
"Average distance tree using BLOSUM62");
}
@Override
public void actionPerformed(ActionEvent e)
{
- new TreeChooser(AlignFrame.this);
+ new CalculationChooser(AlignFrame.this);
}
});
buildColourMenu();
*/
package jalview.gui;
-import jalview.analysis.NJTree;
-import jalview.analysis.scoremodels.PIDModel;
+import jalview.analysis.TreeBuilder;
import jalview.analysis.scoremodels.ScoreModels;
import jalview.analysis.scoremodels.SimilarityParams;
import jalview.api.analysis.ScoreModelI;
import javax.swing.JRadioButton;
/**
- * A dialog to allow a user to select and action Tree calculation options
+ * A dialog where a user can choose and action Tree or PCA calculation options
*/
-public class TreeChooser extends JPanel
+public class CalculationChooser extends JPanel
{
+ /*
+ * flag for whether gap matches residue in the PID calculation for a Tree
+ * - true gives Jalview 2.10.1 behaviour
+ * - set to false (using Groovy) for a more correct tree
+ * (JAL-374)
+ */
+ private static boolean treeMatchGaps = true;
+
private static final Font VERDANA_11PT = new Font("Verdana", 0, 11);
AlignFrame af;
*
* @param af
*/
- public TreeChooser(AlignFrame alignFrame)
+ public CalculationChooser(AlignFrame alignFrame)
{
this.af = alignFrame;
init();
}
this.add(actionPanel);
- int width = 380;
+ int width = 350;
int height = includeParams ? 400 : 220;
Desktop.addInternalFrame(frame,
- MessageManager.getString("label.choose_tree"), width, height,
- false);
+ MessageManager.getString("label.choose_calculation"), width,
+ height, false);
frame.setLayer(JLayeredPane.PALETTE_LAYER);
}
boolean doPCA = pca.isSelected();
ScoreModelI sm = ScoreModels.getInstance().forName(
modelNames.getSelectedItem().toString());
- SimilarityParamsI params = getSimilarityParameters(doPCA, sm);
+ SimilarityParamsI params = getSimilarityParameters(doPCA);
if (doPCA)
{
- AlignViewport viewport = af.getViewport();
- if (((viewport.getSelectionGroup() != null)
- && (viewport.getSelectionGroup().getSize() < 4) && (viewport
- .getSelectionGroup().getSize() > 0))
- || (viewport.getAlignment().getHeight() < 4))
- {
- JvOptionPane
- .showInternalMessageDialog(
- this,
- MessageManager
- .getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
- MessageManager
- .getString("label.sequence_selection_insufficient"),
- JvOptionPane.WARNING_MESSAGE);
- return;
- }
- new PCAPanel(af.alignPanel, sm, params);
+ openPcaPanel(sm, params);
}
else
{
- String treeType = neighbourJoining.isSelected() ? NJTree.NEIGHBOUR_JOINING
- : NJTree.AVERAGE_DISTANCE;
- af.newTreePanel(treeType, sm, params);
+ openTreePanel(sm, params);
}
// closeFrame();
}
/**
+ * Open a new Tree panel on the desktop
+ *
+ * @param sm
+ * @param params
+ */
+ protected void openTreePanel(ScoreModelI sm, SimilarityParamsI params)
+ {
+ String treeType = neighbourJoining.isSelected() ? TreeBuilder.NEIGHBOUR_JOINING
+ : TreeBuilder.AVERAGE_DISTANCE;
+ af.newTreePanel(treeType, sm, params);
+ }
+
+ /**
+ * Open a new PCA panel on the desktop
+ *
+ * @param sm
+ * @param params
+ */
+ protected void openPcaPanel(ScoreModelI sm, SimilarityParamsI params)
+ {
+ AlignViewport viewport = af.getViewport();
+ if (((viewport.getSelectionGroup() != null)
+ && (viewport.getSelectionGroup().getSize() < 4) && (viewport
+ .getSelectionGroup().getSize() > 0))
+ || (viewport.getAlignment().getHeight() < 4))
+ {
+ JvOptionPane
+ .showInternalMessageDialog(
+ this,
+ MessageManager
+ .getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
+ MessageManager
+ .getString("label.sequence_selection_insufficient"),
+ JvOptionPane.WARNING_MESSAGE);
+ return;
+ }
+ new PCAPanel(af.alignPanel, sm, params);
+ }
+
+ /**
*
*/
protected void closeFrame()
* calculation
*
* @param doPCA
- * @param sm
* @return
*/
- protected SimilarityParamsI getSimilarityParameters(boolean doPCA,
- ScoreModelI sm)
+ protected SimilarityParamsI getSimilarityParameters(boolean doPCA)
{
// commented out: parameter choices read from gui widgets
// SimilarityParamsI params = new SimilarityParams(
// includeGappedColumns.isSelected(), matchGaps.isSelected(),
// includeGaps.isSelected(), shorterSequence.isSelected());
- /*
- * for now we want
- * includeGappedColumns = true
- * includeGaps = true
- * matchOnShortestSequence = false
- * matchGaps = true except false for PCA by PID (to match SeqSpace)
- */
boolean includeGapGap = true;
boolean includeGapResidue = true;
boolean matchOnShortestLength = false;
- boolean matchGap = true;
- if (doPCA && (sm instanceof PIDModel))
- {
- matchGap = false;
- }
+
+ /*
+ * 'matchGaps' flag is only used in the PID calculation
+ * - set to false for PCA so that PCA using PID reproduces SeqSpace PCA
+ * - set to true for Tree to reproduce Jalview 2.10.1 calculation
+ * - set to false for Tree for a more correct calculation (JAL-374)
+ */
+ boolean matchGap = doPCA ? false : treeMatchGaps;
+
return new SimilarityParams(includeGapGap, matchGap, includeGapResidue, matchOnShortestLength);
}
*/
package jalview.io.vamsas;
-import jalview.analysis.NJTree;
+import jalview.analysis.TreeBuilder;
import jalview.analysis.TreeModel;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
prov.getEntry(0).addParam(new Param());
prov.getEntry(0).getParam(0).setName("treeType");
prov.getEntry(0).getParam(0).setType("utf8");
- prov.getEntry(0).getParam(0).setContent(NJTree.NEIGHBOUR_JOINING);
+ prov.getEntry(0).getParam(0)
+ .setContent(TreeBuilder.NEIGHBOUR_JOINING);
// TODO: type of tree is a general parameter
int ranges[] = tp.getTree().seqData.getVisibleContigs();
// VisibleContigs are with respect to alignment coordinates. Still need