action.show_group = Show Group\r
action.fetch_db_references = Fetch DB References\r
action.edit = Edit\r
+action.view_flanking_regions = Show flanking regions\r
+label.view_flanking_regions = Show sequence data either side of the subsequences involved in this alignment\r
label.str = Str:\r
label.seq = Seq:\r
label.structures_manager = Structures Manager\r
label.principal_component_analysis = Principal Component Analysis\r
label.average_distance_identity = Average Distance Using % Identity\r
label.neighbour_joining_identity = Neighbour Joining Using % Identity\r
+label.treecalc_title = {0} Using {1}\r
+label.tree_calc_av = Average Distance\r
+label.tree_calc_nj = Neighbour Joining\r
+label.select_score_model = Select score model\r
+label.score_model_pid = % Identity\r
+label.score_model_blosum62 = BLOSUM62\r
+label.score_model_pam250 = PAM 250\r
+label.score_model_conservation = Physicochemical property conservation\r
+label.score_model_enhconservation = Physicochemical property conservation\r
label.status_bar = Status bar\r
label.out_to_textbox = Output to Textbox\r
label.clustalx = Clustalx\r
for (SequenceI s:core.getSequences())
{
SequenceI newSeq = s.deriveSequence();
- if (newSeq.getStart()>maxoffset)
+ if (newSeq.getStart()>maxoffset && newSeq.getDatasetSequence().getStart()<s.getStart())
{
maxoffset = newSeq.getStart();
}
{
calculateTree.removeAll();
// build the calculate menu
+
for (final String type:new String[] {"NJ", "AV"})
{
+ String treecalcnm = MessageManager.getString("label.tree_calc_"+type.toLowerCase());
for (final Object pwtype: ResidueProperties.scoreMatrices.keySet())
{
JMenuItem tm = new JMenuItem();
ScoreModelI sm = ResidueProperties.scoreMatrices.get(pwtype);
- final String title="Calculate "+type+" using "+sm.getName();
- tm.setText(title);// MessageManager.getString("label.neighbour_blosum62"));
- tm
- .addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- NewTreePanel(type, (String) pwtype, title);
- }
- });
- calculateTree.add(tm);
+ if (sm.isProtein()==!viewport.getAlignment().isNucleotide())
+ {
+ String smn = MessageManager.getStringOrReturn(
+ "label.score_model_", sm.getName());
+ final String title = MessageManager.formatMessage(
+ "label.treecalc_title", treecalcnm, smn);
+ tm.setText(title);//
+ tm.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ NewTreePanel(type, (String) pwtype, title);
+ }
+ });
+ calculateTree.add(tm);
+ }
}
}
import jalview.datamodel.*;
import jalview.jbgui.*;
import jalview.schemes.ResidueProperties;
-import jalview.schemes.ScoreMatrix;
import jalview.util.MessageManager;
import jalview.viewmodel.PCAModel;
protected void scoreMatrix_menuSelected()
{
scoreMatrixMenu.removeAll();
- for (final Object sm:ResidueProperties.scoreMatrices.keySet())
+ for (final String sm:ResidueProperties.scoreMatrices.keySet())
{
- JMenuItem jm=new JMenuItem();
- jm.setText((String)sm);
- jm.setSelected(pcaModel.getScore_matrix().equals((String)sm));
- final PCAPanel us = this;
- jm.addActionListener(new ActionListener()
+ JCheckBoxMenuItem jm=new JCheckBoxMenuItem();
+ jm.setText(MessageManager.getStringOrReturn("label.score_model", sm));
+ jm.setSelected(pcaModel.getScore_matrix().equals(sm));
+ if (pcaModel.isNucleotide()==ResidueProperties.scoreMatrices.get(sm).isDNA())
{
- @Override
- public void actionPerformed(ActionEvent e)
+ final PCAPanel us = this;
+ jm.addActionListener(new ActionListener()
{
- if (!pcaModel.getScore_matrix().equals((String)sm))
+ @Override
+ public void actionPerformed(ActionEvent e)
{
- pcaModel.setScore_matrix((String) sm);
- Thread worker = new Thread(us);
- worker.start();
+ if (!pcaModel.getScore_matrix().equals((String) sm))
+ {
+ pcaModel.setScore_matrix((String) sm);
+ Thread worker = new Thread(us);
+ worker.start();
+ }
}
- }
- });
- scoreMatrixMenu.add(jm);
+ });
+ scoreMatrixMenu.add(jm);
+ }
}
}
public void bgcolour_actionPerformed(ActionEvent e)
if (!pcaModel.isNucleotide())
{
pcaModel.setNucleotide(true);
+ pcaModel.setScore_matrix("DNA");
Thread worker = new Thread(this);
worker.start();
}
if (pcaModel.isNucleotide())
{
pcaModel.setNucleotide(false);
+ pcaModel.setScore_matrix("BLOSUM62");
Thread worker = new Thread(this);
worker.start();
}
}
});
expandAlignment.setText(MessageManager.getString("action.view_flanking_regions"));
+ expandAlignment.setToolTipText(MessageManager.getString("label.view_flanking_regions"));
expandAlignment.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(ActionEvent e)
{
}
});
- scoreMatrixMenu.setText(MessageManager.getString("label.score_matrices"));
+ scoreMatrixMenu.setText(MessageManager.getString("label.select_score_model"));
scoreMatrixMenu.addMenuListener(new MenuListener()
{
public void menuSelected(MenuEvent e)
public static String formatMessage(String key, Object... params){
return MessageFormat.format(rb.getString(key), (Object[]) params);
}
+
+ /**
+ * lookup and return a key given a root and a human-readable(ish) name that when combined might resolve to an i18n string.
+ * If the key doesn't resolve, then name is returned.if the key doesn't exist.
+ * Use this for programatically constructed keys that have have a human readable alternative used in the program (e.g. BLOSUM62 and label.score_blosum62)
+ * @param keyroot
+ * @param name
+ * @return
+ */
+ public static String getStringOrReturn(String keyroot, String name)
+ {
+ String smkey = keyroot
+ + name.toLowerCase().replaceAll(" ", "");
+ try {
+ name = rb.getString(smkey);
+ }
+ catch (Exception x) {
+ log.finest("I18N missing key with root "+keyroot+": "+loc+"\t"+smkey);
+ }
+ return name;
+ }
}
// unknownSequences.remove(sequence);
int absEnd = absStart + nonGapped.length();
absStart += 1;
+ if (!trimDatasetSeqs) {
+ // insert full length sequence from record
+ sequence.setSequence(entry.getSequenceAsString());
+ sequence.setStart(entry.getStart());
+ }
if (updateRefFrame)
{
// finally, update local sequence reference frame if we're allowed
// just fix start/end
sequence.setStart(absStart);
sequence.setEnd(absEnd);
- } else {
- // insert full length sequence from record
- sequence.setSequence(entry.getSequenceAsString());
}
// search for alignment sequences to update coordinate frame for
for (int alsq = 0; alsq < alseqs.length; alsq++)