|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectapollo.editor.AnnotationEditor
public class AnnotationEditor
A class for performing edits on the annotations.
How to use the editor:
Using the AnnotationEditor is a two step process:
1. call setSelections with the current selections.
2. call the method for the edit you want.
How it works:
setSelections creates a group of SelectionSets. These contain the
data selected by the Selection and the data selected under the
cursor. Some processing is done on the basic selected features to
allow easy access to the true (non Drawable) features, the Transcripts,
and the Genes in the selection. The data selected by the Selection is
also divided into subsets containing the data from the AnnotationView
and the data from the ResultView.
The AnnotationEditor marks the selections as used at the end of
each of the edit methods. If you try to use the same selections
again a warning is given.
The edit methods are all overloaded, with a no arguments version
which uses the default selections. This feeds the correct data
to the method with arguments which actually does the edit. This
method could be called directly because it does not use the
SelectionSets for anything (except the endEdit).
Some of the methods do use the dfset to get the top annotations.
The edit methods do the edits by modifying the real features and
firing AnnotationChangeEvents to the Controller listeners
implementing the AnnotationChangeListener interface.
Important notes about editting:
1. If you edit an ExonI this may affect multiple Transcripts.
2. Because of 1 setting limits means regenerating all transcript
feature set limits in ALL cases (even internal ExonIs in one
transcript could be terminal ExonIs in
another).
3. Watch the order you do the edit and the fire especially for deletes.
4. Genes are automatically deleted when they run out of Transcripts.
5. If you write new edits think if you need to do a consolidateGenes,
splitGenes or updateGenes.
6. adjustEdges calls often help. There is no automatic propogation of
limit changes in the Annotation tree.
Currently There is one AnnotationEditor for each strand/AnnotView. Im wondering if
this could be ammended so theres one AnnotationEditor for both strands.
AnnotationEditor has been moved from gui to editor. Its still rather tangled with the
gui, which should be untangled eventually.
This class is too big and unwieldy - its 4000 lines! needs to be broken up somehow
| Nested Class Summary | |
|---|---|
class |
AnnotationEditor.FeatChangeData
Helper class for keeping track of changed top level annots |
| Field Summary |
|---|
| Fields inherited from interface apollo.gui.drawable.DrawableAnnotationConstants |
|---|
ALLSTOPS, BOTHENDS, END, NOSTOPS, ONESTOP, START |
| Constructor Summary | |
|---|---|
AnnotationEditor(GuiCurationState curationState,
FeatureSetI annotationCollection)
The AnnotationEditor constructor. |
|
| Method Summary | |
|---|---|
void |
addAnnot(java.util.Vector features,
boolean mergeOverlapping)
This method is a complete edit for adding a new gene. |
void |
addAnnotation(java.util.Vector features,
boolean mergeOverlapping,
java.lang.String type)
|
void |
addEvidenceExons()
The default method to add evidence to exons. |
boolean |
addEvidenceExonsAllowed()
Determine if the current selection sets are compatible with the the default adding evidence to exons method. |
void |
addExons()
The default addExons which adds exons to a transcript. |
void |
addExons(Transcript trans,
java.util.Vector features)
The version of addExons which actually does the work. |
boolean |
addExonsAllowed()
|
void |
addGeneOrTranscript()
The default addGeneOrTranscript. |
void |
addGeneOrTranscript(boolean overlapping)
|
boolean |
addGeneOrTranscriptAllowed()
Determine whether it's OK to do an add gene or transcript. |
void |
addNewAnnot(java.lang.String type)
|
boolean |
addOverlappingAllowed()
|
void |
addOverlappingGene(java.util.Vector features)
This method creates a new gene from the features, whether or not they overlap an existing gene. |
void |
addTranscript()
If called with no args, addTranscript checks which gene was selected and adds the transcript to that gene. |
boolean |
addTranscriptAllowed()
Whether allowed to add transcript, just calls addEvidenceExonsAllowed as conditions are same |
protected boolean |
areOverlapping(SeqFeatureI sa,
SeqFeatureI sb)
areOverlapping determines if two SeqFeatureIs overlap using the currently defined gene definition (from Config.getGeneDefinition(). |
void |
assignAnnotationName()
|
boolean |
assignAnnotationNameAllowed()
|
protected boolean |
checkAdjacent(Transcript trans,
java.util.Vector exonFeatures)
Determines if two exons are adjacent to one another in the transcript. |
void |
createAnnotation()
|
void |
createAnnotation(int low,
int high,
int strand,
java.lang.String type)
This method uses #addAnnotation(Vector,false,type)
to create an unsupported transcript or gene, or one level? |
void |
createAnnotation(int basePosition,
int strand,
java.lang.String type)
This method puts up a dialog asking for the size of the new exon, and then calls #createAnnotation(int,int,int). |
void |
createAnnotation(java.lang.String type)
The default createAnnotation method for creating an unsupported annotation. |
boolean |
createAnnotationAllowed()
Determine whether or not the SelectionSets are compatible with creating an unsupported (no evidence) annotation. |
void |
deleteExon()
The default edit for deleting an exon from a transcript. |
boolean |
deleteExonAllowed()
Determine if the default purgeExon is compatible with the current SelectionSets. |
void |
deleteSelectedFeatures()
The default deleteSelectedFeatures which deletes any features in the viewSet. |
void |
deleteSelectedFeatures(java.util.Vector features,
java.lang.String description)
Deletes the Vector of features. |
boolean |
deleteSelectionAllowed()
True if can delete selection |
void |
disown(java.util.Vector features)
|
void |
duplicateTranscript(Transcript transcript)
Duplicates a transcript. |
protected java.util.Vector |
findOverlappingAnnots(java.util.Vector features)
Looks through all first-tier annotations (genes, etc.) in the annotationCollection looking for overlapping (according to the current gene definition) annots. |
void |
flipResult()
Move a result to other strand |
void |
generateEditTransaction(java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats)
Creates add/delete transactions for the top level feature edits. |
void |
generateEditTransaction(java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats,
CompoundTransaction ct)
|
void |
generateFeatChangeData(java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats,
SeqFeatureI topLevelFeat)
|
SeqFeatureI |
generateFeatChangeData(java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats,
SeqFeatureI topLevelFeat,
boolean deepCopy)
Clone a top level feature and inserts the data into a FeatChangeData object, which keeps track of the unmodified feature and newly added features |
Controller |
getController()
ControlledObjectI method for getting the controller for the editor. |
java.lang.Object |
getControllerWindow()
ControlledObjectI method. |
SeqFeatureI |
getTopLevelFeat(SeqFeatureI feat)
Return the top level feature for a given SeqFeatureI object |
protected boolean |
goodEvidence(java.util.Vector transcripts,
java.util.Vector features)
|
boolean |
isFirstTierAnnot(FeatureSetI annot)
Returns true if this is a first-tier annotation |
protected boolean |
isRangeOK(SeqFeatureI sf,
int start,
int end)
Checks whether a specified range is OK. |
void |
mergeExons()
The default mergeExons method. |
boolean |
mergeExonsAllowed()
True if can merge exons |
void |
mergeTranscripts()
The default mergeTranscripts method. |
boolean |
mergeTranscriptsAllowed()
Determine if the current selections are compatible with performing a merge transcripts. |
void |
moveExonsToTranscript()
The default moveExonsToTranscript. |
boolean |
moveExonsToTranscriptAllowed()
Determine if the current selections are compatible with moving exons to another transcript. |
boolean |
needsAutoRemoval()
ControlledObjectI. |
void |
printSets()
A debugging method to print out the four current selection sets. |
void |
removeEvidenceExons()
The default removeEvidenceExons which uses the viewSet to determine the transcript to remove evidence from the exons. |
void |
removeEvidenceExons(Transcript trans,
java.util.Vector features)
Remove evidence to exons in a transcript. |
protected void |
removeEvidenceExons(Transcript trans,
java.util.Vector features,
ChangeList changer)
This actually does the removal of Evidence from exons in a transcript. |
boolean |
removeEvidenceExonsAllowed()
Checks whether the current SelectionSets are compatible with removing evidence from exons. |
protected void |
resetData()
Reinitialises the four SelectionSets and basePosition, endBasePosition and strandSet. |
boolean |
resultIsSelected()
Determine if there is anything at all selected to move to the other strand |
SeqFeatureI |
setAnnotTerminus(AnnotatedFeatureI annFeat,
int oldStart,
int oldEnd,
int newStart,
int newEnd)
|
void |
setAnnotTerminus(AnnotatedFeatureI annFeat,
int oldStart,
int oldEnd,
int newStart,
int newEnd,
java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats)
Set exon ends to newStart and newEnd (if they are different) Update transcript and gene ends. |
void |
setAs3Prime()
Sets the 3' end of an exon. |
void |
setAs5Prime()
Sets the 5' end of an exon. |
void |
setAsBothEnds()
Sets both ends of an exon. |
void |
setController(Controller c)
ControlledObjectI method for setting the controller for the editor. |
void |
setCurationSet(CurationSet curation)
The curation set needed when naming and giving IDs to the annotations |
static void |
setDoOneLevelAnnots(boolean doOne)
|
void |
setExonTerminus(int end)
int end is from DrawableAnnotationConstants - need to move to this package |
boolean |
setExonTerminusAllowed()
Checks whether the current SelectionSets are consistent with the default setExonTerminus method. |
void |
setFrameShiftPosition(ExonI exon,
int pos,
boolean plus1)
Sets the start of translation to the specified position and sets the end of translation based on the start. |
void |
setLongestORF()
Sets the start of translation to the specified position and sets the end of translation based on the start. |
void |
setParentComponent(java.awt.Component comp)
Sets the component to enable error and warning messages to be show in dialog boxes. |
void |
setSelections(AnnotationView v,
Selection selection,
java.util.Vector underCursor)
Uses the Selection and AnnotationView passed to generate the EvidenceSet (the features from the Selection in the ResultView for the AnnotationView), the annotSet (the features from the Selection in the AnnotationView) and the annotSet (all the features in the Selection). |
void |
setSelections(AnnotationView annotView,
Selection selection,
java.util.Vector underCursor,
int basePosition,
int strand)
Uses the Selection and AnnotationView passed to generate the EvidenceSet (the features from the Selection in ResultView for the AnnotationView), the annotSet (the features from the Selection in the AnnotationView) and the annotSet (all the features in the Selection). |
void |
setSelections(int basePosition,
int endBasePosition,
java.util.Vector underCursor,
java.util.Vector annotVect,
java.util.Vector resultVect,
java.util.Vector siteVect)
sets the four SelectionSets which are used in the edit methods, from the four input Vectors. |
void |
setSelections(java.util.Vector underCursor,
java.util.Vector annotVect,
java.util.Vector resultVect,
java.util.Vector siteVect)
sets the four SelectionSets which are used in the edit methods, from the four input Vectors. |
void |
setSequencingErrorPositions(SequenceI seq,
java.lang.String operation,
int pos,
java.lang.String residue,
FeatureList annots)
Sets the start of translation to the specified position and sets the end of translation based on the start. |
void |
setSpliceSite()
The default splice site setting function. |
void |
setTranscriptStatus(Transcript t)
This needs to send out a real annotation change event - only sends out a redraw at the moment |
void |
setTranslationStart(ExonI exon,
int pos)
Sets the start of translation to the specified position and sets the end of translation based on the start. |
void |
setTranslationTerminus()
The default setTranslationTerminus method. |
boolean |
setTranslationTerminusAllowed()
|
void |
setView(AnnotationView annotView)
|
protected void |
showMessage(int type,
java.lang.String message)
Display a message. |
protected void |
showMessageWindow(int type,
java.lang.String message,
java.lang.String title)
Display the message dialog window with the specified message string and title. |
void |
splitExon()
The default splitExon method. |
void |
splitExon(ExonI exon,
int basePosition)
Splits a Feature at basePosition + and - 1 with splitExon(ExonI,int,int). |
void |
splitExon(ExonI exon,
int newHigh,
int newLow)
The splitExon method which actually does the edit. |
boolean |
splitExonAllowed()
annotSet can only have one exon |
void |
splitTranscript()
The default splitTranscript method. |
boolean |
splitTranscriptAllowed()
Determine if the current SelectionSets are compatible with splitting a transcript. |
void |
takeOwnership(java.util.Vector features)
Should there be an ownership event - probably |
protected boolean |
userReallyWantsToSplit(AnnotatedFeatureI orig_gene)
Warn user about the impending split and give them a chance to cancel it |
protected boolean |
validNewExons(java.util.Vector transcripts,
java.util.Vector features)
|
boolean |
warnOnEdit(java.util.Vector transcripts)
Some new properties in ChadoXML (e.g. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotationEditor(GuiCurationState curationState,
FeatureSetI annotationCollection)
c - The controller to use for propogating AnnotationChangeEvents
for editsdfset - The TOP of the DrawableAnnotatedFeatureSet tree to edit.annotationCollection - top level model of annot view being edited| Method Detail |
|---|
public void setController(Controller c)
setController in interface ControlledObjectIpublic void setCurationSet(CurationSet curation)
public Controller getController()
getController in interface ControlledObjectIpublic java.lang.Object getControllerWindow()
getControllerWindow in interface ControlledObjectIpublic boolean needsAutoRemoval()
needsAutoRemoval in interface ControlledObjectIpublic void setParentComponent(java.awt.Component comp)
protected void resetData()
public void setSelections(AnnotationView v,
Selection selection,
java.util.Vector underCursor)
v - The AnnotationView used for dividing the Selection.selection - The Selection to be divided.underCursor - A vector of features under the cursor location.
public void setSelections(AnnotationView annotView,
Selection selection,
java.util.Vector underCursor,
int basePosition,
int strand)
v - The AnnotationView used for dividing the Selection.selection - The Selection to be divided.underCursor - A vector of features under the cursor location.basePosition - This sets this.basePosition (used in position specific
edits such as #splitFeature().strand - This sets defaultStrand (used in createAnnotation()).
(This is the call AnnotationMenu and TierPopupMenu use)public void setView(AnnotationView annotView)
public void setSelections(int basePosition,
int endBasePosition,
java.util.Vector underCursor,
java.util.Vector annotVect,
java.util.Vector resultVect,
java.util.Vector siteVect)
resetData().
This constructor is used by EDE to make an intron via splitExon that extends to
splice sites. This currently doesnt work properly (intron always 1 bp)
see BaseEditorPanel.RichtClickActionListener
Change these to FeatureList
basePosition - start base position of edit (start of intron)endBasePosition - end base position of edit (end of intron)inSel - Vector of features used for the annotSet.underCursor - Vector of features used for the cursorSet.inView - Vector of features used for the viewSet.inEvidence - Vector of features used for the evidenceSet.
public void setSelections(java.util.Vector underCursor,
java.util.Vector annotVect,
java.util.Vector resultVect,
java.util.Vector siteVect)
resetData().
inSel - Vector of features used for the annotSet.underCursor - Vector of features used for the cursorSet.inView - Vector of features used for the viewSet.inEvidence - Vector of features used for the evidenceSet.public boolean mergeTranscriptsAllowed()
public void mergeTranscripts()
public void printSets()
protected void showMessage(int type,
java.lang.String message)
protected void showMessageWindow(int type,
java.lang.String message,
java.lang.String title)
protected boolean areOverlapping(SeqFeatureI sa,
SeqFeatureI sb)
public void setTranslationStart(ExonI exon,
int pos)
public void setFrameShiftPosition(ExonI exon,
int pos,
boolean plus1)
public void setSequencingErrorPositions(SequenceI seq,
java.lang.String operation,
int pos,
java.lang.String residue,
FeatureList annots)
public void setLongestORF()
public boolean setTranslationTerminusAllowed()
public void setTranslationTerminus()
public void setSpliceSite()
protected boolean isRangeOK(SeqFeatureI sf,
int start,
int end)
public boolean resultIsSelected()
public void flipResult()
public boolean addEvidenceExonsAllowed()
protected boolean goodEvidence(java.util.Vector transcripts,
java.util.Vector features)
protected boolean validNewExons(java.util.Vector transcripts,
java.util.Vector features)
public void addEvidenceExons()
public boolean removeEvidenceExonsAllowed()
public void removeEvidenceExons()
public void removeEvidenceExons(Transcript trans,
java.util.Vector features)
#removeEvidenceExons(Transcript,Vector,AnnotationChangeCoalescer).
trans - The transcript to remove evidence from the exons of.features - A Vector of the features to remove as evidence.
protected void removeEvidenceExons(Transcript trans,
java.util.Vector features,
ChangeList changer)
trans - The transcript to remove exons from.features - The Vector of features to remove as evidence from the exons
of trans.changer - The coalescer for this edit.
I think evidence and thus this method is irrelevant now w/ edge matching.
not firing annot change event - see comment in addEvidenceExonspublic boolean addExonsAllowed()
public boolean warnOnEdit(java.util.Vector transcripts)
public void addExons()
public void addExons(Transcript trans,
java.util.Vector features)
trans - The transcript to add exons to.features - A Vector of features to define the limits for
the new exons.protected java.util.Vector findOverlappingAnnots(java.util.Vector features)
features - Vector of features to look for overlaps to.public boolean isFirstTierAnnot(FeatureSetI annot)
public boolean addGeneOrTranscriptAllowed()
public void addGeneOrTranscript()
public void addGeneOrTranscript(boolean overlapping)
public void addNewAnnot(java.lang.String type)
public boolean addOverlappingAllowed()
public void addOverlappingGene(java.util.Vector features)
features - The features to create exons in the new transcript from.public boolean addTranscriptAllowed()
public void addTranscript()
protected boolean userReallyWantsToSplit(AnnotatedFeatureI orig_gene)
public void duplicateTranscript(Transcript transcript)
public void addAnnot(java.util.Vector features,
boolean mergeOverlapping)
#consolidateGenes(AnnotatedFeatureI,AnnotationChangeCoalescer) is
done to do any necessary gene merges.
features - The Vector of SeqFeatureIs to base the exons in the new
gene on.
public void addAnnotation(java.util.Vector features,
boolean mergeOverlapping,
java.lang.String type)
public boolean moveExonsToTranscriptAllowed()
public void moveExonsToTranscript()
public boolean mergeExonsAllowed()
public void mergeExons()
protected boolean checkAdjacent(Transcript trans,
java.util.Vector exonFeatures)
trans - The transcript to check inexonFeatures - Two exons from trans in a Vectorpublic boolean splitTranscriptAllowed()
public void splitTranscript()
public boolean createAnnotationAllowed()
public void createAnnotation()
public void createAnnotation(java.lang.String type)
setSelections(AnnotationView, Selection, Vector, int, int)
public void createAnnotation(int basePosition,
int strand,
java.lang.String type)
#createAnnotation(int,int,int).
public void createAnnotation(int low,
int high,
int strand,
java.lang.String type)
#addAnnotation(Vector,false,type)
to create an unsupported transcript or gene, or one level?
public boolean splitExonAllowed()
public void splitExon()
public void splitExon(ExonI exon,
int newHigh,
int newLow)
exon - The exon to split.newHigh - Split exon limit (exon.getLow() - newHigh)newLow - Split exon limit (newLow - exon.getHigh())
public void splitExon(ExonI exon,
int basePosition)
splitExon(ExonI,int,int).
public boolean deleteSelectionAllowed()
public void deleteSelectedFeatures()
public void deleteSelectedFeatures(java.util.Vector features,
java.lang.String description)
features - The Vector of leaf features to delete, exons for 3 level annots
just annotatedFeat for 1 level annot.and #purgeAnnot(AnnotatedFeatureI)public boolean deleteExonAllowed()
public void deleteExon()
public void setAs5Prime()
public void setAs3Prime()
public void setAsBothEnds()
public boolean setExonTerminusAllowed()
public void setExonTerminus(int end)
public SeqFeatureI setAnnotTerminus(AnnotatedFeatureI annFeat,
int oldStart,
int oldEnd,
int newStart,
int newEnd)
public void setAnnotTerminus(AnnotatedFeatureI annFeat,
int oldStart,
int oldEnd,
int newStart,
int newEnd,
java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats)
public void takeOwnership(java.util.Vector features)
public void disown(java.util.Vector features)
public void setTranscriptStatus(Transcript t)
public boolean assignAnnotationNameAllowed()
public void assignAnnotationName()
public void generateEditTransaction(java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats,
CompoundTransaction ct)
public void generateEditTransaction(java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats)
topLevelFeats - - features that have been modified (or a descendant has been modified)public SeqFeatureI getTopLevelFeat(SeqFeatureI feat)
feat - - feature to return the top level feature
public void generateFeatChangeData(java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats,
SeqFeatureI topLevelFeat)
public SeqFeatureI generateFeatChangeData(java.util.Map<java.lang.Integer,AnnotationEditor.FeatChangeData> topLevelFeats,
SeqFeatureI topLevelFeat,
boolean deepCopy)
topLevelFeats - - features that have been modified (or a descendant has been modified)topLevelFeat - - top level feature to be cloned and added to topLevelFeatspublic static void setDoOneLevelAnnots(boolean doOne)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||