label.group_consensus = Group Consensus
label.group_conservation = Group Conservation
label.show_consensus_histogram = Show Consensus Histogram
-label.show_ssconsensus_histogram = Show SS Consensus Histogram
label.show_consensus_logo = Show Consensus Logo
label.show_ssconsensus_logo = Show SS Consensus Logo
label.norm_consensus_logo = Normalise Consensus Logo
label.apply_all_groups = Apply to all groups
label.autocalculated_annotation = Autocalculated Annotation
label.show_secondary_structure = Show Secondary Structure
+label.show_secondary_structure_consensus = Show Secondary Structure Consensus
label.show_first = Show first
label.show_last = Show last
label.struct_from_pdb = Process secondary structure from PDB
for (AlignmentAnnotation annot : aa)
{
- if (ssSource
- .equals(extractSSSourceFromAnnotationDescription(annot)))
+ String ssSourceForAnnot = extractSSSourceFromAnnotationDescription(annot);
+ if (ssSourceForAnnot != null && ssSource
+ .equals(ssSourceForAnnot))
{
ssAnnots.add(annot);
}
String ssSource = AlignmentUtils
.extractSSSourceFromAnnotationDescription(aa);
- if (ssSource.equals(selectedSSSource))
+ if (ssSource != null && ssSource.equals(selectedSSSource))
{
ssAlignmentAnnotationForSequences
boolean isShowConsensusHistogram();
- boolean isShowSSConsensusHistogram();
-
boolean isShowSequenceLogo();
- boolean isShowSequenceSSLogo();
-
boolean isNormaliseSequenceLogo();
ColourSchemeI getGlobalColourScheme();
package jalview.api;
import java.awt.Color;
+import java.util.List;
public interface ViewStyleI
{
* @return
*/
void setProteinFontAsCdna(boolean b);
+
+ void setSecondaryStructureSources(List<String> secondaryStructureSources);
+
+ List<String> getSecondaryStructureSources();
}
private List<AlignedCodonFrame> codonFrameList;
- private List<String> secondaryStructureSources;
-
private void initAlignment(SequenceI[] seqs)
{
groups = Collections.synchronizedList(new ArrayList<SequenceGroup>());
}
- public List<String> getSecondaryStructureSources()
- {
- return secondaryStructureSources;
- }
-
- public void setSecondaryStructureSources(
- List<String> secondaryStructureSources)
- {
- this.secondaryStructureSources = secondaryStructureSources;
- }
-
}
ssSources = AlignmentUtils.extractSSSourceInAlignmentAnnotation(anns);
+ if(ssSources == null) {
+ showSS.removeAll();
+ ssButtonGroup.clearSelection();
+ return;
+ }
+
List<String> selectedCheckBoxes = getSelectedOptions(checkboxMap);
// Add checkboxes for categories
if (label.equals(aa.label)) {
String ssSource = AlignmentUtils.extractSSSourceFromAnnotationDescription(aa);
- if(ssSource.equals(ssSourceSelection) || ssSourceSelection.equals(noneOption)) {
+
+ if(ssSource != null && (ssSource.equals(ssSourceSelection) || ssSourceSelection.equals(noneOption))) {
aa.visible = visible;
}
}
alignPanel.paintAlignment(true, true);
}
+
+ protected void showSSConsensus_actionPerformed(ActionEvent e)
+ {
+ viewport.setShowSSConsensus(showSSConsensus.getState());
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+
+ }
/*
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
- @Override
- protected void showSSConsensusHistogram_actionPerformed(ActionEvent e)
- {
- viewport.setShowSSConsensusHistogram(showSSConsensusHistogram.getState());
- alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
- }
-
/*
* (non-Javadoc)
*
}
showConsensusHistogram = Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM",
true);
- showSSConsensusHistogram = Cache.getDefault("SHOW_SSCONSENSUS_HISTOGRAM",
- true);
showSequenceLogo = Cache.getDefault("SHOW_CONSENSUS_LOGO", true);
normaliseSequenceLogo = Cache.getDefault("NORMALISE_CONSENSUS_LOGO",
false);
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
+import java.util.List;
import java.util.Locale;
import javax.swing.JCheckBoxMenuItem;
import jalview.analysis.AlignSeq;
import jalview.analysis.AlignmentUtils;
+import jalview.api.AlignCalcWorkerI;
import jalview.bin.Cache;
import jalview.bin.Jalview;
import jalview.datamodel.Alignment;
import jalview.io.FileFormat;
import jalview.io.FormatAdapter;
import jalview.util.Comparison;
+import jalview.util.Constants;
import jalview.util.MessageManager;
import jalview.util.Platform;
+import jalview.workers.SecondaryStructureConsensusThread;
/**
* The panel that holds the labels for alignment annotations, providing
{
ap.av.getAlignment().deleteAnnotation(aa[selectedRow]);
ap.av.getCalcManager().removeWorkerForAnnotation(aa[selectedRow]);
+
+
+ List<AlignCalcWorkerI> workers = ap.av.getCalcManager()
+ .getRegisteredWorkersOfClass(SecondaryStructureConsensusThread.class);
+ if (!workers.isEmpty()) {
+
+ ap.alignFrame.getViewport().getCalcManager().startWorker(workers.remove(0));
+
+ }
}
else if (SHOWALL.equals(action))
{
protected JMenuItem expandViews = new JMenuItem();
+ protected JCheckBoxMenuItem showSSConsensus = new JCheckBoxMenuItem();
+
protected JCheckBoxMenuItem showGroupConsensus = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem showGroupConservation = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem showConsensusHistogram = new JCheckBoxMenuItem();
- protected JCheckBoxMenuItem showSSConsensusHistogram = new JCheckBoxMenuItem();
-
protected JCheckBoxMenuItem showSequenceLogo = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem();
});
+ showSSConsensus
+ .setText(MessageManager.getString("label.show_secondary_structure_consensus"));
+ showSSConsensus.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showSSConsensus_actionPerformed(e);
+ }
+
+ });
+
showGroupConsensus
.setText(MessageManager.getString("label.group_consensus"));
showGroupConsensus.addActionListener(new ActionListener()
}
});
- showSSConsensusHistogram.setText(
- MessageManager.getString("label.show_ssconsensus_histogram"));
- showSSConsensusHistogram.addActionListener(new ActionListener()
- {
-
- @Override
- public void actionPerformed(ActionEvent e)
- {
- showConsensusHistogram_actionPerformed(e);
- }
-
- });
showSequenceLogo
.setText(MessageManager.getString("label.show_consensus_logo"));
showSequenceLogo.addActionListener(new ActionListener()
autoAnnMenu.addSeparator();
autoAnnMenu.add(applyAutoAnnotationSettings);
autoAnnMenu.add(showConsensusHistogram);
- autoAnnMenu.add(showSSConsensusHistogram);
autoAnnMenu.add(showSequenceLogo);
autoAnnMenu.add(normaliseSequenceLogo);
+ autoAnnMenu.add(showSSConsensus);
autoAnnMenu.addSeparator();
autoAnnMenu.add(showGroupConservation);
autoAnnMenu.add(showGroupConsensus);
// selectMenu.add(listenToViewSelections);
}
+ protected void showSSConsensus_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
protected void createPNG_actionPerformed(ActionEvent object)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
}
-
- protected void showSSConsensusHistogram_actionPerformed(ActionEvent e)
- {
- // TODO Auto-generated method stub
-
- }
protected void showSequenceLogo_actionPerformed(ActionEvent e)
{
protected List<AlignmentAnnotation> secondaryStructureConsensus;
- protected List<String> secondaryStructureSources;
-
protected AlignmentAnnotation complementConsensus;
protected AlignmentAnnotation gapcounts;
@Override
public List<String> getSecondaryStructureSources()
{
- return secondaryStructureSources;
+ return viewStyle.getSecondaryStructureSources();
}
@Override
public void setSecondaryStructureSources(
List<String> secondaryStructureSources)
{
- this.secondaryStructureSources = secondaryStructureSources;
+ viewStyle.setSecondaryStructureSources(secondaryStructureSources);
}
protected void setSecondaryStructureSources(AlignmentAnnotation[] aa)
sources = AlignmentUtils.extractSSSourceInAlignmentAnnotation(aa);
if(sources != null) {
sources.add(0,MessageManager.getString("option.ss_providers_all"));
- setSecondaryStructureSources(sources);
+ viewStyle.setSecondaryStructureSources(sources);
}
}
}
{
return;
}
- if (secondaryStructureConsensus.size() != secondaryStructureSources.size()) {
+ List<String> ssSources = viewStyle.getSecondaryStructureSources();
+ if (secondaryStructureConsensus.size() != ssSources.size()) {
- for(String source : secondaryStructureSources) {
+ for(String source : ssSources) {
boolean ssConsensusForSourcePresent = false;
for(AlignmentAnnotation aa : secondaryStructureConsensus) {
if(aa.description.startsWith(source)) {
*/
protected boolean showSequenceLogo = false;
- protected boolean showSequenceSSLogo = false;
-
/**
* should consensus profile be rendered normalised to row height
*/
*/
protected boolean showConsensusHistogram = true;
- protected boolean showSSConsensusHistogram = true;
-
- public void setShowSSConsensusHistogram(boolean showSSConsensusHistogram)
- {
- this.showSSConsensusHistogram = showSSConsensusHistogram;
- }
-
/**
* @return the showConsensusProfile
*/
return showSequenceLogo;
}
- @Override
- public boolean isShowSequenceSSLogo()
- {
- return showSequenceSSLogo;
- }
-
/**
* @param showSequenceLogo
* the new value
calculator.updateAnnotationFor(ConsensusThread.class);
calculator.updateAnnotationFor(ComplementConsensusThread.class);
calculator.updateAnnotationFor(StrucConsensusThread.class);
+
+ //to do
+
+ calculator.updateAnnotationFor(SecondaryStructureConsensusThread.class);
}
this.showSequenceLogo = showSequenceLogo;
}
- public void setShowSequenceSSLogo(boolean showSequenceSSLogo)
- {
- if (showSequenceSSLogo != this.showSequenceSSLogo)
- {
- // TODO: decouple settings setting from calculation when refactoring
- // annotation update method from alignframe to viewport
- this.showSequenceSSLogo = showSequenceSSLogo;
- calculator.updateAnnotationFor(SecondaryStructureConsensusThread.class);
- }
- this.showSequenceSSLogo = showSequenceSSLogo;
- }
-
/**
* @param showConsensusHistogram
* the showConsensusHistogram to set
{
this.showGroupConsensus = showGroupConsensus;
}
-
+
+ /**
+ * @param showSSConsensus
+ * the showSSConsensus to set
+ */
+ public void setShowSSConsensus(boolean showSSConsensus)
+ {
+ this.showSSConsensus = showSSConsensus;
+ }
+
/**
*
* @return flag to indicate if the consensus histogram should be rendered by
{
return this.showConsensusHistogram;
}
-
- @Override
- public boolean isShowSSConsensusHistogram()
- {
- return this.showSSConsensusHistogram;
- }
/**
* when set, updateAlignment will always ensure sequences are of equal length
protected boolean showConsensus = true;
- protected boolean showSSConsensus = false;
+ protected boolean showSSConsensus = true;
protected boolean showOccupancy = true;
boolean conv = isShowGroupConservation();
boolean cons = isShowGroupConsensus();
boolean showprf = isShowSequenceLogo();
- boolean showSSprf = isShowSequenceSSLogo();
boolean showConsHist = isShowConsensusHistogram();
- boolean showSSConsHist = isShowSSConsensusHistogram();
boolean normLogo = isNormaliseSequenceLogo();
/**
{
// set defaults for this group's conservation/consensus
sg.setshowSequenceLogo(showprf);
- sg.setshowSequenceSSLogo(showSSprf);
sg.setShowConsensusHistogram(showConsHist);
- sg.setShowSSConsensusHistogram(showSSConsHist);
sg.setNormaliseSequenceLogo(normLogo);
}
if (conv)
package jalview.viewmodel.styles;
import java.awt.Color;
+import java.util.List;
import jalview.api.ViewStyleI;
private boolean showComplementFeatures;
private boolean showComplementFeaturesOnTop;
+
+ /**
+ * secondary structure annotation rows shown in the view
+ */
+ private List<String> secondaryStructureSources = List.of( new String[0] );
/**
* GUI state
{
return showComplementFeaturesOnTop;
}
+
+ @Override
+ public List<String> getSecondaryStructureSources()
+ {
+ return secondaryStructureSources;
+ }
+
+ @Override
+ public void setSecondaryStructureSources(List<String> secondaryStructureSources)
+ {
+ this.secondaryStructureSources = secondaryStructureSources;
+ }
}