com.compomics.util.gui.spectrum
Class SpectrumPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.compomics.util.gui.spectrum.GraphicsPanel
                      extended by com.compomics.util.gui.spectrum.SpectrumPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class SpectrumPanel
extends GraphicsPanel

This class presents a JPanel that will hold and display a mass spectrum in centroid or profile mode.

Version:
$Id: SpectrumPanel.java,v 1.9 2009/08/17 15:15:28 lennart Exp $
Author:
Lennart Martens, Harald Barsnes
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.compomics.util.gui.spectrum.GraphicsPanel
GraphicsPanel.DrawingStyle, GraphicsPanel.GraphicsPanelType
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class com.compomics.util.gui.spectrum.GraphicsPanel
alphaLevel, ANNOTATED_STATUS, currentGraphicsPanelType, currentPadding, dataSetCounter, dataSetCounterMirroredSpectra, deltaMassWindow, iAnnotations, iAnnotationYAxisThreshold, iAreaUnderCurveColor, iAreaUnderCurveColorMirroredSpectra, iClicked, iClickedDataSetIndex, iClickedIndex, iClickedList, iClickedListDatasetIndices, iCurrentDrawStyle, iDataPointAndLineColor, iDataPointAndLineColorMirroredSpectra, iDotRadius, iDragged, iDragXLoc, iEndXLoc, iFilename, iFilenameColor, iFilenameMirrorredSpectrum, iHighLight, iHighLightDatasetIndex, iHighLightIndex, iKnownMassDeltas, iMinDrag, iMSLevel, INTERACTIVE_STATUS, iPointDetectionTolerance, iPointSize, iPrecursorCharge, iPrecursorChargeMirorredSpectrum, iPrecursorMZ, iPrecursorMZMirroredSpectrum, iSpecPanelListeners, iStartXLoc, iStartYLoc, iStoredSequence, iStoredSequenceDatasetIndices, iTopPadding, iXAxisData, iXAxisDataInPixels, iXAxisDataInPixelsMirroredSpectrum, iXAxisDataMirroredSpectrum, iXAxisLabel, iXAxisMax, iXAxisMin, iXAxisStartAtZero, iXPadding, iXScaleUnit, iXUnit, iYAxisData, iYAxisDataInPixels, iYAxisDataInPixelsMirroredSpectrum, iYAxisDataMirroredSpectrum, iYAxisLabel, iYAxisMax, iYAxisMin, iYScaleUnit, iYUnit, maxPadding, miniature, padding, showAllPeaks, showFileName, showPrecursorDetails, showResolution, xAxisZoomRangeLowerValue, xAxisZoomRangeUpperValue, xTagCount, yAxisZoomExcludesBackgroundPeaks, yDataIsPositive, yTagCount
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName)
          This constructor creates a SpectrumPanel based on the passed parameters.
SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, boolean aShowFileName)
          This constructor creates a SpectrumPanel based on the passed parameters.
SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, int aMaxPadding, boolean aShowFileName)
          This constructor creates a SpectrumPanel based on the passed parameters.
SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution)
          This constructor creates a SpectrumPanel based on the passed parameters.
SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution, int aMSLevel)
          This constructor creates a SpectrumPanel based on the passed parameters.
SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution, int aMSLevel, boolean aProfileMode)
          This constructor creates a SpectrumPanel based on the passed parameters.
SpectrumPanel(SpectrumFile aSpecFile)
          This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile as an interactive lines plot.
SpectrumPanel(SpectrumFile aSpecFile, boolean aEnableInteraction)
          This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile as a line plot.
SpectrumPanel(SpectrumFile aSpecFile, GraphicsPanel.DrawingStyle aDrawStyle, boolean aEnableInteraction)
          This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.
SpectrumPanel(SpectrumFile aSpecFile, GraphicsPanel.DrawingStyle aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor)
          This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.
SpectrumPanel(SpectrumFile aSpecFile, GraphicsPanel.DrawingStyle aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor, int aMaxPadding, boolean aShowFileName)
          This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.
SpectrumPanel(SpectrumFile aSpecFile, GraphicsPanel.DrawingStyle aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution)
          This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.
SpectrumPanel(SpectrumFile aSpecFile, GraphicsPanel.DrawingStyle aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution, int aMSLevel)
          This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.
SpectrumPanel(SpectrumFile aSpecFile, GraphicsPanel.DrawingStyle aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution, int aMSLevel, boolean aProfileMode)
          This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.
 
Method Summary
 void addAdditionalDataset(double[] aXAxisData, double[] aYAxisData, Color dataPointAndLineColor, Color areaUnderCurveColor)
          Adds an additional spectrum dataset to be displayed in the same Spectrum Panel.
 void addAdditionalMirroredDataset(double[] aXAxisData, double[] aYAxisData, Color dataPointAndLineColor, Color areaUnderCurveColor)
          Adds an additional mirrored spectrum dataset to be displayed in the same Spectrum Panel.
 void addAutomaticDeNovoSequencing(Peptide currentPeptide, ArrayList<IonMatch> annotations, int aForwardIon, int aReverseIon, int aDeNovoCharge, boolean showForwardTags, boolean showReverseTags)
          Add reference areas annotating the de novo tags, using default percent height of 0.9 for the forward ions and 1.0 for the reverse ions default alpha levels of 0.2.
 void addAutomaticDeNovoSequencing(Peptide currentPeptide, ArrayList<IonMatch> annotations, int aForwardIon, int aReverseIon, int aDeNovoCharge, boolean showForwardTags, boolean showReverseTags, double forwardIonPercentHeight, double reverseIonPercentHeight)
          Add reference areas annotating the de novo tags, using default alpha levels of 0.2.
 void addAutomaticDeNovoSequencing(Peptide currentPeptide, ArrayList<IonMatch> annotations, int aForwardIon, int aReverseIon, int aDeNovoCharge, boolean showForwardTags, boolean showReverseTags, double forwardIonPercentHeight, double reverseIonPercentHeight, boolean excludeFixedPtms)
          Add reference areas annotating the de novo tags, using default alpha levels of 0.2.
 void addAutomaticDeNovoSequencing(Peptide currentPeptide, ArrayList<IonMatch> annotations, int aForwardIon, int aReverseIon, int aDeNovoCharge, boolean showForwardTags, boolean showReverseTags, double forwardIonPercentHeight, double reverseIonPercentHeight, float forwardIonAlphaLevel, float reverseIonAlphaLevel, boolean excludeFixedPtms)
          Add reference areas annotating the de novo tags.
 void addMirroredSpectrum(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, boolean aProfileMode, Color aSpectrumPeakColor, Color aSpectrumProfileModeLineColor)
          Add a mirrored spectrum (or chromatogram).
static Color determineColorOfPeak(String peakLabel)
          Deprecated. it is advised to use methods based on the ion type rather than on the peak label
static Color determineDefaultFragmentIonColor(Ion ion, boolean isSpectrum)
          Returns the peak color to be used for the given peak label.
static Color determineFragmentIonColor(Ion ion, boolean isSpectrum)
          Returns the peak color to be used for the given peak label according to the color map.
static Color determineFragmentIonColor(String seriesLabel)
          Deprecated. use the method based on the Ion class instead
static Vector<DefaultSpectrumAnnotation> filterAnnotations(Vector<DefaultSpectrumAnnotation> annotations, HashMap<Ion.IonType,ArrayList<Integer>> iontypes, ArrayList<NeutralLoss> neutralLosses, boolean singleChargeSelected, boolean doubleChargeSelected, boolean moreThanTwoChargesSelected)
          Deprecated. don't use method based on the peak labels but on the data type
static void setIonColor(Ion ion, Color color)
          Sets an annotation color for the given ion.
 void setProfileMode(boolean aProfileMode)
          Change the drawing type of the spectrum.
 void setSpectrumFile(SpectrumFile aSpecFile)
          This method initializes a SpectrumPanel based on the spectrum information in the specified SpectrumFile.
 void setSpectrumPeakColor(Color aSpectrumPeakColor)
          Set the default spectrum peak color.
 void setSpectrumProfileModeLineColor(Color aSpectrumProfileModeLineColor)
          Set the default spectrum profile mode color.
 void showAnnotatedPeaksOnly(boolean aAnnotatedPeaks)
          If true only the annotated peaks will be drawn.
 
Methods inherited from class com.compomics.util.gui.spectrum.GraphicsPanel
addListeners, addReferenceAreaXAxis, addReferenceAreaYAxis, addSpectrumPanelListener, annotate, drawAxes, drawFilledPolygon, drawMeasurementLine, drawMirroredPeaks, drawPeaks, drawXAxisReferenceAreas, drawXTags, drawYAxisReferenceAreas, drawYTags, dropDottedLine, findDeltaMassMatches, getAllReferenceAreasXAxis, getAllReferenceAreasYAxis, getAlphaLevel, getAreaUnderCurveColors, getBackgroundPeakWidth, getDeltaMassWindow, getKnownMassDeltas, getMaxPadding, getMaxXAxisValue, getMinXAxisValue, getPeakWaterMarkColor, getPeakWidth, getXAxisData, getXAxisZoomRangeLowerValue, getXAxisZoomRangeUpperValue, getYAxisData, highLight, highlightClicked, highLightPeak, isMiniature, isSubscriptAnnotationNumbers, paint, processMirroredXAndYData, processXAndYData, removeAllReferenceAreasXAxis, removeAllReferenceAreasYAxis, removeReferenceAreaXAxis, removeReferenceAreaYAxis, rescale, rescale, setAlphaLevel, setAnnotations, setAnnotationYAxisThreshold, setAreaUnderCurveColor, setBackgroundPeakWidth, setDataPointAndLineColor, setDeltaMassWindow, setFilenameColor, setKnownMassDeltas, setMaxPadding, setMiniature, setPeakWaterMarkColor, setPeakWidth, setScientificXAxis, setScientificXAxis, setScientificYAxis, setScientificYAxis, setShowPrecursorDetails, setShowResolution, setSubscriptAnnotationNumbers, setUseMassDeltaCombinations, setXAxisStartAtZero, setYAxisZoomExcludesBackgroundPeaks, setYDataIsPositive, showPrecursorDetails, showResolution, useMassDeltaCombinations, yAxisZoomOnlyExcludesBackgroundPeaks, yDataIsPositive
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpectrumPanel

public SpectrumPanel(SpectrumFile aSpecFile)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile as an interactive lines plot.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.

SpectrumPanel

public SpectrumPanel(SpectrumFile aSpecFile,
                     boolean aEnableInteraction)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile as a line plot.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.
aEnableInteraction - boolean that specifies whether user-derived events should be caught and dealt with.

SpectrumPanel

public SpectrumPanel(SpectrumFile aSpecFile,
                     GraphicsPanel.DrawingStyle aDrawStyle,
                     boolean aEnableInteraction)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.
aDrawStyle - the drawing style to use.
aEnableInteraction - boolean that specifies whether user-derived events should be caught and dealt with.

SpectrumPanel

public SpectrumPanel(SpectrumFile aSpecFile,
                     GraphicsPanel.DrawingStyle aDrawStyle,
                     boolean aEnableInteraction,
                     Color aSpectrumFilenameColor)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.
aDrawStyle - the drawing style to use.
aEnableInteraction - boolean that specifies whether user-derived events should be caught and dealt with.
aSpectrumFilenameColor - Color with the color for the spectrumfilename on the panel can be 'null' for default coloring.

SpectrumPanel

public SpectrumPanel(SpectrumFile aSpecFile,
                     GraphicsPanel.DrawingStyle aDrawStyle,
                     boolean aEnableInteraction,
                     Color aSpectrumFilenameColor,
                     int aMaxPadding,
                     boolean aShowFileName)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.
aDrawStyle - the drawing style to use.
aEnableInteraction - boolean that specifies whether user-derived events should be caught and dealt with.
aSpectrumFilenameColor - Color with the color for the spectrumfilename on the panel can be 'null' for default coloring.
aMaxPadding - int the sets the maximum padding size.
aShowFileName - boolean that specifies if the file name should be shown in the panel

SpectrumPanel

public SpectrumPanel(SpectrumFile aSpecFile,
                     GraphicsPanel.DrawingStyle aDrawStyle,
                     boolean aEnableInteraction,
                     Color aSpectrumFilenameColor,
                     int aMaxPadding,
                     boolean aShowFileName,
                     boolean aShowPrecursorDetails,
                     boolean aShowResolution)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.
aDrawStyle - the drawing style to use.
aEnableInteraction - boolean that specifies whether user-derived events should be caught and dealt with.
aSpectrumFilenameColor - Color with the color for the spectrumfilename on the panel can be 'null' for default coloring.
aMaxPadding - int the sets the maximum padding size.
aShowFileName - boolean that specifies if the file name should be shown in the panel
aShowPrecursorDetails - boolean that specifies if the precursor details should be shown in the panel
aShowResolution - boolean that specifies if the resolution should be shown in the panel

SpectrumPanel

public SpectrumPanel(SpectrumFile aSpecFile,
                     GraphicsPanel.DrawingStyle aDrawStyle,
                     boolean aEnableInteraction,
                     Color aSpectrumFilenameColor,
                     int aMaxPadding,
                     boolean aShowFileName,
                     boolean aShowPrecursorDetails,
                     boolean aShowResolution,
                     int aMSLevel)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.
aDrawStyle - the drawing style to use.
aEnableInteraction - boolean that specifies whether user-derived events should be caught and dealt with.
aSpectrumFilenameColor - Color with the color for the spectrumfilename on the panel can be 'null' for default coloring.
aMaxPadding - int the sets the maximum padding size.
aShowFileName - boolean that specifies if the file name should be shown in the panel
aShowPrecursorDetails - boolean that specifies if the precursor details should be shown in the panel
aShowResolution - boolean that specifies if the resolution should be shown in the panel
aMSLevel - int with the ms level for the spectrum

SpectrumPanel

public SpectrumPanel(SpectrumFile aSpecFile,
                     GraphicsPanel.DrawingStyle aDrawStyle,
                     boolean aEnableInteraction,
                     Color aSpectrumFilenameColor,
                     int aMaxPadding,
                     boolean aShowFileName,
                     boolean aShowPrecursorDetails,
                     boolean aShowResolution,
                     int aMSLevel,
                     boolean aProfileMode)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.
aDrawStyle - the drawing style to use.
aEnableInteraction - boolean that specifies whether user-derived events should be caught and dealt with.
aSpectrumFilenameColor - Color with the color for the spectrumfilename on the panel can be 'null' for default coloring.
aMaxPadding - int the sets the maximum padding size.
aShowFileName - boolean that specifies if the file name should be shown in the panel
aShowPrecursorDetails - boolean that specifies if the precursor details should be shown in the panel
aShowResolution - boolean that specifies if the resolution should be shown in the panel
aMSLevel - int with the ms level for the spectrum, set to 0 if ms level is unknown
aProfileMode - boolean if set to true the spectrum will be drawn in profile mode

SpectrumPanel

public SpectrumPanel(double[] aXAxisData,
                     double[] aYAxisData,
                     double aPrecursorMZ,
                     String aPrecursorCharge,
                     String aFileName)
This constructor creates a SpectrumPanel based on the passed parameters. This constructor will be used to annotate matched ions on the spectrum panels.

Parameters:
aXAxisData - double[] with all the x-axis values.
aYAxisData - double[] with all the y-axis values.
aPrecursorMZ - double with the precursor mass.
aPrecursorCharge - String with the precursor intensity.
aFileName - String with the title of the Query.

SpectrumPanel

public SpectrumPanel(double[] aXAxisData,
                     double[] aYAxisData,
                     double aPrecursorMZ,
                     String aPrecursorCharge,
                     String aFileName,
                     boolean aShowFileName)
This constructor creates a SpectrumPanel based on the passed parameters. This constructor will be used to annotate matched ions on the spectrum panels.

Parameters:
aXAxisData - double[] with all the x-axis values.
aYAxisData - double[] with all the y-axis values.
aPrecursorMZ - double with the precursor mass.
aPrecursorCharge - String with the precursor intensity.
aFileName - String with the title of the Query.
aShowFileName - boolean that specifies if the file name should be shown in the panel.

SpectrumPanel

public SpectrumPanel(double[] aXAxisData,
                     double[] aYAxisData,
                     double aPrecursorMZ,
                     String aPrecursorCharge,
                     String aFileName,
                     int aMaxPadding,
                     boolean aShowFileName)
This constructor creates a SpectrumPanel based on the passed parameters. This constructor will be used to annotate matched ions on the spectrum panels.

Parameters:
aXAxisData - double[] with all the x-axis values.
aYAxisData - double[] with all the y-axis values.
aPrecursorMZ - double with the precursor mass.
aPrecursorCharge - String with the precursor intensity.
aFileName - String with the title of the Query.
aMaxPadding - int the sets the maximum padding size.
aShowFileName - boolean that specifies if the file name should be shown in the panel.

SpectrumPanel

public SpectrumPanel(double[] aXAxisData,
                     double[] aYAxisData,
                     double aPrecursorMZ,
                     String aPrecursorCharge,
                     String aFileName,
                     int aMaxPadding,
                     boolean aShowFileName,
                     boolean aShowPrecursorDetails,
                     boolean aShowResolution)
This constructor creates a SpectrumPanel based on the passed parameters. This constructor will be used to annotate matched ions on the spectrum panels.

Parameters:
aXAxisData - double[] with all the x-axis values.
aYAxisData - double[] with all the y-axis values.
aPrecursorMZ - double with the precursor mass.
aPrecursorCharge - String with the precursor intensity.
aFileName - String with the title of the Query.
aMaxPadding - int the sets the maximum padding size.
aShowFileName - boolean that specifies if the file name should be shown in the panel
aShowPrecursorDetails - boolean that specifies if the precursor details should be shown in the panel
aShowResolution - boolean that specifies if the resolution should be shown in the panel

SpectrumPanel

public SpectrumPanel(double[] aXAxisData,
                     double[] aYAxisData,
                     double aPrecursorMZ,
                     String aPrecursorCharge,
                     String aFileName,
                     int aMaxPadding,
                     boolean aShowFileName,
                     boolean aShowPrecursorDetails,
                     boolean aShowResolution,
                     int aMSLevel)
This constructor creates a SpectrumPanel based on the passed parameters. This constructor will be used to annotate matched ions on the spectrum panels.

Parameters:
aXAxisData - double[] with all the x-axis values.
aYAxisData - double[] with all the y-axis values.
aPrecursorMZ - double with the precursor mass.
aPrecursorCharge - String with the precursor intensity.
aFileName - String with the title of the Query.
aMaxPadding - int the sets the maximum padding size.
aShowFileName - boolean that specifies if the file name should be shown in the panel
aShowPrecursorDetails - boolean that specifies if the precursor details should be shown in the panel
aShowResolution - boolean that specifies if the resolution should be shown in the panel
aMSLevel - int with the ms level for the spectrum, set to 0 if ms level is unknown

SpectrumPanel

public SpectrumPanel(double[] aXAxisData,
                     double[] aYAxisData,
                     double aPrecursorMZ,
                     String aPrecursorCharge,
                     String aFileName,
                     int aMaxPadding,
                     boolean aShowFileName,
                     boolean aShowPrecursorDetails,
                     boolean aShowResolution,
                     int aMSLevel,
                     boolean aProfileMode)
This constructor creates a SpectrumPanel based on the passed parameters. This constructor will be used to annotate matched ions on the spectrum panels.

Parameters:
aXAxisData - double[] with all the x-axis values.
aYAxisData - double[] with all the y-axis values.
aPrecursorMZ - double with the precursor mass.
aPrecursorCharge - String with the precursor charge.
aFileName - String with the title of the Query.
aMaxPadding - int the sets the maximum padding size.
aShowFileName - boolean that specifies if the file name should be shown in the panel
aShowPrecursorDetails - boolean that specifies if the precursor details should be shown in the panel
aShowResolution - boolean that specifies if the resolution should be shown in the panel
aMSLevel - int with the ms level for the spectrum, set to 0 if ms level is unknown
aProfileMode - boolean if set to true the spectrum will be drawn in profile mode
Method Detail

addMirroredSpectrum

public void addMirroredSpectrum(double[] aXAxisData,
                                double[] aYAxisData,
                                double aPrecursorMZ,
                                String aPrecursorCharge,
                                String aFileName,
                                boolean aProfileMode,
                                Color aSpectrumPeakColor,
                                Color aSpectrumProfileModeLineColor)
Add a mirrored spectrum (or chromatogram).

Parameters:
aXAxisData -
aYAxisData -
aPrecursorMZ -
aPrecursorCharge -
aFileName -
aProfileMode -
aSpectrumPeakColor -
aSpectrumProfileModeLineColor -

addAdditionalDataset

public void addAdditionalDataset(double[] aXAxisData,
                                 double[] aYAxisData,
                                 Color dataPointAndLineColor,
                                 Color areaUnderCurveColor)
Adds an additional spectrum dataset to be displayed in the same Spectrum Panel. Remember to use different colors for the different datasets.

Parameters:
aXAxisData - double[] with all the x-axis values.
aYAxisData - double[] with all the y-axis values
dataPointAndLineColor - the color to use for the data points and lines
areaUnderCurveColor - the color to use for the area under the curve

addAdditionalMirroredDataset

public void addAdditionalMirroredDataset(double[] aXAxisData,
                                         double[] aYAxisData,
                                         Color dataPointAndLineColor,
                                         Color areaUnderCurveColor)
Adds an additional mirrored spectrum dataset to be displayed in the same Spectrum Panel. Remember to use different colors for the different datasets.

Parameters:
aXAxisData - double[] with all the x-axis values.
aYAxisData - double[] with all the y-axis values
dataPointAndLineColor - the color to use for the data points and lines
areaUnderCurveColor - the color to use for the area under the curve

setProfileMode

public void setProfileMode(boolean aProfileMode)
Change the drawing type of the spectrum. Profile or centroid mode.

Parameters:
aProfileMode - if true, the spectrum is drawn in profile mode

setSpectrumPeakColor

public void setSpectrumPeakColor(Color aSpectrumPeakColor)
Set the default spectrum peak color. (Note that this only has an impact on the first spectrum added. For additional spectra or mirrored spectra set the color in the given constructor.)

Parameters:
aSpectrumPeakColor - the color to set

setSpectrumProfileModeLineColor

public void setSpectrumProfileModeLineColor(Color aSpectrumProfileModeLineColor)
Set the default spectrum profile mode color. (Note that this only has an impact on the first spectrum added. For additional spectra or mirrored spectra set the color in the given constructor.)

Parameters:
aSpectrumProfileModeLineColor - the color to set

showAnnotatedPeaksOnly

public void showAnnotatedPeaksOnly(boolean aAnnotatedPeaks)
If true only the annotated peaks will be drawn. The default value is false, and result in all peaks being drawn. Note that this setting is ignored when in profile mode!

Parameters:
aAnnotatedPeaks - if true only the annotated peaks will be drawn

setSpectrumFile

public void setSpectrumFile(SpectrumFile aSpecFile)
This method initializes a SpectrumPanel based on the spectrum information in the specified SpectrumFile.

Parameters:
aSpecFile - SpectrumFile with the information about masses and intensities that will be copied here. Note that mass-sorting will take place in this step as well.

determineColorOfPeak

public static Color determineColorOfPeak(String peakLabel)
Deprecated. it is advised to use methods based on the ion type rather than on the peak label

Returns the peak color to be used for the given peak label. The colors used are based on the color coding used in MascotDatfile.

Parameters:
peakLabel -
Returns:
the peak color

filterAnnotations

public static Vector<DefaultSpectrumAnnotation> filterAnnotations(Vector<DefaultSpectrumAnnotation> annotations,
                                                                  HashMap<Ion.IonType,ArrayList<Integer>> iontypes,
                                                                  ArrayList<NeutralLoss> neutralLosses,
                                                                  boolean singleChargeSelected,
                                                                  boolean doubleChargeSelected,
                                                                  boolean moreThanTwoChargesSelected)
Deprecated. don't use method based on the peak labels but on the data type

Filters the annotations and returns the annotations matching the currently selected types.

Parameters:
annotations - the annotations to be filtered, the annotations are assumed to have the following form: ion type + [ion number] + [charge] + [neutral loss]
iontypes - the fragment ion types to include, assumed to be one of the Ion types, e.g, IonType.PeptideFragmentIon > PeptideFragmentIon.B_ION
neutralLosses - list of neutral losses to display
singleChargeSelected - if singly charged fragments are to be included
doubleChargeSelected - if double charged fragments are to be included
moreThanTwoChargesSelected - if fragments with more than two charges are to be included
Returns:
the filtered annotations

setIonColor

public static void setIonColor(Ion ion,
                               Color color)
Sets an annotation color for the given ion.

Parameters:
ion - the ion
color - the new color

determineFragmentIonColor

public static Color determineFragmentIonColor(Ion ion,
                                              boolean isSpectrum)
Returns the peak color to be used for the given peak label according to the color map. If not implemented returns the default color.

Parameters:
ion - the ion
isSpectrum - if true, the special spectrum color is used for the y-ion
Returns:
the peak color

determineDefaultFragmentIonColor

public static Color determineDefaultFragmentIonColor(Ion ion,
                                                     boolean isSpectrum)
Returns the peak color to be used for the given peak label. The colors used are based on the color coding used in MascotDatfile.

Parameters:
ion - the ion
isSpectrum - if true, the special spectrum color is used for the y-ion
Returns:
the peak color

determineFragmentIonColor

public static Color determineFragmentIonColor(String seriesLabel)
Deprecated. use the method based on the Ion class instead

Returns the color to use for the given fragment ion label.

Parameters:
seriesLabel - the series label
Returns:
the fragment ion color

addAutomaticDeNovoSequencing

public void addAutomaticDeNovoSequencing(Peptide currentPeptide,
                                         ArrayList<IonMatch> annotations,
                                         int aForwardIon,
                                         int aReverseIon,
                                         int aDeNovoCharge,
                                         boolean showForwardTags,
                                         boolean showReverseTags)
Add reference areas annotating the de novo tags, using default percent height of 0.9 for the forward ions and 1.0 for the reverse ions default alpha levels of 0.2. Fixed PTMs are not annotated.

Parameters:
currentPeptide - the current peptide sequence
annotations - the current fragment ion annotations
aForwardIon - the forward de novo sequencing fragment ion type, i.e., PeptideFragmentIon.A_ION, PeptideFragmentIon.B_ION or PeptideFragmentIon.C_ION
aReverseIon - the reverse de novo sequencing fragment ion type, i.e., PeptideFragmentIon.X_ION, PeptideFragmentIon.Y_ION or PeptideFragmentIon.Z_ION
aDeNovoCharge - the de novo sequencing charge
showForwardTags - if true, the forward de novo sequencing tags are displayed
showReverseTags - if true, the reverse de novo sequencing tags are displayed

addAutomaticDeNovoSequencing

public void addAutomaticDeNovoSequencing(Peptide currentPeptide,
                                         ArrayList<IonMatch> annotations,
                                         int aForwardIon,
                                         int aReverseIon,
                                         int aDeNovoCharge,
                                         boolean showForwardTags,
                                         boolean showReverseTags,
                                         double forwardIonPercentHeight,
                                         double reverseIonPercentHeight)
Add reference areas annotating the de novo tags, using default alpha levels of 0.2. Fixed PTMs are not annotated.

Parameters:
currentPeptide - the current peptide sequence
annotations - the current fragment ion annotations
aForwardIon - the forward de novo sequencing fragment ion type, i.e., PeptideFragmentIon.A_ION, PeptideFragmentIon.B_ION or PeptideFragmentIon.C_ION
aReverseIon - the reverse de novo sequencing fragment ion type, i.e., PeptideFragmentIon.X_ION, PeptideFragmentIon.Y_ION or PeptideFragmentIon.Z_ION
aDeNovoCharge - the de novo sequencing charge
showForwardTags - if true, the forward de novo sequencing tags are displayed
showReverseTags - if true, the reverse de novo sequencing tags are displayed
forwardIonPercentHeight - the percent height of the forward ion annotation [0-1]
reverseIonPercentHeight - the percent height of the reverse ion annotation [0-1]

addAutomaticDeNovoSequencing

public void addAutomaticDeNovoSequencing(Peptide currentPeptide,
                                         ArrayList<IonMatch> annotations,
                                         int aForwardIon,
                                         int aReverseIon,
                                         int aDeNovoCharge,
                                         boolean showForwardTags,
                                         boolean showReverseTags,
                                         double forwardIonPercentHeight,
                                         double reverseIonPercentHeight,
                                         boolean excludeFixedPtms)
Add reference areas annotating the de novo tags, using default alpha levels of 0.2.

Parameters:
currentPeptide - the current peptide sequence
annotations - the current fragment ion annotations
aForwardIon - the forward de novo sequencing fragment ion type, i.e., PeptideFragmentIon.A_ION, PeptideFragmentIon.B_ION or PeptideFragmentIon.C_ION
aReverseIon - the reverse de novo sequencing fragment ion type, i.e., PeptideFragmentIon.X_ION, PeptideFragmentIon.Y_ION or PeptideFragmentIon.Z_ION
aDeNovoCharge - the de novo sequencing charge
showForwardTags - if true, the forward de novo sequencing tags are displayed
showReverseTags - if true, the reverse de novo sequencing tags are displayed
forwardIonPercentHeight - the percent height of the forward ion annotation [0-1]
reverseIonPercentHeight - the percent height of the reverse ion annotation [0-1]
excludeFixedPtms - are fixed PTMs to be annotated?

addAutomaticDeNovoSequencing

public void addAutomaticDeNovoSequencing(Peptide currentPeptide,
                                         ArrayList<IonMatch> annotations,
                                         int aForwardIon,
                                         int aReverseIon,
                                         int aDeNovoCharge,
                                         boolean showForwardTags,
                                         boolean showReverseTags,
                                         double forwardIonPercentHeight,
                                         double reverseIonPercentHeight,
                                         float forwardIonAlphaLevel,
                                         float reverseIonAlphaLevel,
                                         boolean excludeFixedPtms)
Add reference areas annotating the de novo tags.

Parameters:
currentPeptide - the current peptide sequence
annotations - the current fragment ion annotations
aForwardIon - the forward de novo sequencing fragment ion type, i.e., PeptideFragmentIon.A_ION, PeptideFragmentIon.B_ION or PeptideFragmentIon.C_ION
aReverseIon - the reverse de novo sequencing fragment ion type, i.e., PeptideFragmentIon.X_ION, PeptideFragmentIon.Y_ION or PeptideFragmentIon.Z_ION
aDeNovoCharge - the de novo sequencing charge
showForwardTags - if true, the forward de novo sequencing tags are displayed
showReverseTags - if true, the reverse de novo sequencing tags are displayed
forwardIonPercentHeight - the percent height of the forward ion annotation [0-1]
reverseIonPercentHeight - the percent height of the reverse ion annotation [0-1]
forwardIonAlphaLevel - alpha level of the forward ions
reverseIonAlphaLevel - alpha level of the reverse ions
excludeFixedPtms - are fixed PTMs to be annotated?


Copyright © 2013. All Rights Reserved.