import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.analysis.Conservation;
+import jalview.analysis.TreeModel;
import jalview.api.AlignCalcManagerI;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
import jalview.datamodel.Annotation;
-import jalview.datamodel.CigarArray;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.HiddenSequences;
public abstract class AlignmentViewport
implements AlignViewportI, CommandListener, VamsasSource
{
- final protected ViewportRanges ranges;
+ protected ViewportRanges ranges;
protected ViewStyleI viewStyle = new ViewStyle();
protected Deque<CommandI> redoList = new ArrayDeque<>();
+ protected String sequenceSetID;
+
+ /*
+ * probably unused indicator that view is of a dataset rather than an
+ * alignment
+ */
+ protected boolean isDataset = false;
+
+ private Map<SequenceI, SequenceCollectionI> hiddenRepSequences;
+
+ protected ColumnSelection colSel = new ColumnSelection();
+
+ public boolean autoCalculateConsensus = true;
+
+ public boolean autoCalculateInformation = true;
+
+ protected boolean autoCalculateStrucConsensus = true;
+
+ protected boolean ignoreGapsInConsensusCalculation = false;
+
+ protected boolean ignoreBelowBackGroundFrequencyCalculation = false;
+
+ protected boolean infoLetterHeight = false;
+
+ protected ResidueShaderI residueShading = new ResidueShader();
+
+ protected AlignmentAnnotation consensus;
+
+ protected AlignmentAnnotation complementConsensus;
+
+ protected AlignmentAnnotation occupancy;
+
+ protected AlignmentAnnotation strucConsensus;
+
+ protected AlignmentAnnotation conservation;
+
+ protected AlignmentAnnotation quality;
+
+ protected List<AlignmentAnnotation> information = new ArrayList<>();
+
+ /**
+ * alignment displayed in the viewport
+ */
+ private AlignmentI alignment;
+
+ /**
+ * results of alignment consensus analysis for visible portion of view
+ */
+ protected ProfilesI hconsensus = null;
+
+ /**
+ * results of information annotation analysis for the visible portion of view
+ */
+ protected List<ProfilesI> hinformation = new ArrayList<>();
+
+ /**
+ * results of cDNA complement consensus visible portion of view
+ */
+ protected Hashtable[] hcomplementConsensus = null;
/**
- * alignment displayed in the viewport. Please use get/setter
+ * results of secondary structure base pair consensus for visible portion of
+ * view
*/
- protected AlignmentI alignment;
+ protected Hashtable[] hStrucConsensus = null;
+
+ protected Conservation hconservation = null;
public AlignmentViewport(AlignmentI al)
{
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;
-
- public boolean autoCalculateInformation = true;
-
- protected boolean autoCalculateStrucConsensus = true;
-
- protected boolean ignoreGapsInConsensusCalculation = false;
-
- protected boolean ignoreBelowBackGroundFrequencyCalculation = false;
-
- protected boolean infoLetterHeight = 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;
-
- protected List<AlignmentAnnotation> groupInformation = new ArrayList<>();
-
- protected List<AlignmentAnnotation> information = new ArrayList<>();
-
- /**
- * results of alignment consensus analysis for visible portion of view
- */
- protected ProfilesI hconsensus = null;
-
- /**
- * results of information annotation analysis for the visible portion of view
- */
- protected List<ProfilesI> hinformation = new ArrayList<>();
-
- /**
- * 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 AlignmentAnnotation getInformationAnnotation(int index)
- {
- return information.get(index);
- }
-
- @Override
public AlignmentAnnotation getAlignmentGapAnnotation()
{
- return gapcounts;
+ return occupancy;
}
@Override
strucConsensus = null;
conservation = null;
quality = null;
- groupConsensus = null;
- groupConservation = null;
hconsensus = null;
+ hconservation = null;
hcomplementConsensus = null;
- // colour scheme may hold reference to consensus
- residueShading = null;
- // TODO remove listeners from changeSupport?
+ occupancy = null;
+ calculator = null;
+ residueShading = null; // may hold a reference to Consensus
changeSupport = null;
+ ranges = null;
+ currentTree = null;
+ selectionGroup = null;
setAlignment(null);
}
public void removePropertyChangeListener(
java.beans.PropertyChangeListener listener)
{
- changeSupport.removePropertyChangeListener(listener);
+ if (changeSupport != null)
+ {
+ changeSupport.removePropertyChangeListener(listener);
+ }
}
/**
}
@Override
- public CigarArray getViewAsCigars(boolean selectedRegionOnly)
- {
- return new CigarArray(alignment, alignment.getHiddenColumns(),
- (selectedRegionOnly ? selectionGroup : null));
- }
-
- @Override
public jalview.datamodel.AlignmentView getAlignmentView(
boolean selectedOnly)
{
updateInformation(ap);
List<SequenceI> hmmSequences;
- hmmSequences = alignment.getHMMConsensusSequences(false);
+ hmmSequences = alignment.getHMMConsensusSequences();
for (SequenceI seq : hmmSequences)
{
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
initConsensus(consensus);
- initGapCounts();
+ initOccupancy();
initComplementConsensus();
}
@Override
public void initInformation()
{
- for (SequenceI seq : alignment.getHMMConsensusSequences(false))
+ for (SequenceI seq : alignment.getHMMConsensusSequences())
{
if (!seq.hasHMMAnnotation())
{
- AlignmentAnnotation information;
- information = new AlignmentAnnotation(seq.getName(),
+ AlignmentAnnotation info = new AlignmentAnnotation(seq.getName(),
MessageManager.getString("label.information_description"),
new Annotation[1], 0f, 6.52f,
AlignmentAnnotation.BAR_GRAPH);
- information.hasText = true;
- information.autoCalculated = true;
- information.hasText = true;
- information.autoCalculated = false;
- information.sequenceRef = seq;
- information.setCalcId("HMM");
- this.information.add(information);
+ info.hasText = true;
+ info.autoCalculated = false;
+ info.sequenceRef = seq;
+ info.setCalcId(InformationThread.HMM_CALC_ID);
+ this.information.add(info);
hinformation.add(new Profiles(new ProfileI[1]));
- alignment.addAnnotation(information);
+ alignment.addAnnotation(info);
seq.updateHMMMapping();
- seq.setHasInfo(true);
- seq.addAlignmentAnnotation(information);
+ seq.addAlignmentAnnotation(info);
}
}
-
}
// these should be extracted from the view model - style and settings for
// derived annotation
- private void initGapCounts()
+ private void initOccupancy()
{
if (showOccupancy)
{
- gapcounts = new AlignmentAnnotation("Occupancy",
+ occupancy = new AlignmentAnnotation("Occupancy",
MessageManager.getString("label.occupancy_descr"),
new Annotation[1], 0f, alignment.getHeight(),
AlignmentAnnotation.BAR_GRAPH);
- gapcounts.hasText = true;
- gapcounts.autoCalculated = true;
- gapcounts.scaleColLabel = true;
- gapcounts.graph = AlignmentAnnotation.BAR_GRAPH;
+ occupancy.hasText = true;
+ occupancy.autoCalculated = true;
+ occupancy.scaleColLabel = true;
+ occupancy.graph = AlignmentAnnotation.BAR_GRAPH;
- alignment.addAnnotation(gapcounts);
+ alignment.addAnnotation(occupancy);
}
}
*/
private SearchResultsI searchResults = null;
+ protected TreeModel currentTree = null;
+
@Override
public boolean hasSearchResults()
{
return false;
}
+ @Override
+ public void setCurrentTree(TreeModel tree)
+ {
+ currentTree = tree;
+ }
+
+ @Override
+ public TreeModel getCurrentTree()
+ {
+ return currentTree;
+ }
}