public abstract class SequenceGraphFactory extends Object
SequenceGraphs every time a new document is viewed
in the sequence viewer.
A SequenceGraphFactory is provided from a plugin
via GeneiousPlugin.getSequenceGraphFactories().
Sequence graphs can be implemented in one of two ways.
DefaultSequenceGraphFactories
instead which allows creating sequence graphs from simpler interfaces. The following is an example of how to create such a graph:
public SequenceGraphFactory[] getSequenceGraphFactories(){
//the scorer allows you to assign a score for each residue, and also assign a color to each score.
DefaultSequenceGraphFactories.SingleSequenceScorer scorer = new DefaultSequenceGraphFactories.SingleSequenceScorer(){
public Double getScore(char residue) {
return Math.random();
}
public Color getColor(double score) {
return Color.black;
}
};
return new SequenceGraphFactory[]{
DefaultSequenceGraphFactories.createSingleSequenceGraphFactory("Nucleotide Ludicrousity", "What a ludicrous graph!", true, 25, SequenceDocument.Alphabet.NUCLEOTIDE, scorer, false), //a bar graph
DefaultSequenceGraphFactories.createSingleSequenceGraphFactory("Protein Ludicrousity", "What a ludicrous graph!", true, 25, SequenceDocument.Alphabet.PROTEIN, scorer, true) //a line graph
};
}
| Constructor and Description |
|---|
SequenceGraphFactory() |
| Modifier and Type | Method and Description |
|---|---|
SequenceGraph |
createDocumentBasedGraph(AnnotatedPluginDocument document)
Deprecated.
This method causes ambiguity about whether the Alignment of Sequence aspect of a
CombinedAlignmentAndSequenceDocument is required so is no longer used on CombinedAlignmentAndSequenceDocuments.
All implementations should instead implement createDocumentBasedGraphForAlignment(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument) or createDocumentBasedGraphForSequence(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument). |
SequenceGraph |
createDocumentBasedGraphForAlignment(AnnotatedPluginDocument document)
Create a new document based Alignment Graph.
|
SequenceGraph |
createDocumentBasedGraphForSequence(AnnotatedPluginDocument document)
Create a new document based SequenceGraph.
|
abstract SequenceGraph |
createResidueBasedGraph(SequenceDocument.Alphabet alphabet,
boolean isAlignment,
boolean isChromatogram,
boolean isContig)
Create a new residue based SequenceGraph for a sequence or alignment.
|
public abstract SequenceGraph createResidueBasedGraph(SequenceDocument.Alphabet alphabet, boolean isAlignment, boolean isChromatogram, boolean isContig)
SequenceGraph.getSequencePropertyRetriever()alphabet - the alphabet of the current sequence or alignment (either protein or nucleotide)isAlignment - true if this is for a graph of an alignment rather then a single sequence.
Alignment graphs are displayed below the final sequence in an alignment.
Sequence graphs are displayed beneath each sequence.
A SequenceGraph created for an alignment will be supplied with a list of sequences in
SequenceGraph.setResidues(java.util.List, java.util.List, boolean).
A SequenceGraph created for a single sequence will be supplied
with singletonList in SequenceGraph.setResidues(java.util.List, java.util.List, boolean).isChromatogram - True if this document is a NucleotideGraph (chromatogram). If a graph wishes to only be available for chromatograms then it can take this parameter into account.
In the case of an alignment (where isAlignment is true), this parameter will only be true if all sequences in the alignment are chromatograms.
Chromatogram information is made available to the graph via the second parameter in
SequenceGraph.setResidues(java.util.List, java.util.List, boolean).isContig - true if this document is a contig alignment.@Deprecated public SequenceGraph createDocumentBasedGraph(AnnotatedPluginDocument document)
CombinedAlignmentAndSequenceDocument is required so is no longer used on CombinedAlignmentAndSequenceDocuments.
All implementations should instead implement createDocumentBasedGraphForAlignment(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument) or createDocumentBasedGraphForSequence(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument).document - the document this graph applies to.
AnnotatedPluginDocument.getDocumentOrNull()
will be either a
SequenceDocument or
SequenceAlignmentDocument
Any graph which is going to provide useful information on these should
be operate on a class that extends one of these with additional state information attached.public SequenceGraph createDocumentBasedGraphForAlignment(AnnotatedPluginDocument document)
document - the document this graph applies to.
AnnotatedPluginDocument.getDocumentOrNull()
will be a
SequenceAlignmentDocument
Any graph which is going to provide useful information on these should
be operate on a class that extends one of these with additional state information attached.public SequenceGraph createDocumentBasedGraphForSequence(AnnotatedPluginDocument document)
document - the document this graph applies to.
AnnotatedPluginDocument.getDocumentOrNull()
will be a
SequenceDocument
Any graph which is going to provide useful information on these should
be operate on a class that extends one of these with additional state information attached.