Resolved merge conflicts in Messages.properties, GAlignFrame.java, AlignmentViewport.java, and SecondaryStructureConsensusThread.java
{
int seqCount = sequences.length;
+
+ int seqWithSSCount = 0;
ProfileI[] result = new ProfileI[width];
-
+ int maxSSannotcount=0;
for (int column = start; column < end; column++)
{
autoAnnMenu.addSeparator();
autoAnnMenu.add(applyAutoAnnotationSettings);
autoAnnMenu.add(showConsensusHistogram);
- autoAnnMenu.add(showSSConsensusHistogram);
autoAnnMenu.add(showSequenceLogo);
autoAnnMenu.add(normaliseSequenceLogo);
- //autoAnnMenu.add(showSSConsensus);
+ // autoAnnMenu.add(showSSConsensus);
autoAnnMenu.addSeparator();
autoAnnMenu.add(showGroupConservation);
autoAnnMenu.add(showGroupConsensus);
// selectMenu.addSeparator();
// selectMenu.add(listenToViewSelections);
}
+
- protected void showStructureProvider_actionPerformed(ActionEvent e)
+ protected void showSSConsensus_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
- protected void showSSConsensus_actionPerformed(ActionEvent e)
++ protected void showStructureProvider_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
protected void createPNG_actionPerformed(ActionEvent object)
{
// TODO Auto-generated method stub
{
initConservation();
initQuality();
- initSSConsensus();
++
++ setSecondaryStructureSources(alignment.getAlignmentAnnotation());
++ List<String> secondaryStructureSources = getSecondaryStructureSources();
++
++ if(secondaryStructureSources!=null) {
++
++ secondaryStructureConsensus = new ArrayList<AlignmentAnnotation>();
++ for (String ssSource : secondaryStructureSources) {
++
++ AlignmentAnnotation ssConsensus = new AlignmentAnnotation(MessageManager.getString("label.ssconsensus_label") + " "+ssSource,
++ ssSource + " " + MessageManager.getString("label.ssconsensus_descr"),
++ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
++ secondaryStructureConsensus.add(ssConsensus);
++ }
++
++ }
++ initSSConsensus(secondaryStructureConsensus);
}
else
{
consensus = new AlignmentAnnotation("Consensus",
MessageManager.getString("label.consensus_descr"),
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
- setSecondaryStructureSources(alignment.getAlignmentAnnotation());
- List<String> secondaryStructureSources = getSecondaryStructureSources();
-
- if(secondaryStructureSources!=null) {
-
- secondaryStructureConsensus = new ArrayList<AlignmentAnnotation>();
- for (String ssSource : secondaryStructureSources) {
-
- AlignmentAnnotation ssConsensus = new AlignmentAnnotation(MessageManager.getString("label.ssconsensus_label") + " "+ssSource,
- ssSource + " " + MessageManager.getString("label.ssconsensus_descr"),
- new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
- secondaryStructureConsensus.add(ssConsensus);
- }
-
- }
-
initConsensus(consensus);
- initSSConsensus(secondaryStructureConsensus);
initGapCounts();
initComplementConsensus();
}
alignment.addAnnotation(aa);
}
}
-
- private void initSSConsensus()
+
+ private void initSSConsensus(List<AlignmentAnnotation> secondaryStructureConsensuses)
{
+ if(secondaryStructureConsensuses == null) {
+ return;
+ }
- for(AlignmentAnnotation aa : secondaryStructureConsensuses) {
- aa.hasText = true;
- aa.autoCalculated = true;
-
- if (showSSConsensus)
- {
+ if (!alignment.isNucleotide() && showSSConsensus)
+ {
- if (secondaryStructureConsensus == null)
- {
- secondaryStructureConsensus = new AlignmentAnnotation(
- MessageManager.getString("label.ssconsensus_label"),
- MessageManager.getString("label.ssconsensus_descr"),
- new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-
- secondaryStructureConsensus.hasText = true;
- secondaryStructureConsensus.autoCalculated = true;
++ for(AlignmentAnnotation aa : secondaryStructureConsensuses) {
++ aa.hasText = true;
++ aa.autoCalculated = true;
+ alignment.addAnnotation(aa);
}
-
- alignment.addAnnotation(secondaryStructureConsensus);
}
}
// long started = System.currentTimeMillis();
try
{
- AlignmentAnnotation ssConsensus = getSSConsensusAnnotation();
+ List<AlignmentAnnotation> ssConsensus = getSSConsensusAnnotation();
- AlignmentAnnotation gap = getGapAnnotation();
- if ((ssConsensus == null && gap == null) || calcMan.isPending(this))
+ if ((ssConsensus == null) || calcMan.isPending(this))
{
calcMan.workerComplete(this);
return;
*/
protected void eraseSSConsensus(int aWidth)
{
- AlignmentAnnotation ssConsensus = getSSConsensusAnnotation();
- if (ssConsensus != null)
- {
- ssConsensus.annotations = new Annotation[aWidth];
+ List<AlignmentAnnotation> ssConsensuses = getSSConsensusAnnotation();
+ for(AlignmentAnnotation ssConsensus : ssConsensuses) {
+ if (ssConsensus != null)
+ {
+ ssConsensus.annotations = new Annotation[aWidth];
+ }
}
- AlignmentAnnotation gap = getGapAnnotation();
- if (gap != null)
- {
- gap.annotations = new Annotation[aWidth];
- }
}
/**
return alignViewport
.getAlignmentSecondaryStructureConsensusAnnotation();
}
+
+ /**
+ * Get the Consensus annotation for the alignment
+ *
+ * @return
+ */
+ protected void setSecondaryStructureSources()
+ {
+ List<String> sources = null;
+ AlignmentAnnotation[] aa = alignViewport.getAlignment().getAlignmentAnnotation();
+ if(aa!=null) {
+ sources = AlignmentUtils.extractSSSourceInAlignmentAnnotation(aa);
+ if(sources != null) {
+ sources.add(0, Constants.SS_ALL_PROVIDERS);
+ alignViewport.setSecondaryStructureSources(sources);
+ }
+ }
+ }
+
+ protected List<String> getSecondaryStructureSources()
+ {
+ return alignViewport.getSecondaryStructureSources();
+ }
/**
- * Get the Gap annotation for the alignment
- *
- * @return
- */
- protected AlignmentAnnotation getGapAnnotation()
- {
- return alignViewport.getAlignmentGapAnnotation();
- }
-
- /**
* update the consensus annotation from the sequence profile data using
* current visualization settings.
*/
public void updateResultAnnotation(boolean immediate)
{
- AlignmentAnnotation ssConsensus = getSSConsensusAnnotation();
- ProfilesI hSSConsensus = (ProfilesI) getViewportSSConsensus();
+ List<AlignmentAnnotation> ssConsensuses = getSSConsensusAnnotation();
+ Map<String, ProfilesI> ssConsensusProfileMap = getViewportSSConsensus();
+ for(AlignmentAnnotation ssConsensus : ssConsensuses) {
+ ProfilesI ssConsensusProfile = null;
+ for(String source: ssConsensusProfileMap.keySet()) {
+ if(ssConsensus.description.startsWith(source)) {
+ ssConsensusProfile = ssConsensusProfileMap.get(source);
+ break;
+ }
+ }
+ if(ssConsensusProfile==null) {
+ continue;
+ }
if (immediate || !calcMan.isWorking(this) && ssConsensus != null
- && hSSConsensus != null)
+ && ssConsensusProfile != null)
{
- deriveSSConsensus(ssConsensus, hSSConsensus);
-
- ssConsensus.hasData=hSSConsensus.getCount()>0;
+ if(ssConsensusProfile.get(0)!=null)
+ ssConsensus.setNoOfSequencesIncluded(ssConsensusProfile.get(0).getSeqWithSSCount());
+ deriveSSConsensus(ssConsensus, ssConsensusProfile);
- AlignmentAnnotation gap = getGapAnnotation();
- if (gap != null)
- {
- deriveGap(gap, ssConsensusProfile);
- }
++ ssConsensus.hasData=ssConsensusProfile.getCount()>0;
+ }
}
}