Class DefaultSequenceGraphFactories


  • public final class DefaultSequenceGraphFactories
    extends java.lang.Object
    Provides convenience functionality to create a SequenceGraphFactory which draws a bar graph from some simpler interfaces. For example, used for creating the hydrophobicity, PI, and similarity graphs. These graphs automatically handle calculating scores in background threads where appropriate (on very large sequences and alignments) and averaging scores over multiple residues. It also efficiently handles sequences with long endgaps (e.g. for contig assemblies). More complex graphs (such as the sequence logo graph) should be created directly via the SequenceGraphFactory and SequenceGraph classes.
    • Method Detail

      • createSingleSequenceGraphFactory

        public static SequenceGraphFactory createSingleSequenceGraphFactory​(java.lang.String name,
                                                                            java.lang.String description,
                                                                            boolean defaultVisibility,
                                                                            int defaultHeight,
                                                                            SequenceDocument.Alphabet alphabet,
                                                                            DefaultSequenceGraphFactories.SingleSequenceScorer singleSequenceScorer,
                                                                            boolean lineGraph)
        Create a SequenceGraphFactory for a single sequence where graph points depend only on the residue at that point. For example, this is used to create the hydrophobicity and PI graphs in protein sequences.
        Parameters:
        name - name displayed next to graphs generated by this factory
        description - a more verbose description displayed as a tool tip or null to provide no description
        defaultVisibility - the default visibility for this graph.
        defaultHeight - the default height for this graph, which the user can override.
        alphabet - the alphabet of the graph (either protein or nucleotide)
        singleSequenceScorer - a scorer to calculate the score and Color based on a residue.
        lineGraph - true if this should be a line graph rather than a bar graph
        Returns:
        a SequenceGraphFactory
      • createSequenceAlignmentGraphFactory

        public static SequenceGraphFactory createSequenceAlignmentGraphFactory​(java.lang.String name,
                                                                               java.lang.String description,
                                                                               boolean defaultVisibility,
                                                                               int defaultHeight,
                                                                               SequenceDocument.Alphabet alphabet,
                                                                               DefaultSequenceGraphFactories.SingleSequenceScorer singleSequenceScorer,
                                                                               boolean lineGraph)
        Create a SequenceGraphFactory that is averaged over multiple sequences from a single sequence scorer. For example, this is used to create the average hydrophobicity and average PI graphs in protein sequence alignments.
        Parameters:
        name - name displayed next to graphs generated by this factory
        description - a more verbose description displayed as a tool tip or null to provide no description
        defaultVisibility - the default visibility for this graph.
        defaultHeight - the default height for this graph, which the user can override.
        alphabet - the alphabet of the graph (either protein or nucleotide)
        singleSequenceScorer - a scorer to calculate the score and Color based on a residue.
        lineGraph - true if this should be a line graph rather than a bar graph
        Returns:
        a SequenceGraphFactory
      • createSequenceAlignmentGraphFactory

        public static SequenceGraphFactory createSequenceAlignmentGraphFactory​(java.lang.String name,
                                                                               java.lang.String description,
                                                                               boolean defaultVisibility,
                                                                               int defaultHeight,
                                                                               SequenceDocument.Alphabet alphabet,
                                                                               DefaultSequenceGraphFactories.SequenceAlignmentScorer multipleSequenceScorer,
                                                                               boolean lineGraph)
        Create a SequenceGraphFactory for sequence alignments. For example, this is used to create the similarity graph for sequence alignments.
        Parameters:
        name - name displayed next to graphs generated by this factory
        description - a more verbose description displayed as a tool tip or null to provide no description
        defaultVisibility - the default visibility for this graph.
        defaultHeight - the default height for this graph, which the user can override.
        alphabet - the alphabet of the graph (either protein or nucleotide)
        multipleSequenceScorer - a scorer to calculate the score and Color based on a set of residues.
        lineGraph - true if this should be a line graph rather than a bar graph
        Returns:
        a SequenceGraphFactory