'STRAP:multiple sequence alignments '

charite.christo.strap
Class ResidueAnnotation

java.lang.Object
  extended by charite.christo.strap.ResidueAnnotation
All Implemented Interfaces:
ChRunnable, Colored, Disposable, HasImage, HasModiCount, HasName, HasPropertyMap, HasRenderer, HasRendererModiCount, HasWeakRef, HasProtein, ResidueSelection, SelectorOfNucleotides, VisibleIn123

public final class ResidueAnnotation
extends java.lang.Object
implements HasWeakRef, HasName, ResidueSelection, SelectorOfNucleotides, VisibleIn123, Colored, Disposable, HasRendererModiCount, HasImage, HasPropertyMap, ChRunnable, HasModiCount

HELP Residue annotations, allow the assignment of information to specific amino acids or nucleotides of proteins. They are special types of residue selections. A residue annotation has a list of entries each having a type, modifiable text. The user can change these entries and add new entries. Depending on the type, the entries contain different information:

More detailed information is found in ITEM:ResidueAnnotationView A ResidueAnnotation can be created in different ways: Residue annotations which are highlighted in the alignment can be selected in two different ways: By CTRL left-click or by dragging a rectangular box. Selected residue annotations have WIKI:Marching_ants.

Sequence Features: Features like phosporylation sites and active sites are special annotations which are retrieved from a computational service and are therefore not saved to hard disk. Their color cannot be changed.

Background Images

INCLUDE_DOC:ChIcon SEE_DIALOG:DialogResidueAnnotationChanges SEE_DIALOG:DialogResidueAnnotationList SEE_CLASS:ResidueAnnotationView SEE_CLASS:ActivateDeactivate SEE_CLASS:AddAnnotation


Nested Class Summary
static class ResidueAnnotation.Entry
           
 
Field Summary
static java.lang.String ATOMS
           
static java.lang.String BALLOON
           
static java.lang.String BG_IMAGE
           
static java.lang.String COLOR
           
static java.lang.String DISABLED
           
static long ENTRY_NOT_SAVED
           
static java.lang.String GROUP
           
static java.lang.String HYPERREFS
           
static java.lang.String[] MAIN_KEYS
           
static java.lang.String NAME
           
static ResidueAnnotation[] NONE
           
static java.lang.String[] OTHER_KEYS
           
static java.lang.String POS
           
static java.lang.String SPECIFIC_VIEW3D
           
static java.lang.String STYLE
           
static java.lang.String TEXSHADE
           
static java.lang.String VIEW3D
           
 
Fields inherited from interface charite.christo.protein.ResidueSelection
NAME_BACKBONE, NAME_CURSOR, NAME_MOUSE_OVER, NAME_STANDARD
 
Fields inherited from interface charite.christo.protein.VisibleIn123
ANYWHERE, ARROW_HEADS, BIT_SHIFT_LINE, HTML, JALVIEW, NO_FLASH, SB, SEQUENCE, STRUCTURE, STYLE_BACKGROUND, STYLE_CIRCLE, STYLE_CURSOR, STYLE_DOTTED, STYLE_HIDDEN, STYLE_IMAGE, STYLE_IMAGE_LUCID, STYLE_LOWER_HALF_BACKGROUND, STYLE_UNDERLINE, STYLE_UPPER_HALF_BACKGROUND
 
Fields inherited from interface charite.christo.HasRenderer
JLIST, STRIKE_THROUGH
 
Fields inherited from interface charite.christo.ChRunnable
APPEND, COLUMN_TITLE, DOWNLOAD_FINISHED, GET_PANEL, ICON, INTERPRET_LINE, IS_DRAG4XY, ITEM_TEXT, MODIFY_RENDERER_COMPONENT, PROGRESS, REPAINT_CURSOR, SAY_DOWNLOADING, SET_ICON_IMAGE, SET_TREE_VALUE, SHOW_IN_FRAME, TAB_TEXT, TIP_TEXT
 
Constructor Summary
ResidueAnnotation(Protein p)
           
 
Method Summary
 void addE(long options, java.lang.String key, java.lang.String value, boolean isEnabled, int row)
           
 void addE(java.lang.String key0, java.lang.String value)
           
 void addEnS(java.lang.String key0, java.lang.String value)
           
 void dispose()
           
 boolean featureEndsWithAminoName()
           
 java.awt.Color getColor()
           
 java.lang.String getCssClass()
           
 ResidueAnnotation.Entry[] getEntries()
           
 java.lang.String getFeatureName()
           
 javax.swing.ImageIcon getIcon()
           
 java.lang.String getID()
           
 java.awt.Image getImage(java.awt.Component observer)
           
 java.lang.String getName()
          A ResidueAnnotation-object has a name.
 java.util.Map getPropertyMap(boolean create)
           
 Protein getProtein()
          ResidueAnnotation-Objects belong to a certain protein
 java.lang.Object getRenderer(long options, long[] rendOptions)
           
 long getRendererModiCount()
           
 boolean[] getSelectedAminoacids()
           
 int getSelectedAminoacidsOffset()
           
 boolean[] getSelectedNucleotides()
           
 int getSelectedNucleotidesOffset()
          The goal is to reduce the size of the returned boolean array.
 java.lang.CharSequence getSrcText()
           
 int getStyle()
          Rendering style
 java.lang.String getValue(java.lang.String key)
          Return the 1st value with the key.
 int getVisibleWhere()
          e.g.
 java.lang.Object getWeakRef()
           
 long getWhenCreated()
           
 int getWhereFeatureLoadedFrom()
           
 boolean isAmino()
           
 boolean isEnabled()
           
static void loadResidueAnnotation(Protein p, java.io.File file)
           
static java.lang.String mapKey(java.lang.String k)
           
 int modificationCount()
           
 void readFeatureAnnotations()
           
 void removeEntry(ResidueAnnotation.Entry e)
           
 java.lang.Object run(java.lang.String id, java.lang.Object arg)
           
static java.io.File save(Protein p, java.io.File dir)
           
 void setColor(java.awt.Color c)
          sets the color
 void setEnabled(boolean b)
           
 void setEnabled(boolean b, java.lang.String key)
           
 void setFeatureName(java.lang.String name, int featureSrc)
           
 void setProtein(Protein p)
           
 void setRendererText(java.lang.String s)
           
 void setSelectedAminoacids(boolean[] bb, int offset)
          The method body may be kept empty.
 void setSelectedAminoacids(java.lang.String selection)
          e.g.
 void setSelectedNucleotides(java.lang.String selection)
           
 void setSrcText(java.lang.CharSequence t)
           
 void setStyle(int i)
          Rendering style
 void setValue(java.lang.String key, java.lang.CharSequence textValue)
          Adds a new key-value-pair
 void setVisibleWhere(int where)
           
 boolean verifyDropRows(boolean drop, java.lang.String data, int row, java.awt.Point screen)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

POS

public static final java.lang.String POS
See Also:
Constant Field Values

GROUP

public static final java.lang.String GROUP
See Also:
Constant Field Values

ATOMS

public static final java.lang.String ATOMS
See Also:
Constant Field Values

STYLE

public static final java.lang.String STYLE
See Also:
Constant Field Values

TEXSHADE

public static final java.lang.String TEXSHADE

HYPERREFS

public static final java.lang.String HYPERREFS

COLOR

public static final java.lang.String COLOR
See Also:
Constant Field Values

BG_IMAGE

public static final java.lang.String BG_IMAGE
See Also:
Constant Field Values

VIEW3D

public static final java.lang.String VIEW3D
See Also:
Constant Field Values

SPECIFIC_VIEW3D

public static final java.lang.String SPECIFIC_VIEW3D
See Also:
Constant Field Values

DISABLED

public static final java.lang.String DISABLED
See Also:
Constant Field Values

BALLOON

public static final java.lang.String BALLOON
See Also:
Constant Field Values

MAIN_KEYS

public static final java.lang.String[] MAIN_KEYS

OTHER_KEYS

public static final java.lang.String[] OTHER_KEYS

NONE

public static final ResidueAnnotation[] NONE

ENTRY_NOT_SAVED

public static final long ENTRY_NOT_SAVED
See Also:
Constant Field Values
Constructor Detail

ResidueAnnotation

public ResidueAnnotation(Protein p)
Method Detail

getWeakRef

public java.lang.Object getWeakRef()
Specified by:
getWeakRef in interface HasWeakRef

modificationCount

public int modificationCount()
Specified by:
modificationCount in interface HasModiCount

getWhenCreated

public long getWhenCreated()

dispose

public void dispose()
Specified by:
dispose in interface Disposable

getProtein

public Protein getProtein()
ResidueAnnotation-Objects belong to a certain protein

Specified by:
getProtein in interface HasProtein
Specified by:
getProtein in interface ResidueSelection
Specified by:
getProtein in interface SelectorOfNucleotides

setProtein

public void setProtein(Protein p)
Specified by:
setProtein in interface ResidueSelection
Specified by:
setProtein in interface SelectorOfNucleotides

getName

public java.lang.String getName()
A ResidueAnnotation-object has a name.

Specified by:
getName in interface HasName

getID

public java.lang.String getID()

setSelectedAminoacids

public void setSelectedAminoacids(boolean[] bb,
                                  int offset)
Description copied from interface: ResidueSelection
The method body may be kept empty.

Specified by:
setSelectedAminoacids in interface ResidueSelection

setSelectedAminoacids

public void setSelectedAminoacids(java.lang.String selection)
e.g. s.setSelectedAminoacids("3-5");


setSelectedNucleotides

public void setSelectedNucleotides(java.lang.String selection)

getSelectedAminoacidsOffset

public int getSelectedAminoacidsOffset()
Specified by:
getSelectedAminoacidsOffset in interface ResidueSelection
Returns:
A possible offset. For example {true,true} with offset 6 means that that the 6th and 7th residue is selected.

getSelectedAminoacids

public boolean[] getSelectedAminoacids()
Specified by:
getSelectedAminoacids in interface ResidueSelection
Returns:
true for each selected residue.

getSelectedNucleotidesOffset

public int getSelectedNucleotidesOffset()
Description copied from interface: SelectorOfNucleotides
The goal is to reduce the size of the returned boolean array. if e.g. the 100th nt is selected getOffset() can return 99 and getSelectedNucleotides() can return new boolean[]{true}. BitSet would not have been a solution because the following causses OutOfMemoryError: new BitSet().set(1000*1000*1000,true);

Specified by:
getSelectedNucleotidesOffset in interface SelectorOfNucleotides

getSelectedNucleotides

public boolean[] getSelectedNucleotides()
Specified by:
getSelectedNucleotides in interface SelectorOfNucleotides

getStyle

public int getStyle()
Rendering style

Specified by:
getStyle in interface VisibleIn123

setStyle

public void setStyle(int i)
Rendering style

Specified by:
setStyle in interface VisibleIn123

setColor

public void setColor(java.awt.Color c)
sets the color

Specified by:
setColor in interface Colored

getColor

public java.awt.Color getColor()
Specified by:
getColor in interface Colored
Specified by:
getColor in interface VisibleIn123

getVisibleWhere

public int getVisibleWhere()
Description copied from interface: VisibleIn123
e.g. STRUCTURE | SEQUENCE means visible in 3d and 1d

Specified by:
getVisibleWhere in interface VisibleIn123

setVisibleWhere

public void setVisibleWhere(int where)
Specified by:
setVisibleWhere in interface VisibleIn123

getImage

public java.awt.Image getImage(java.awt.Component observer)
Specified by:
getImage in interface HasImage

run

public java.lang.Object run(java.lang.String id,
                            java.lang.Object arg)
Specified by:
run in interface ChRunnable

getIcon

public javax.swing.ImageIcon getIcon()

setRendererText

public void setRendererText(java.lang.String s)

getRenderer

public java.lang.Object getRenderer(long options,
                                    long[] rendOptions)
Specified by:
getRenderer in interface HasRenderer

getRendererModiCount

public long getRendererModiCount()
Specified by:
getRendererModiCount in interface HasRendererModiCount

getValue

public java.lang.String getValue(java.lang.String key)
Return the 1st value with the key.


isAmino

public boolean isAmino()

setValue

public void setValue(java.lang.String key,
                     java.lang.CharSequence textValue)
Adds a new key-value-pair


setEnabled

public void setEnabled(boolean b)

setEnabled

public void setEnabled(boolean b,
                       java.lang.String key)

getEntries

public ResidueAnnotation.Entry[] getEntries()

removeEntry

public void removeEntry(ResidueAnnotation.Entry e)

addE

public void addE(java.lang.String key0,
                 java.lang.String value)

addEnS

public void addEnS(java.lang.String key0,
                   java.lang.String value)

addE

public void addE(long options,
                 java.lang.String key,
                 java.lang.String value,
                 boolean isEnabled,
                 int row)

isEnabled

public boolean isEnabled()

loadResidueAnnotation

public static void loadResidueAnnotation(Protein p,
                                         java.io.File file)

save

public static java.io.File save(Protein p,
                                java.io.File dir)

getPropertyMap

public java.util.Map getPropertyMap(boolean create)
Specified by:
getPropertyMap in interface HasPropertyMap

readFeatureAnnotations

public void readFeatureAnnotations()

setFeatureName

public void setFeatureName(java.lang.String name,
                           int featureSrc)

getFeatureName

public java.lang.String getFeatureName()

getWhereFeatureLoadedFrom

public int getWhereFeatureLoadedFrom()

getCssClass

public java.lang.String getCssClass()

getSrcText

public java.lang.CharSequence getSrcText()

setSrcText

public void setSrcText(java.lang.CharSequence t)

featureEndsWithAminoName

public boolean featureEndsWithAminoName()

verifyDropRows

public boolean verifyDropRows(boolean drop,
                              java.lang.String data,
                              int row,
                              java.awt.Point screen)

mapKey

public static java.lang.String mapKey(java.lang.String k)

'STRAP:multiple sequence alignments '

'The most important classes are StrapAlign, Protein and StrapEvent.'