public abstract static class SequenceViewerExtension.PropertyRetrieverAndEditor extends SequenceGraph.SequencePropertyRetriever
SequenceViewerExtension.PropertyRetrieverAndEditor for testing purposes using
PropertyRetrieverAndEditor.forAlignment or
PropertyRetrieverAndEditor.forSequences.| Modifier and Type | Class and Description |
|---|---|
static interface |
SequenceViewerExtension.PropertyRetrieverAndEditor.DiscardReferencesCallback
Used for indicating that references to values returned from
PropertyRetrieverAndEditor#getVisibleAnnotations(PropertyRetrieverAndEditor.DiscardReferencesCallback)
must be discarded. |
| Constructor and Description |
|---|
SequenceViewerExtension.PropertyRetrieverAndEditor() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectedAnnotationsChangedListener(SimpleListener listener)
Adds a listener to be notified when the annotations returned from
getSelectedAnnotations() change. |
void |
addVisibleAnnotationsChangedListener(SimpleListener listener)
Adds a listener to be notified when the annotations returned from
#getVisibleAnnotations(PropertyRetrieverAndEditor.DiscardReferencesCallback) change. |
boolean |
deleteSelectedAnnotations()
Deletes the selected annotations if possible.
|
boolean |
editSelectedAnnotations()
Opens the annotation editing dialog for the currently selected annotations.
|
boolean |
extractSelectedAnnotations()
Extracts the selected annotations into new document(s)
This method may only be invoked from the Swing thread
|
void |
fireSelectedAnnotationsChangedListeners()
Fires all listeners added using
addSelectedAnnotationsChangedListener(org.virion.jam.util.SimpleListener) |
void |
fireVisibleAnnotationsChangedListeners()
Fires all listeners added using
addVisibleAnnotationsChangedListener(org.virion.jam.util.SimpleListener) |
static SequenceViewerExtension.PropertyRetrieverAndEditor |
forAlignment(SequenceAlignmentDocument alignment)
Creates a SequencePropertyRetriever for an alignment.
|
static SequenceViewerExtension.PropertyRetrieverAndEditor |
forSequences(SequenceDocument... sequences)
Creates a SequencePropertyRetriever for a list of sequences.
|
abstract AnnotatedPluginDocument |
getAnnotatedPluginDocument(int sequenceIndex)
Get the current AnnotatedPluginDocument of one of the sequences being viewed.
|
abstract int |
getGappedIndex(int sequenceIndex,
int residueIndex,
boolean waitForResultIfUnavailable,
SimpleListener resultAvailableListener)
Converts an ungapped index to a sequence into the equivalent gapped index.
|
int |
getNumberOfTracks(int sequenceIndex) |
String |
getPreferencesSuffix()
Returns a preference suffix describing the classes of the current documents being viewed.
|
List<SequenceViewerExtension.SequenceAnnotationWrapper> |
getSelectedAnnotations()
Gets all currently selected annotations.
|
abstract SequenceSelection |
getSelection() |
abstract Map<Interval,List<Interval>> |
getSelectionForAlignmentStatistics()
Returns an adjusted selection suitable for statistics that take alignments into account.
|
abstract SequenceSelection |
getSelectionForStatistics() |
String |
getTrackName(int sequenceIndex,
int trackIndex) |
abstract int |
getUngappedIndexFromExtractedRegion(int sequenceIndex,
int residueIndex,
boolean waitForResultIfUnavailable,
SimpleListener resultAvailableListener)
Converts a gapped index to a sequence into the equivalent ungapped index, and then further adjusts the index to account for any
SequenceAnnotation.TYPE_EXTRACTED_REGION annotation covering the position
This method should either be invoked from the Swing thread, or by an extension that has registered a SequenceViewerExtension.PropertyRetrieverAndEditor.DiscardReferencesCallback and has not been instructed to discard references. |
abstract int |
getUngappedIndexOfThisOrNextResidue(int sequenceIndex,
int residueIndex,
boolean waitForResultIfUnavailable,
SimpleListener resultAvailableListener)
Converts a gapped index in a sequence into the equivalent ungapped index.
|
abstract int |
getUngappedIndexOfThisOrPreviousResidue(int sequenceIndex,
int residueIndex,
boolean waitForResultIfUnavailable,
SimpleListener resultAvailableListener)
Converts a gapped index in a sequence into the equivalent ungapped index.
|
List<SequenceViewerExtension.SequenceAnnotationWrapper> |
getVisibleAnnotations(SequenceViewerExtension.PropertyRetrieverAndEditor.DiscardReferencesCallback discardReferencesCallback)
Gets all currently visible (after applying the filter) annotations.
|
abstract boolean |
isAlignmentOrContig() |
boolean |
isDedicatedExtensionViewer() |
boolean |
setSelectedAnnotations(List<SequenceViewerExtension.SequenceAnnotationWrapper> selectedAnnotations)
Sets the selected annotations
This method may only be invoked from the Swing thread
|
boolean |
translateSelectedAnnotations()
Translates the selected annotations into new document(s)
This method may only be invoked from the Swing thread
|
boolean |
zoomToSelectedAnnotations()
Zooms to the selected annotations, focusing the main sequence viewer if necessary
This method may only be invoked from the Swing thread
|
getAlphabet, getCircularAlignmentLength, getEndGapsManager, getLeadingTrimLength, getMappingQuality, getMaximumSequenceLength, getNucleotideGraph, getNumberOfMappedLocations, getNumberOfSequences, getReferenceSequenceIndex, getSequenceCharSequence, getSequenceListSummary, getSequenceName, getTrailingTrimLength, isCircularSequence, isFreeEndGapAlignment, isReferenceSequnece, isReversedSequence, isTrimmedpublic SequenceViewerExtension.PropertyRetrieverAndEditor()
public abstract AnnotatedPluginDocument getAnnotatedPluginDocument(int sequenceIndex)
sequenceIndex - the index of the sequence in question whose AnnotatedPluginDocument we should returnpublic List<SequenceViewerExtension.SequenceAnnotationWrapper> getVisibleAnnotations(SequenceViewerExtension.PropertyRetrieverAndEditor.DiscardReferencesCallback discardReferencesCallback)
discardReferencesCallback - may be null if the caller will not hold a reference to any of the annotations after returning control to the swing thread. The calling code should reuse the same instance of this callback to avoid excessive listeners building uppublic List<SequenceViewerExtension.SequenceAnnotationWrapper> getSelectedAnnotations()
public String getPreferencesSuffix()
public void addVisibleAnnotationsChangedListener(SimpleListener listener)
#getVisibleAnnotations(PropertyRetrieverAndEditor.DiscardReferencesCallback) change.listener - the listener to be notifiedpublic void fireVisibleAnnotationsChangedListeners()
addVisibleAnnotationsChangedListener(org.virion.jam.util.SimpleListener)public void addSelectedAnnotationsChangedListener(SimpleListener listener)
getSelectedAnnotations() change.listener - the listener to be notifiedpublic void fireSelectedAnnotationsChangedListeners()
addSelectedAnnotationsChangedListener(org.virion.jam.util.SimpleListener)public boolean setSelectedAnnotations(List<SequenceViewerExtension.SequenceAnnotationWrapper> selectedAnnotations)
selectedAnnotations - the annotations to select. These must be a subset of annotations returned from a previous call to #getVisibleAnnotations(PropertyRetrieverAndEditor.DiscardReferencesCallback)public boolean editSelectedAnnotations()
public boolean extractSelectedAnnotations()
public boolean translateSelectedAnnotations()
public boolean zoomToSelectedAnnotations()
public boolean deleteSelectedAnnotations()
public abstract int getUngappedIndexOfThisOrNextResidue(int sequenceIndex,
int residueIndex,
boolean waitForResultIfUnavailable,
SimpleListener resultAvailableListener)
SequenceGapInformation.getUngappedIndexOfThisOrNextResidue(int).
If this is used on unaligned sequences, then residueIndex is returned.
This method should either be invoked from the Swing thread, or by an extension that has registered a SequenceViewerExtension.PropertyRetrieverAndEditor.DiscardReferencesCallback and has not been instructed to discard references.sequenceIndex - the 0-based index of the sequence to get the value for. -1 represents the consensus sequence, although using this on the consensus sequence is not recommended due to the entire consensus sequence needing to be evaluated (which can take a long time)residueIndex - the 0-based gapped position within the sequencewaitForResultIfUnavailable - true to block until the result is available.resultAvailableListener - an optional listener to notify when the result is probably available in which case the calling code should call this method again. Only used if waitForResultIfUnavailable==falseInteger.MIN_VALUE if the result is not quickly available and waitForResultIfUnavailable==falseSequenceGapInformation.getUngappedIndexOfThisOrNextResidue(int),
getUngappedIndexOfThisOrPreviousResidue(int, int, boolean, org.virion.jam.util.SimpleListener)public abstract int getUngappedIndexOfThisOrPreviousResidue(int sequenceIndex,
int residueIndex,
boolean waitForResultIfUnavailable,
SimpleListener resultAvailableListener)
SequenceGapInformation.getUngappedIndexOfThisOrPreviousResidue(int)
If this is used on unaligned sequences, then residueIndex is returned.
This method should either be invoked from the Swing thread, or by an extension that has registered a SequenceViewerExtension.PropertyRetrieverAndEditor.DiscardReferencesCallback and has not been instructed to discard references.sequenceIndex - the 0-based index of the sequence to get the value for. -1 represents the consensus sequence, although using this on the consensus sequence is not recommended due to the entire consensus sequence needing to be evaluated (which can take a long time)residueIndex - the 0-based gapped position within the sequencewaitForResultIfUnavailable - true to block until the result is available.resultAvailableListener - an optional listener to notify when the result is probably available in which case the calling code should call this method again. Only used if waitForResultIfUnavailable==falseInteger.MIN_VALUE if the result is not quickly available and waitForResultIfUnavailable==falseSequenceGapInformation.getUngappedIndexOfThisOrNextResidue(int),
getUngappedIndexOfThisOrPreviousResidue(int, int, boolean, org.virion.jam.util.SimpleListener)public abstract int getUngappedIndexFromExtractedRegion(int sequenceIndex,
int residueIndex,
boolean waitForResultIfUnavailable,
SimpleListener resultAvailableListener)
SequenceAnnotation.TYPE_EXTRACTED_REGION annotation covering the position
This method should either be invoked from the Swing thread, or by an extension that has registered a SequenceViewerExtension.PropertyRetrieverAndEditor.DiscardReferencesCallback and has not been instructed to discard references.sequenceIndex - the 0-based index of the sequence to get the value for. -1 represents the consensus sequence, although using this on the consensus sequence is not recommended due to the entire consensus sequence needing to be evaluated (which can take a long time)residueIndex - the 0-based gapped position within the sequencewaitForResultIfUnavailable - true to block until the result is available.resultAvailableListener - an optional listener to notify when the result is probably available in which case the calling code should call this method again. Only used if waitForResultIfUnavailable==falseInteger.MIN_VALUE if the result is not quickly available and waitForResultIfUnavailable==falsepublic abstract int getGappedIndex(int sequenceIndex,
int residueIndex,
boolean waitForResultIfUnavailable,
SimpleListener resultAvailableListener)
SequenceGapInformation.getGappedIndex(int)
This method should either be invoked from the Swing thread, or by an extension that has registered a SequenceViewerExtension.PropertyRetrieverAndEditor.DiscardReferencesCallback and has not been instructed to discard references.sequenceIndex - the 0-based index of the sequence to get the value for. -1 represents the consensus sequence, although using this on the consensus sequence is not recommended due to the entire consensus sequence needing to be evaluated (which can take a long time)residueIndex - the 0-based ungapped position within the sequencewaitForResultIfUnavailable - true to block until the result is available.resultAvailableListener - an optional listener to notify when the result is probably available in which case the calling code should call this method again. Only used if waitForResultIfUnavailable==falseInteger.MIN_VALUE if the result is not quickly available and waitForResultIfUnavailable==falsepublic abstract boolean isAlignmentOrContig()
public int getNumberOfTracks(int sequenceIndex)
sequenceIndex - the 0-based index of the sequence. This is only applicable on alignment based graphs. This must be 0 on sequence based graphs.SequenceTrack on this sequence.public String getTrackName(int sequenceIndex, int trackIndex)
sequenceIndex - the 0-based index of the sequence. This is only applicable on alignment based graphs. This must be 0 on sequence based graphs.trackIndex - the 0-based index of the track (in the range 0 to getNumberOfTracks(int). May be -1 to get the name of the non-track which is null.SequenceTrack on this sequence or null if this is not a track (i.e. the trackIndex is -1)public boolean isDedicatedExtensionViewer()
public abstract SequenceSelection getSelection()
getSelectionForStatistics(),
getSelectionForAlignmentStatistics()public abstract SequenceSelection getSelectionForStatistics()
getSelectionForAlignmentStatistics() instead.getSelection(),
getSelectionForAlignmentStatistics()public abstract Map<Interval,List<Interval>> getSelectionForAlignmentStatistics()
getSequenceListSummary()!=null)
Implementations should take into account whether or not it is a free end gap alignment using SequenceGraph.SequencePropertyRetriever.isFreeEndGapAlignment() and handle circular alignments by wrapping positions at SequenceGraph.SequencePropertyRetriever.getCircularAlignmentLength()IllegalStateException - if isAlignmentOrContig()==falsegetSelection(),
getSelectionForStatistics()public static SequenceViewerExtension.PropertyRetrieverAndEditor forSequences(SequenceDocument... sequences)
SequenceViewerExtension.Factory.createSequenceViewerExtension
or SequenceViewerExtension.StatisticsFactory.createStatistics.sequences - the sequences to create a properties retriever for.public static SequenceViewerExtension.PropertyRetrieverAndEditor forAlignment(SequenceAlignmentDocument alignment)
SequenceViewerExtension.Factory.createSequenceViewerExtension
or SequenceViewerExtension.StatisticsFactory.createStatistics.alignment - the alignment to create a properties retriever for.