Class SequenceAnnotationGenerator.AnnotationGeneratorResult.ResidueAdjustment

  • Enclosing class:
    SequenceAnnotationGenerator.AnnotationGeneratorResult

    public static final class SequenceAnnotationGenerator.AnnotationGeneratorResult.ResidueAdjustment
    extends java.lang.Object
    An immutable class representing an insertion, deletion, or replacement of residues or bases in a sequence.
    • Constructor Summary

      Constructors 
      Constructor Description
      ResidueAdjustment​(int firstResidueToReplaceInclusive, int lastResidueToReplaceExclusive, java.lang.String newResidues)
      Construct a new insertion, deletion, or replacement of residues or bases in a sequence.
      ResidueAdjustment​(ImmutableSequence newSequence)
      Replaces the entire sequence with a new sequence.
    • Constructor Detail

      • ResidueAdjustment

        public ResidueAdjustment​(int firstResidueToReplaceInclusive,
                                 int lastResidueToReplaceExclusive,
                                 java.lang.String newResidues)
        Construct a new insertion, deletion, or replacement of residues or bases in a sequence. For example:
        • ResidueAdjustment(0,0,"GA") represents an insertion of residues "GA" at the beginning of the sequence.
        • ResidueAdjustment(0,3,"") represents a deletion of the first 3 residues of the sequence.
        • ResidueAdjustment(1,2,"GA") represents a replacement of the 2nd residue in the sequence with "GA"
        Parameters:
        firstResidueToReplaceInclusive - 0-based index of the first residue to delete or replace. In the case of an insertion, this is the index of the residue to insert immediately prior to.
        lastResidueToReplaceExclusive - 0-based index (exclusive) of the last residue to delete or replace. In the case of an insertion, this should be equal to firstResidueToReplaceInclusive
        newResidues - the new residues to insert to the residues to replace the existing residues with. In the case of a deletion, this should be an empty string.
      • ResidueAdjustment

        public ResidueAdjustment​(ImmutableSequence newSequence)
        Replaces the entire sequence with a new sequence. This may only be done if the original sequence was also an ImmutableSequence
        Parameters:
        newSequence - the new sequence to replace the old one
        Since:
        API 4.40 (Geneious 5.4.0)
    • Method Detail

      • getFirstResidueToReplaceInclusive

        public int getFirstResidueToReplaceInclusive()
        Get the 0-based first residue to replace or delete. In the case of an insertion, this is the index of the residue to insert immediately prior to.
        Returns:
        the 0-based first residue to replace or delete. In the case of an insertion, this is the index of the residue to insert immediately prior to.
      • getLastResidueToReplaceExclusive

        public int getLastResidueToReplaceExclusive()
        Get the 0-based index (exclusive) of the last residue to delete or replace. In the case of an insertion, this should be equal to getFirstResidueToReplaceInclusive().
        Returns:
        the 0-based index (exclusive) of the last residue to delete or replace. In the case of an insertion, this should be equal to getFirstResidueToReplaceInclusive().
      • getNewResidues

        public java.lang.String getNewResidues()
        Get the new residues to insert to the residues to replace the existing residues with. In the case of a deletion, this should be an empty string.
        Returns:
        the new residues to insert to the residues to replace the existing residues with. In the case of a deletion, this should be an empty string.
      • getNewSequence

        public ImmutableSequence getNewSequence()
        Gets a new sequence to replace the entire old sequence. This must only return a non-null value if the original sequence was an ImmutableSequence
        Returns:
        a new sequence to replace the old sequence. This method may return null, in which case getNewResidues() should be used instead.
        Since:
        API 4.40 (Geneious 5.4.0)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object