From: gmungoc Anotación para {0}
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} @@ -433,7 +434,7 @@ label.label = Etiqueta 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 @@ -655,7 +656,7 @@ label.add_local_source = A 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 @@ -779,7 +780,7 @@ label.couldnt_save_project = No es posible guardar el proyecto 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 @@ -940,8 +941,8 @@ label.submission_params = Env 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 diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 9d19ec8..02498aa 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -22,7 +22,7 @@ package jalview.appletgui; 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; @@ -2814,25 +2814,25 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, 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"); } diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index a222995..de1d003 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -372,7 +372,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override public void actionPerformed(ActionEvent e) { - new TreeChooser(AlignFrame.this); + new CalculationChooser(AlignFrame.this); } }); buildColourMenu(); diff --git a/src/jalview/gui/TreeChooser.java b/src/jalview/gui/CalculationChooser.java similarity index 76% rename from src/jalview/gui/TreeChooser.java rename to src/jalview/gui/CalculationChooser.java index fa1195c..faaf86b 100644 --- a/src/jalview/gui/TreeChooser.java +++ b/src/jalview/gui/CalculationChooser.java @@ -20,8 +20,7 @@ */ 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; @@ -48,10 +47,18 @@ import javax.swing.JPanel; 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; @@ -83,7 +90,7 @@ public class TreeChooser extends JPanel * * @param af */ - public TreeChooser(AlignFrame alignFrame) + public CalculationChooser(AlignFrame alignFrame) { this.af = alignFrame; init(); @@ -216,11 +223,11 @@ public class TreeChooser extends JPanel } 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); } @@ -233,39 +240,61 @@ public class TreeChooser extends JPanel 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() @@ -283,32 +312,27 @@ public class TreeChooser extends JPanel * 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); } diff --git a/src/jalview/io/vamsas/Tree.java b/src/jalview/io/vamsas/Tree.java index f784fb0..f676347 100644 --- a/src/jalview/io/vamsas/Tree.java +++ b/src/jalview/io/vamsas/Tree.java @@ -20,7 +20,7 @@ */ package jalview.io.vamsas; -import jalview.analysis.NJTree; +import jalview.analysis.TreeBuilder; import jalview.analysis.TreeModel; import jalview.bin.Cache; import jalview.datamodel.AlignmentI; @@ -240,7 +240,8 @@ public class Tree extends DatastoreItem 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