/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
* Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
*
* This file is part of Jalview.
*
import jalview.bin.JalviewLite;
import jalview.commands.CommandI;
import jalview.datamodel.AlignmentI;
-import jalview.datamodel.Annotation;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
import jalview.datamodel.SearchResults;
import jalview.datamodel.SearchResultsI;
-import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
import jalview.renderer.ResidueShader;
import jalview.schemes.ColourSchemeProperty;
import jalview.schemes.UserColourScheme;
private AnnotationColumnChooser annotationColumnSelectionState;
+ java.awt.Frame nullFrame;
+
+ protected FeatureSettings featureSettings = null;
+
+ private float heightScale = 1, widthScale = 1;
+
public AlignViewport(AlignmentI al, JalviewLite applet)
{
super(al);
if (colour != null)
{
residueShading = new ResidueShader(
- ColourSchemeProperty.getColourScheme(alignment, colour));
+ ColourSchemeProperty.getColourScheme(getAlignment(),
+ colour));
if (residueShading != null)
{
residueShading.setConsensus(hconsensus);
}
}
initAutoAnnotation();
-
}
- java.awt.Frame nullFrame;
-
- protected FeatureSettings featureSettings = null;
-
- private float heightScale = 1, widthScale = 1;
-
/**
* {@inheritDoc}
*/
return normaliseHMMSequenceLogo;
}
-
-
}
private AnnotationColumnChooser annotationColumnSelectionState;
+ boolean validCharWidth;
+
+ public boolean followSelection = true;
+
+ private Hashtable<String, AutoCalcSetting> calcIdParams = new Hashtable<>();
+
/**
* Creates a new AlignViewport object.
*
setFont(new Font(fontName, style, Integer.parseInt(fontSize)), true);
- alignment
- .setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0));
+ AlignmentI al = getAlignment();
+ al.setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0));
// We must set conservation and consensus before setting colour,
// as Blosum and Clustal require this to be done
if (hconsensus == null && !isDataset)
{
- if (!alignment.isNucleotide())
+ if (!al.isNucleotide())
{
showConservation = Cache.getDefault("SHOW_CONSERVATION", true);
showQuality = Cache.getDefault("SHOW_QUALITY", true);
showOccupancy = Cache.getDefault(Preferences.SHOW_OCCUPANCY, true);
}
initAutoAnnotation();
- initInformation();
+ // initInformation();
-
- String colourProperty = alignment.isNucleotide()
+ String colourProperty = al.isNucleotide()
? Preferences.DEFAULT_COLOUR_NUC
: Preferences.DEFAULT_COLOUR_PROT;
String schemeName = Cache.getProperty(colourProperty);
ResidueColourScheme.NONE);
}
ColourSchemeI colourScheme = ColourSchemeProperty
- .getColourScheme(alignment, schemeName);
+ .getColourScheme(al, schemeName);
residueShading = new ResidueShader(colourScheme);
if (colourScheme instanceof UserColourScheme)
}
}
- boolean validCharWidth;
-
/**
* {@inheritDoc}
*/
/*
* replace mappings on our alignment
*/
- if (alignment != null && align != null)
+ if (getAlignment() != null && align != null)
{
- alignment.setCodonFrames(align.getCodonFrames());
+ getAlignment().setCodonFrames(align.getCodonFrames());
}
}
}
else
{
- end = alignment.getWidth();
+ end = getAlignment().getWidth();
}
- viscontigs = alignment.getHiddenColumns().getVisibleContigs(start, end);
+ viscontigs = getAlignment().getHiddenColumns().getVisibleContigs(start,
+ end);
return viscontigs;
}
return false;
}
- public boolean followSelection = true;
-
/**
* @return true if view selection should always follow the selections
* broadcast by other selection sources
for (PDBEntry pdb : pdbEntries)
{
List<SequenceI> choosenSeqs = new ArrayList<>();
- for (SequenceI sq : alignment.getSequences())
+ for (SequenceI sq : getAlignment().getSequences())
{
Vector<PDBEntry> pdbRefEntries = sq.getDatasetSequence()
.getAllPDBEntries();
return validCharWidth;
}
- private Hashtable<String, AutoCalcSetting> calcIdParams = new Hashtable<>();
-
public AutoCalcSetting getCalcIdSettingsFor(String calcId)
{
return calcIdParams.get(calcId);
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 getAlignmentGapAnnotation()
{
- return gapcounts;
+ return occupancy;
}
@Override
strucConsensus = null;
conservation = null;
quality = null;
- groupConsensus = null;
- groupConservation = null;
hconsensus = null;
hconservation = null;
hcomplementConsensus = null;
- gapcounts = null;
+ occupancy = null;
calculator = null;
residueShading = null; // may hold a reference to Consensus
changeSupport = null;
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
initConsensus(consensus);
- initGapCounts();
+ initOccupancy();
initComplementConsensus();
}
// 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);
}
}