protected Deque<CommandI> redoList = new ArrayDeque<>();
- protected String sequenceSetID;
-
+ /**
+ * alignment displayed in the viewport. Please use get/setter
+ */
+ protected AlignmentI alignment;
+
/*
* probably unused indicator that view is of a dataset rather than an
* alignment
*/
- protected boolean isDataset = false;
private Map<SequenceI, SequenceCollectionI> hiddenRepSequences;
protected AlignmentAnnotation conservation;
protected AlignmentAnnotation quality;
-
- /**
- * alignment displayed in the viewport
- */
- private AlignmentI alignment;
-
+
/**
* results of alignment consensus analysis for visible portion of view
*/
return alignment.getGapCharacter();
}
+ protected String sequenceSetID;
+
+ /**
+ * probably unused indicator that view is of a dataset rather than an
+ * alignment
+ */
+ protected boolean isDataset = false;
+
public void setDataset(boolean b)
{
isDataset = b;
return isDataset;
}
+ private Map<SequenceI, SequenceCollectionI> hiddenRepSequences;
+
+ protected ColumnSelection colSel = new ColumnSelection();
+
+ public boolean autoCalculateConsensus = true;
+
+ protected boolean autoCalculateStrucConsensus = true;
+
+ protected boolean ignoreGapsInConsensusCalculation = false;
+
+ protected ResidueShaderI residueShading = new ResidueShader();
+
@Override
public void setGlobalColourScheme(ColourSchemeI cs)
{
{
return residueShading;
}
+
+ protected AlignmentAnnotation consensus;
+
+ protected AlignmentAnnotation complementConsensus;
+
+ protected AlignmentAnnotation gapcounts;
+
+ protected AlignmentAnnotation strucConsensus;
+
+ protected AlignmentAnnotation conservation;
+
+ protected AlignmentAnnotation quality;
+
+ protected AlignmentAnnotation[] groupConsensus;
+
+ protected AlignmentAnnotation[] groupConservation;
+
+ /**
+ * results of alignment consensus analysis for visible portion of view
+ */
+ protected ProfilesI hconsensus = null;
+
+ /**
+ * results of cDNA complement consensus visible portion of view
+ */
+ protected Hashtable[] hcomplementConsensus = null;
+
+ /**
+ * results of secondary structure base pair consensus for visible portion of
+ * view
+ */
+ protected Hashtable[] hStrucConsensus = null;
+
+ protected Conservation hconservation = null;
+
@Override
public void setConservation(Conservation cons)
{
}
@Override
- public void setConsensusProfiles(ProfilesI hconsensus)
+ public void setSequenceConsensusHash(ProfilesI hconsensus)
{
- this.consensusProfiles = hconsensus;
+ this.hconsensus = hconsensus;
}
@Override
}
@Override
- public ProfilesI getConsensusProfiles()
+ public ProfilesI getSequenceConsensusHash()
{
- return consensusProfiles;
+ return hconsensus;
}
@Override
}
@Override
- public AlignmentAnnotation getOccupancyAnnotation()
+ public AlignmentAnnotation getAlignmentGapAnnotation()
{
- return occupancy;
+ return gapcounts;
}
@Override
conservation = null;
quality = null;
consensusProfiles = null;
+ groupConsensus = null;
+ groupConservation = null;
+ hconsensus = null;
hconservation = null;
hcomplementConsensus = null;
- occupancy = null;
+ gapcounts = null;
calculator = null;
residueShading = null; // may hold a reference to Consensus
changeSupport = null;
ignoreGapsInConsensusCalculation = b;
if (ap != null)
{
+ updateConsensus(ap);
if (residueShading != null)
{
residueShading.setThreshold(residueShading.getThreshold(),
}
else
{
- sequences = selectionGroup.getSelectionAsNewSequences(alignment,
- true);
+ sequences = selectionGroup.getSelectionAsNewSequences(alignment);
}
return sequences;
{
alignment.padGaps();
}
+ if (autoCalculateConsensus)
+ {
+ updateConsensus(ap);
+ }
+ if (hconsensus != null && autoCalculateConsensus)
+ {
+ updateConservation(ap);
+ }
+ if (autoCalculateStrucConsensus)
+ {
+ updateStrucConsensus(ap);
+ }
// Reset endRes of groups if beyond alignment width
int alWidth = alignment.getWidth();
{
rs.alignmentChanged(alignment, hiddenRepSequences);
- rs.setConsensus(consensusProfiles);
+ rs.setConsensus(hconsensus);
if (rs.conservationApplied())
{
rs.setConservation(Conservation.calculateConservation("All",
// depending on if the user wants to see the annotation or not in a
// specific alignment
- if (consensusProfiles == null && !isDataset)
+ if (hconsensus == null && !isDataset)
{
if (!alignment.isNucleotide())
{
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
initConsensus(consensus);
- initOccupancy();
+ initGapCounts();
initComplementConsensus();
}
// these should be extracted from the view model - style and settings for
// derived annotation
- private void initOccupancy()
+ private void initGapCounts()
{
if (showOccupancy)
{
- occupancy = new AlignmentAnnotation("Occupancy",
+ gapcounts = new AlignmentAnnotation("Occupancy",
MessageManager.getString("label.occupancy_descr"),
new Annotation[1], 0f, alignment.getHeight(),
AlignmentAnnotation.BAR_GRAPH);
- occupancy.hasText = true;
- occupancy.autoCalculated = true;
- occupancy.scaleColLabel = true;
- occupancy.graph = AlignmentAnnotation.BAR_GRAPH;
+ gapcounts.hasText = true;
+ gapcounts.autoCalculated = true;
+ gapcounts.scaleColLabel = true;
+ gapcounts.graph = AlignmentAnnotation.BAR_GRAPH;
- alignment.addAnnotation(occupancy);
+ alignment.addAnnotation(gapcounts);
}
}