Class SequenceCharSequence
- java.lang.Object
-
- com.biomatters.geneious.publicapi.documents.sequence.SequenceCharSequence
-
- All Implemented Interfaces:
XMLSerializable,XMLSerializable.OldVersionCompatible,java.lang.CharSequence,java.lang.Comparable<SequenceCharSequence>
- Direct Known Subclasses:
ImmutableSequence
public abstract class SequenceCharSequence extends java.lang.Object implements java.lang.CharSequence, XMLSerializable, java.lang.Comparable<SequenceCharSequence>, XMLSerializable.OldVersionCompatible
A CharSequence that knows the length of its terminal gaps (sequences of '-') and allows for efficient
insertionsanddeletionsof subsequences.This class is a wrapper around another CharSequence which must be immutable. As long as the wrapped CharSequence honors this contract, instances of this class are also immutable and therefore thread safe.
Traditionally we have used Strings to represent biological sequences in Geneious, however it is preferable for methods to not require Strings but just CharSequences to be passed in, mostly because some aspects of CharSequences can be calculated on the fly or (e.g. when a CharSequence contains a long repetition of the same character) be stored much more memory efficient than a String. Also, other than repetitive characters, a CharSequence implementation can also store any additional metainformation about a sequence.
This class (SequenceCharSequence) makes use of this advantage. It is an immutable wrapper around another CharSequence (which must also be immutable, i.e. not change its length or sequence of characters, particularly it may not acquire or lose any terminal gaps). Failure of the wrapped CharSequence to comply with this contract may result in arbitrary nondeterministic behaviour or RuntimeExceptions, but it is not guaranteed that such exceptions will be thrown.
You can obtain a SequenceCharSequence wrapper around any immutable CharSequence via:
valueOf(CharSequence); to prepend terminal gaps to an existing sequence in constant time, usewithTerminalGaps(int, CharSequence, int).Of note among the methods in this class that run in constant time are:
getLeadingGapsLength()getTrailingGapsLength()isAllGaps()subSequence(int, int)(not always in constant time)getInternalCharSequence()(returns the sequence without terminal gaps)
When working with SequenceCharSequences, it is advisable to use the methods in
SequenceUtilitiesandCharSequenceUtilitieswherever possible, rather than writing your own code. All of those methods treat SequenceCharSequences special to run more efficiently.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportType
-
-
Field Summary
Fields Modifier and Type Field Description static SequenceCharSequenceEMPTYAn empty (0 length) immutable SequenceCharSequence-
Fields inherited from interface com.biomatters.geneious.publicapi.documents.XMLSerializable
ROOT_ELEMENT_NAME
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract charcharAt(int index)Returns thecharvalue at the specified index.charcharAtIgnoringEndGaps(int index)Gets the character at the given index, ignoring end gaps.intcompareTo(SequenceCharSequence that)Lexicographically compares this SequenceCharSequence to another, taking into account case.abstract booleancontains(char c)Checks whether this CharSequence contains the specified character.jebl.util.MaybeBooleancontainsInvalidResidues(jebl.evolution.sequences.SequenceType sequenceType, boolean allowGaps)performs a quick test to see if this sequence contains possilby contains invalid residues for its sequence type.abstract intcount(char c)Counts the number of occurences of c in this CharSequenceintcountGaps(int startIndex, int endIndexExclusive)Counts the number of gaps in this sequence between the 2 given positions.SequenceCharSequencedelete(int deletionBegin, int deletionEnd)Returns a copy of this SequenceCharSequence where the characters at positions deletionBegin inclusive to deletionEnd exclusive have been removed.booleanequals(java.lang.Object obj)Checks whether obj is a SequenceCharSequence representing the same sequence of characters as this one.booleanequalsIgnoreCase(SequenceCharSequence that)Checks whether this SequenceCharSequence contains the same sequence of characters as the specified SequenceCharSequence, ignoring case.static SequenceCharSequencefromXml(org.jdom.Element element)Constructs a SequenceCharSequence from the specified element to which it was serialized viatoXML().voidfromXML(org.jdom.Element element)Unsupported operation.abstract java.lang.CharSequencegetInternalCharSequence()Returns the CharSequence wrapped by this SequenceCharSequence, representing the sequence without the terminal gaps.intgetInternalSequenceLength()abstract intgetLeadingGapsLength()The number of leading gaps in this SequenceCharSequence, i.e.abstract intgetTrailingGapsLength()The number of trailing gaps in this SequenceCharSequence.abstract intgetTrailingGapsStartIndex()Get the index in the sequence at which the trailing gaps (if any) start.intgetUngappedLength()returns the length of this sequence, excluding any gaps (both internal and end gaps)Geneious.MajorVersiongetVersionSupport(XMLSerializable.VersionSupportType versionType)ImplementsXMLSerializable.OldVersionCompatible.getVersionSupport(com.biomatters.geneious.publicapi.documents.XMLSerializable.VersionSupportType)but note that SequenceCharSequence is guaranteed to be able to always serialize toGeneious.MajorVersion.Version6_0inthashCode()Calculates a hashCode that is based on this CharSequence's sequence of characters.intindexOf(java.lang.CharSequence subSequence)Get the index of the first character of the first occurrence of the specified sub sequence in this sequenceintindexOf(java.lang.CharSequence subSequence, int fromIndex)Get the index of the first character of the first occurrence of the specified sub sequence in this sequence, starting at the specified indexSequenceCharSequenceinsert(int index, java.lang.CharSequence charSequence)Creates a copy of this SequenceCharSequence with the specified CharSequence inserted at the specified index.booleanisAllGaps()Returns true if this seqeuence consists entirely of gap ('-') characters.booleanisEndGap(int index)Returns true if the given endex is an end gap (i.e.booleanisGap(int index)Returns true if the given endex is a gap.static SequenceCharSequencereadObject(GeneiousObjectInputStream inputStream)Reconstructs this sequence from data previously created usingwriteObject(GeneiousObjectOutputStream , jebl.util.ProgressListener)static SequenceCharSequencereadObject(java.io.DataInput dataInput)Reconstructs this sequence from data previously created usingwriteObject(java.io.DataOutput, jebl.util.ProgressListener)SequenceCharSequencesubSequence(int start, int end)Constructs a subsequence of this sequence.java.lang.StringtoString()org.jdom.ElementtoXML()Serializes this SequenceCharSequence to XML into an element namedXMLSerializable.ROOT_ELEMENT_NAME.org.jdom.ElementtoXML(boolean allowFileData)Serializes this SequenceCharSequence to XML into an element namedXMLSerializable.ROOT_ELEMENT_NAME.org.jdom.ElementtoXML(Geneious.MajorVersion majorVersion, jebl.util.ProgressListener progressListener)Serializes this class to XML format, potentially to a format readable by an earlier version of Geneious.org.jdom.ElementtoXML(Geneious.MajorVersion version, jebl.util.ProgressListener progressListener, boolean allowFileData)Serializes this SequenceCharSequence to XML into an element namedXMLSerializable.ROOT_ELEMENT_NAME.static SequenceCharSequencevalueOf(java.lang.CharSequence charSequence)A SequenceCharSequence representing the same sequence of characters as charSequence; It is guaranteed that if charSequence instanceof SequenceCharSequence, charSequence is returned.static SequenceCharSequencewithOnlyGaps(int numberOfGaps)Gets a char sequence that consists of only gaps.static SequenceCharSequencewithTerminalGaps(int gapPrefixLength, java.lang.CharSequence charSequence, int gapSuffixLength)Create a new SequenceCharSequence from a CharSequence with the specified terminal gap lengths.voidwriteObject(GeneiousObjectOutputStream outputStream, jebl.util.ProgressListener progressListener)Writes this sequence to an ObjectOutputStream as specified bySerializable.voidwriteObject(Geneious.MajorVersion version, java.io.DataOutput dataOutput, jebl.util.ProgressListener progressListener)Writes this sequence to a DataOutput.voidwriteObject(java.io.DataOutput dataOutput, jebl.util.ProgressListener progressListener)Writes this sequence to a DataOutput.
-
-
-
Field Detail
-
EMPTY
public static final SequenceCharSequence EMPTY
An empty (0 length) immutable SequenceCharSequence
-
-
Method Detail
-
withTerminalGaps
public static SequenceCharSequence withTerminalGaps(int gapPrefixLength, java.lang.CharSequence charSequence, int gapSuffixLength)
Create a new SequenceCharSequence from a CharSequence with the specified terminal gap lengths. In order to obey the contract of SequenceCharSequence that it is immutable, the length ofcharSequenceand the characters retured fromcharSequencemust not change after calling this method. It is guaranteed that the returned SequenceCharSequence's internal charSequence is either charSequence, or a subSequence() of charSequence, or (if charSequence is already a SequenceCharSequence) its internal char sequence.- Parameters:
gapPrefixLength- the length of the leading gaps in addition to any leading gaps already present incharSequencecharSequence- CharSequence to wrap in a SequenceCharSequence. The length ofcharSequenceand the characters retured fromcharSequencemust not change after calling this method.gapSuffixLength- the length of the trailing gaps in addition to any trailing gaps already present incharSequence- Returns:
- a new SequenceCharSequence
-
withOnlyGaps
public static SequenceCharSequence withOnlyGaps(int numberOfGaps)
Gets a char sequence that consists of only gaps.- Parameters:
numberOfGaps- the number of gaps- Returns:
- a char sequence that consists of only gaps.
- Since:
- API 4.11 (Geneious 5.0)
-
valueOf
public static SequenceCharSequence valueOf(java.lang.CharSequence charSequence)
A SequenceCharSequence representing the same sequence of characters as charSequence; It is guaranteed that if charSequence instanceof SequenceCharSequence, charSequence is returned. In order to obey the contract of SequenceCharSequence that it is immutable, the length ofcharSequenceand the characters retured fromcharSequencemust not change after calling this method.- Parameters:
charSequence- CharSequence to wrap in a SequenceCharSequence. The length ofcharSequenceand the characters retured fromcharSequencemust not change after calling this method.- Returns:
- A SequenceCharSequence representing the same sequence of characters as charSequence.
-
contains
public abstract boolean contains(char c)
Checks whether this CharSequence contains the specified character.- Parameters:
c- the character to look for- Returns:
- true if this CharSequence contains the specified character.
-
count
public abstract int count(char c)
Counts the number of occurences of c in this CharSequence- Parameters:
c- The character to search for- Returns:
- The number of times c occurs in this CharSequence
-
fromXml
public static SequenceCharSequence fromXml(org.jdom.Element element) throws XMLSerializationException
Constructs a SequenceCharSequence from the specified element to which it was serialized viatoXML().- Parameters:
element- An element constructed bytoXML().- Throws:
XMLSerializationException
-
toXML
public org.jdom.Element toXML(Geneious.MajorVersion majorVersion, jebl.util.ProgressListener progressListener)
Description copied from interface:XMLSerializable.OldVersionCompatibleSerializes this class to XML format, potentially to a format readable by an earlier version of Geneious. It is acceptable for the XML to include unnecessary tags that will be ignored by the earlier version. For example if the implementation has only extended the XML since the earlier version, then the XML returned may be identical to the XML returned for the current version. SeeXMLSerializable.toXML()for a more detailed description of what it means to serialize to XML. All classes that implement this method must also implement XMLSerializable.toXML() and should delegate back to this method using Geneious.getMajorVersion() and ProgressListener.EMPTY as parameters.- Specified by:
toXMLin interfaceXMLSerializable.OldVersionCompatible- Parameters:
majorVersion- the major version of Geneious to serialize to XML for. For example "6.0" but not "6.0.0". This must be a version returned greater or equal to a version returned fromgetVersionSupport(VersionSupportType.OldestVersionSerializableTo) and must never be greater than the current version (Geneious.getMajorVersion())progressListener- for reporting progress and cancelling- Returns:
- object encoded as a JDOM element
-
toXML
public org.jdom.Element toXML(boolean allowFileData) throws XMLSerializationExceptionSerializes this SequenceCharSequence to XML into an element namedXMLSerializable.ROOT_ELEMENT_NAME. Deserialization can be done via thefromXml(org.jdom.Element).- Parameters:
allowFileData- true to allow the sequence to potentially serialize to a file if it is large enough, usingPluginDocument.FILE_DATA_ATTRIBUTE_NAME.- Returns:
- An XML Element representing this SequenceCharSequence.
- Throws:
XMLSerializationException
-
getVersionSupport
public Geneious.MajorVersion getVersionSupport(XMLSerializable.VersionSupportType versionType)
ImplementsXMLSerializable.OldVersionCompatible.getVersionSupport(com.biomatters.geneious.publicapi.documents.XMLSerializable.VersionSupportType)but note that SequenceCharSequence is guaranteed to be able to always serialize toGeneious.MajorVersion.Version6_0- Specified by:
getVersionSupportin interfaceXMLSerializable.OldVersionCompatible- Parameters:
versionType- specifies which version property to return- Returns:
- the major version of Geneious corresponding to the versionType for this classes toXML method.
-
toXML
public org.jdom.Element toXML(Geneious.MajorVersion version, jebl.util.ProgressListener progressListener, boolean allowFileData) throws XMLSerializationException
Serializes this SequenceCharSequence to XML into an element namedXMLSerializable.ROOT_ELEMENT_NAME. Deserialization can be done via thefromXml(org.jdom.Element).- Parameters:
version- the version number of Geneious that must be able to deserialize thisprogressListener- for reporting progress and cancellingallowFileData- true to allow the sequence to potentially serialize to a file if it is large enough, usingPluginDocument.FILE_DATA_ATTRIBUTE_NAME.- Returns:
- An XML Element representing this SequenceCharSequence.
- Throws:
XMLSerializationException- Since:
- API 4.600 (Geneious 6.0.0)
-
toXML
public org.jdom.Element toXML()
Serializes this SequenceCharSequence to XML into an element namedXMLSerializable.ROOT_ELEMENT_NAME. Deserialization can be done viafromXml(org.jdom.Element)- Specified by:
toXMLin interfaceXMLSerializable- Returns:
- An XML Element representing this SequenceCharSequence.
-
fromXML
public void fromXML(org.jdom.Element element) throws XMLSerializationExceptionUnsupported operation. For XML deserialization,fromXml(org.jdom.Element)should be used.- Specified by:
fromXMLin interfaceXMLSerializable- Parameters:
element- representation from a previous call toXMLSerializable.toXML()- Throws:
XMLSerializationException- always.
-
getLeadingGapsLength
public abstract int getLeadingGapsLength()
The number of leading gaps in this SequenceCharSequence, i.e. the first index i for which charAt(i) won't return '-'. If this sequence consists only of gaps, it is guaranteed that this method will return the same as length() (i.e. in a gap-only sequence, all gaps are considered leading rather than trailing gaps).- Returns:
- the number of leading gaps in this SequenceCharSequence
-
getTrailingGapsLength
public abstract int getTrailingGapsLength()
The number of trailing gaps in this SequenceCharSequence. In other words, the last index for whichcharAt(i)won't return '-' islength() - getTrailingGapsLength(). If this sequence consists only of gaps, then this method will return 0 (i.e. in a gap-only sequnce, all gaps are considered leading rather than trailing gaps).- Returns:
- the number of trailing gaps in this SequenceCharSequence
-
getTrailingGapsStartIndex
public abstract int getTrailingGapsStartIndex()
Get the index in the sequence at which the trailing gaps (if any) start. If there are no trailing gaps, this returnsCharSequence.length().- Returns:
- the index in the sequence at which the trailing gaps (if any) start.
-
isAllGaps
public final boolean isAllGaps()
Returns true if this seqeuence consists entirely of gap ('-') characters.- Returns:
- true if this seqeuence consists entirely of gap ('-') characters.
-
charAt
public abstract char charAt(int index)
Returns thecharvalue at the specified index. If index <getLeadingGapsLength()or index >=CharSequence.length()-getTrailingGapsLength(), returns '-'.- Specified by:
charAtin interfacejava.lang.CharSequence- Parameters:
index- Index of character to look up- Returns:
charvalue at the specified index- Throws:
java.lang.IndexOutOfBoundsException- if index < 0 or index >=CharSequence.length()
-
charAtIgnoringEndGaps
public char charAtIgnoringEndGaps(int index)
Gets the character at the given index, ignoring end gaps. Generally this is more efficient than callingcharAt(int).charAtIgnoringEndGaps(index)is equivalent tocharAt(index+getLeadingGapsLength())- Parameters:
index- the index of the character to get relative to the leading gaps length- Returns:
- the character at the specified index
- Since:
- API 4.11 (Geneious 5.0)
-
subSequence
public SequenceCharSequence subSequence(int start, int end)
Constructs a subsequence of this sequence. If this sequence was a result of a modification (insert(int, CharSequence)ordelete(int, int)) and supports logarithmic time modifications, then it is guaranteed that the returned subsequence supports logarithmic time modifications as well.- Specified by:
subSequencein interfacejava.lang.CharSequence- Parameters:
start- the start index, inclusiveend- the end index, exclusive- Returns:
- A subsequence of this sequence covering positions start inclusive to end exclusive.
-
getInternalCharSequence
public abstract java.lang.CharSequence getInternalCharSequence()
Returns the CharSequence wrapped by this SequenceCharSequence, representing the sequence without the terminal gaps. This method runs in constant time.- Returns:
- A CharSequence representing this SequenceCharSequence's internal sequence without the terminal gaps. It is not specified what the concrete class of the returned CharSequence will be.
-
getInternalSequenceLength
public int getInternalSequenceLength()
- Returns:
- the length of the internal sequence without end gaps.
-
toString
public final java.lang.String toString()
- Specified by:
toStringin interfacejava.lang.CharSequence- Overrides:
toStringin classjava.lang.Object
-
hashCode
public final int hashCode()
Calculates a hashCode that is based on this CharSequence's sequence of characters. So regardless of whether the wrapped CharSequence overridesObject.hashCode(), it is guaranteed that if a.toString().equals(b.toString()) for two SequenceCharSequences a, b, then a.hashCode() == b.hashCode(). However, a.hashCode() will generally be different from a.toString().hashCode(). Note - since this method is generally unused, it is not that efficient or that good at hashing.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hashCode of this SequenceCharSequence.
-
equals
public boolean equals(java.lang.Object obj)
Checks whether obj is a SequenceCharSequence representing the same sequence of characters as this one.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj-- Returns:
- true if and only if obj is instanceof SequenceCharSequence and obj.toString().equals(this.toString()).
-
insert
public SequenceCharSequence insert(int index, java.lang.CharSequence charSequence)
Creates a copy of this SequenceCharSequence with the specified CharSequence inserted at the specified index. Doesn't modify this SequenceCharSequence. The returned SequenceCharSequence will support logarithmic timeinsertionsanddeletions, and its length will be longer than this sequence's bycharSequence.length(). In order to obey the contract of SequenceCharSequence that it is immutable, the length ofcharSequenceand the characters retured fromcharSequencemust not change after calling this method.- Parameters:
index- The position where to insert csq. All existing characters at or to the right of this position will be moved to the right bycharSequence.length().charSequence- A CharSequence to insert at the specified index. The length ofcharSequenceand the characters retured fromcharSequencemust not change after calling this method.- Returns:
- A copy of this SequenceCharSequence with csq inserted at the specified index.
-
delete
public SequenceCharSequence delete(int deletionBegin, int deletionEnd)
Returns a copy of this SequenceCharSequence where the characters at positions deletionBegin inclusive to deletionEnd exclusive have been removed. Doesn't modify this SequenceCharSequence. The returned SequenceCharSequence will support logarithmic timeinsertionsanddeletions, and its length will be shorter than this sequence's bydeletionEnd - deletionBegin.- Parameters:
deletionBegin- Deletion start index, inclusivedeletionEnd- Deletion end index, exclusive- Returns:
- A copy of this SequenceCharSequence with the specified range of characters removed.
-
compareTo
public final int compareTo(SequenceCharSequence that)
Lexicographically compares this SequenceCharSequence to another, taking into account case. The signum of the result value will always be the same as that of this.toString().compareTo(that.toString()). This comparison is consistent with equals.- Specified by:
compareToin interfacejava.lang.Comparable<SequenceCharSequence>- Parameters:
that-- Returns:
- result of comparison of this to that
-
equalsIgnoreCase
public final boolean equalsIgnoreCase(SequenceCharSequence that)
Checks whether this SequenceCharSequence contains the same sequence of characters as the specified SequenceCharSequence, ignoring case.- Parameters:
that- SequenceCharSequence to be compared for equality (ignoring case) with this- Returns:
- true if this.toString().equalsIgnoreCase(that.toString())
-
indexOf
public int indexOf(java.lang.CharSequence subSequence)
Get the index of the first character of the first occurrence of the specified sub sequence in this sequence- Parameters:
subSequence- the subsequence to find- Returns:
- the index of the first character of the first occurrence of the specified sub sequence in this sequence or -1 if the specified subsequence is not a subsequence of this sequence.
-
indexOf
public int indexOf(java.lang.CharSequence subSequence, int fromIndex)Get the index of the first character of the first occurrence of the specified sub sequence in this sequence, starting at the specified index- Parameters:
subSequence- the subsequence to findfromIndex- the index from which to start the search.- Returns:
- the index of the first character of the first occurrence of the specified sub sequence in this sequence or -1 if the specified subsequence is not a subsequence of this sequence.
- Since:
- API 4.700 (Geneious 7.0.0)
-
isEndGap
public boolean isEndGap(int index)
Returns true if the given endex is an end gap (i.e.index<getLeadingGapsLengthorindex>=getTrailingGapsStartIndex())- Parameters:
index- Index of character to look up- Returns:
- true if it is an end gap
-
isGap
public boolean isGap(int index)
Returns true if the given endex is a gap.- Parameters:
index- Index of character to look up- Returns:
- true if it is a gap
-
writeObject
public void writeObject(GeneiousObjectOutputStream outputStream, jebl.util.ProgressListener progressListener) throws java.io.IOException
Writes this sequence to an ObjectOutputStream as specified bySerializable. The object can be reconstructed usingreadObject(GeneiousObjectInputStream)- Parameters:
outputStream- the stream to write to.progressListener- for reporting progress and allowing the write to be canceled.- Throws:
java.io.IOException- if the write cannot be completed for any reason (including if the progress listener requests the operation be canceled)
-
writeObject
public void writeObject(java.io.DataOutput dataOutput, jebl.util.ProgressListener progressListener) throws java.io.IOExceptionWrites this sequence to a DataOutput. The object can be reconstructed usingreadObject(java.io.DataInput)- Parameters:
dataOutput- the DataOutput to write to.progressListener- for reporting progress and allowing the write to be canceled.- Throws:
java.io.IOException- if the write cannot be completed for any reason (including if the progress listener requests the operation be canceled)- Since:
- API 4.30 (Geneious 5.3.0)
-
writeObject
public void writeObject(Geneious.MajorVersion version, java.io.DataOutput dataOutput, jebl.util.ProgressListener progressListener) throws java.io.IOException
Writes this sequence to a DataOutput. The object can be reconstructed usingreadObject(java.io.DataInput)- Parameters:
version- the version number of Geneious that must be able to deserialize this.dataOutput- the DataOutput to write to.progressListener- for reporting progress and allowing the write to be canceled.- Throws:
java.io.IOException- if the write cannot be completed for any reason (including if the progress listener requests the operation be canceled)- Since:
- API 4.600 (Geneious 6.0.0)
-
readObject
public static SequenceCharSequence readObject(GeneiousObjectInputStream inputStream) throws XMLSerializationException
Reconstructs this sequence from data previously created usingwriteObject(GeneiousObjectOutputStream , jebl.util.ProgressListener)- Parameters:
inputStream- the input stream to read this sequence from- Throws:
XMLSerializationException- if there is any sort of problem reading from or reconstructing this instance.
-
readObject
public static SequenceCharSequence readObject(java.io.DataInput dataInput) throws XMLSerializationException
Reconstructs this sequence from data previously created usingwriteObject(java.io.DataOutput, jebl.util.ProgressListener)- Parameters:
dataInput- the DataInput to read this sequence from- Throws:
XMLSerializationException- if there is any sort of problem reading from or reconstructing this instance.- Since:
- API 4.30 (Geneious 5.3.0)
-
countGaps
public int countGaps(int startIndex, int endIndexExclusive)Counts the number of gaps in this sequence between the 2 given positions.- Parameters:
startIndex- the 0-based start index to count from (inclusive)endIndexExclusive- the 0-based end index to stop counting at (exclusive)- Returns:
- the number of gaps in this sequence between the 2 given positions.
- Since:
- API 4.11 (Geneious 5.0)
-
getUngappedLength
public int getUngappedLength()
returns the length of this sequence, excluding any gaps (both internal and end gaps)- Returns:
- the length of this sequence, excluding any gaps (both internal and end gaps)
- Since:
- API 4.40 (Geneious 5.4.0)
-
containsInvalidResidues
public jebl.util.MaybeBoolean containsInvalidResidues(jebl.evolution.sequences.SequenceType sequenceType, boolean allowGaps)performs a quick test to see if this sequence contains possilby contains invalid residues for its sequence type. This is mainly intended for core Geneious usage. Most code should instead useSequenceUtilities.containsInvalidResidues(CharSequence, com.biomatters.geneious.publicapi.documents.sequence.SequenceDocument.Alphabet, boolean, boolean)- Parameters:
sequenceType- the type of sequence it must beallowGaps- true if gaps are allowed in the sequence- Returns:
- whether
- Since:
- API 4.50 (Geneious 5.5.0)
-
-