public final class DocumentSelectionSignature extends Object implements XMLSerializable
DocumentSelectionSignature.forNucleotideSequences(2,Integer.MAX_VALUE).
Geneious then handles correctly enabled/disabling the operation depending on what is selected and only invoking
the operation with a valid selection of documents.| Modifier and Type | Class and Description |
|---|---|
static class |
DocumentSelectionSignature.DocumentSelectionSignatureAtom
A signature is a set of Atoms.
|
XMLSerializable.OldVersionCompatible, XMLSerializable.VersionSupportTypeROOT_ELEMENT_NAME| Constructor and Description |
|---|
DocumentSelectionSignature(Class classOfSelected,
int from,
int to)
convenience constructor for accepting a single class repeated a certain number of times.
|
DocumentSelectionSignature(DocumentSelectionSignature.DocumentSelectionSignatureAtom a)
convenience constructor.
|
DocumentSelectionSignature(DocumentSelectionSignature.DocumentSelectionSignatureAtom[] atoms)
construct signature from given atoms.
|
DocumentSelectionSignature(org.jdom.Element element)
XML deserialization constructor
|
| Modifier and Type | Method and Description |
|---|---|
static DocumentSelectionSignature |
forNucleotideAlignment(int minimumNumberOfSequences,
int maximumNumberOfSequences)
Creates a selection signature that matches a single alignment that contains a specified range of nucleotide sequences.
|
static DocumentSelectionSignature |
forNucleotideAlignments(int minimumNumberOfAlignments,
int maximumNumberOfAlignments)
Creates a selection signature that matches a number of nucleotide
SequenceAlignmentDocuments within the given range. |
static DocumentSelectionSignature |
forNucleotideAndProteinSequences(int minimumNumberOfNucleotideSequences,
int maximumNumberOfNucleotideSequences,
int minimumNumberOfProteinSequences,
int maximumNumberOfProteinSequences,
boolean allowSequencesInAlignments)
Creates a selection signature that matches any combination of
SequenceListDocument,
SequenceAlignmentDocument (if allowSequencesInAlignments is true),
NucleotideSequenceDocument
and AminoAcidSequenceDocument
such that the total number of nucleotide sequences they contain is within the given range and the total number of
protein sequences is also within the range. |
static DocumentSelectionSignature |
forNucleotideSequences(int minimumNumberOfSequences,
int maximumNumberOfSequences)
Creates a selection signature that matches any combination of
SequenceListDocument
and NucleotideSequenceDocument
such that the total number of nucleotide sequences they contain is within the given range. |
static DocumentSelectionSignature |
forNucleotideSequences(int minimumNumberOfSequences,
int maximumNumberOfSequences,
boolean allowSequencesInAlignments)
Creates a selection signature that matches any combination of
SequenceListDocument,
SequenceAlignmentDocument (if allowSequencesInAlignments is true)
and NucleotideSequenceDocument
such that the total number of nucleotide sequences they contain is within the given range, and there are no protein sequences. |
static DocumentSelectionSignature |
forNucleotideSequencesAndAlignments(int minimumNumberOfSequences,
int maximumNumberOfSequences,
int minimumNumberOfAlignments,
int maximumNumberOfAlignments)
Creates a selection signature that matches any combination of
SequenceListDocument,
and NucleotideSequenceDocument
such that the total number of nucleotide sequences they contain is within the given range, and there are no protein sequences. |
static DocumentSelectionSignature |
forProteinAlignment(int minimumNumberOfSequences,
int maximumNumberOfSequences)
Creates a selection signature that matches a single alignment that contains a specified range of protein sequences.
|
static DocumentSelectionSignature |
forProteinAlignments(int minimumNumberOfAlignments,
int maximumNumberOfAlignments)
Creates a selection signature that matches a number of protein
SequenceAlignmentDocuments within the given range |
static DocumentSelectionSignature |
forProteinSequences(int minimumNumberOfSequences,
int maximumNumberOfSequences)
Creates a selection signature that matches any combination of
SequenceListDocument and AminoAcidSequenceDocument
such that the total number of protein sequences they contain is within the given range. |
static DocumentSelectionSignature |
forProteinSequences(int minimumNumberOfSequences,
int maximumNumberOfSequences,
boolean allowSequencesInAlignments)
Creates a selection signature that matches any combination of
SequenceListDocument,
SequenceAlignmentDocument (if allowSequencesInAlignments is true)
and AminoAcidSequenceDocument
such that the total number of protein sequences they contain is within the given range, and there are no nucleotide sequences. |
static DocumentSelectionSignature |
forProteinSequencesAndAlignments(int minimumNumberOfSequences,
int maximumNumberOfSequences,
int minimumNumberOfAlignments,
int maximumNumberOfAlignments)
Creates a selection signature that matches any combination of
SequenceListDocument,
and AminoAcidSequenceDocument
such that the total number of protein sequences they contain is within the given range, and there are no nucleotide sequences,
plus a number of protein SequenceAlignmentDocuments within the given range |
void |
fromXML(org.jdom.Element element)
Restore the object from the JDOM Element returned by
XMLSerializable.toXML(). |
SequenceType |
getAlignmentSequenceType() |
int |
getNucleotideSequenceMaximum()
get the maximum number of nucleotide sequences this signature accepts, if it is a signature created using forNucleotideSequences() or forNucleotideAndProteinSequences()
|
int |
getNucleotideSequenceMinimum()
get the minimum number of nucleotide sequences this signature accepts, if it is a signature created using forNucleotideSequences() or forNucleotideAndProteinSequences()
|
int |
getProteinSequenceMaximum()
get the maximum number of protein sequences this signature accepts, if it is a signature created using forProteinSequences() or forNucleotideAndProteinSequences()
|
int |
getProteinSequenceMinimum()
get the minimum number of protein sequences this signature accepts, if it is a signature created using forProteinSequences() or forNucleotideAndProteinSequences()
|
int |
getSequencesInAlignmentMaximum() |
int |
getSequencesInAlignmentMinimum() |
DocumentSelectionSignature.DocumentSelectionSignatureAtom[] |
getSignature()
Get the signature.
|
boolean |
isAllowSequencesInNucleotideAlignments()
get whether a signature created forNucleotideSequences() or forNucleotideAndProteinSequences() allows sequences in alignments as well as from stand-alone sequences
|
boolean |
isAllowSequencesInProteinAlignments()
get whether a signature created using forProteinSequences() or forNucleotideAndProteinSequences() allows sequences in alignments as well as from stand-alone sequences
|
static boolean |
isMoreGeneral(DocumentSelectionSignature[] potentiallyMoreGeneralSignatures,
DocumentSelectionSignature[] potentiallyMoreSpecificSignatures)
Returns true if all possible documents accepted by potentiallyMoreSpecificSignatures will also be accepted by potentiallyMoreGeneralSignatures.
|
boolean |
isNucleotideSequenceSignature()
get whether this signature was created using forNucleotideSequences() or forNucleotideAndProteinSequences()
|
boolean |
isProteinSequenceSignature()
get whether this signature was created using forProteinSequences() or forNucleotideAndProteinSequences()
|
static boolean |
matches(DocumentSelectionSignature[] signatures,
Class[] classes)
Deprecated.
|
static boolean |
matches(DocumentSelectionSignature[] signatures,
List<? extends AnnotatedPluginDocument> documents) |
boolean |
matches(List<? extends AnnotatedPluginDocument> documents)
Check whether this selection signature matches these documents.
|
String |
toString() |
org.jdom.Element |
toXML()
Convert object to a JDOM element.
|
public DocumentSelectionSignature(org.jdom.Element element)
throws XMLSerializationException
element - an element returned from a previous call to toXML()XMLSerializationExceptionpublic DocumentSelectionSignature(DocumentSelectionSignature.DocumentSelectionSignatureAtom[] atoms)
atoms - signature parts.public DocumentSelectionSignature(DocumentSelectionSignature.DocumentSelectionSignatureAtom a)
a - single selection atom.public DocumentSelectionSignature(Class classOfSelected, int from, int to)
classOfSelected - class of selected documentsfrom - lower bound of number of documents (from 0 to Integer.MAX_VALUE)to - upper bound of number of documents (from 0 to Integer.MAX_VALUE, must be greater than or equal to from)public org.jdom.Element toXML()
XMLSerializableXMLSerializable.fromXML(org.jdom.Element) can completely
restore the objects representation.
It is recommended that the returned element use XMLSerializable.ROOT_ELEMENT_NAME as its name,
in which case it must not define an attribute called "type". In this case,
fromXML, will be called with an element whose name may differ from the element
return from this function. This recommendation allows a more compact representation
of the XML can be stored.
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classToXML(String, XMLSerializable)
which calls this method internally.
PluginDocument implementations of this method may choose to throw an XMLSerializationException,
enclosed in a RuntimeException.toXML in interface XMLSerializablepublic void fromXML(org.jdom.Element element)
throws XMLSerializationException
XMLSerializableXMLSerializable.toXML().
This method generally should not be called directly. Instead, you should usually call
XMLSerializer.classFromXML(org.jdom.Element)
or XMLSerializer.classFromXML(org.jdom.Element, Class)
which calls this method internally.
It is optional to implement this method. Instead of implementing an empty constructor and implementing
this method properly, the implementation may instead
throw an UnsupportedOperationException and implement a constructor
that takes a single Element as a parameter.
This allows for cleaner code such as support for final fields in the XMLSerializable class.
The element parameter should not be modified since it may be reused. If you need a modified version of it,
take a copy with Element.clone().fromXML in interface XMLSerializableelement - representation from a previous call to XMLSerializable.toXML()XMLSerializationException - if the Element can't be converted into this type of objectpublic static DocumentSelectionSignature forNucleotideSequences(int minimumNumberOfSequences, int maximumNumberOfSequences)
SequenceListDocument
and NucleotideSequenceDocument
such that the total number of nucleotide sequences they contain is within the given range. If an operation uses this selection signature, it must
be prepared to accept SequenceListDocuments as input (i.e. Geneious won't split the sequence list into stand-alone sequences for input to the operation).minimumNumberOfSequences - the minimum (inclusive) number of nucleotide sequences to match.maximumNumberOfSequences - the maximum (inclusive) number of nucleotide sequences to match.public static DocumentSelectionSignature forNucleotideSequences(int minimumNumberOfSequences, int maximumNumberOfSequences, boolean allowSequencesInAlignments)
SequenceListDocument,
SequenceAlignmentDocument (if allowSequencesInAlignments is true)
and NucleotideSequenceDocument
such that the total number of nucleotide sequences they contain is within the given range, and there are no protein sequences.minimumNumberOfSequences - the minimum (inclusive) number of nucleotide sequences to match.maximumNumberOfSequences - the maximum (inclusive) number of nucleotide sequences to match.allowSequencesInAlignments - whether to allow sequences in alignments as well as stand-alone sequences. If you want a signature that just matches an alignment, use forNucleotideAlignment(int, int) instead.public boolean isNucleotideSequenceSignature()
public boolean isProteinSequenceSignature()
public int getNucleotideSequenceMinimum()
IllegalStateException - if the signature was not created using forNucleotideSequences() or forNucleotideAndProteinSequences();public int getNucleotideSequenceMaximum()
IllegalStateException - if the signature was not created using forNucleotideSequences() or forNucleotideAndProteinSequences();public int getProteinSequenceMinimum()
IllegalStateException - if the signature was not created using forProteinSequences() or forNucleotideAndProteinSequences();public int getProteinSequenceMaximum()
IllegalStateException - if the signature was not created using forProteinSequences() or forNucleotideAndProteinSequences();public boolean isAllowSequencesInNucleotideAlignments()
IllegalStateException - if the signature was not created using forNucleotideSequences() or forNucleotideAndProteinSequences();public boolean isAllowSequencesInProteinAlignments()
IllegalStateException - if the signature was not created using forProteinSequences() or forNucleotideAndProteinSequences();public static DocumentSelectionSignature forNucleotideSequencesAndAlignments(int minimumNumberOfSequences, int maximumNumberOfSequences, int minimumNumberOfAlignments, int maximumNumberOfAlignments)
SequenceListDocument,
and NucleotideSequenceDocument
such that the total number of nucleotide sequences they contain is within the given range, and there are no protein sequences.
plus a number of nucleotide SequenceAlignmentDocuments within the given rangeminimumNumberOfSequences - the minimum (inclusive) number of nucleotide sequences to match.maximumNumberOfSequences - the maximum (inclusive) number of nucleotide sequences to match.minimumNumberOfAlignments - the minimum (inclusive) number of nucleotide alignments to match.maximumNumberOfAlignments - the maximum (inclusive) number of nucleotide alignments to match.public static DocumentSelectionSignature forNucleotideAlignments(int minimumNumberOfAlignments, int maximumNumberOfAlignments)
SequenceAlignmentDocuments within the given range. Note that if this is being used on a SequenceAnnotationGenerator then the generator must implement
SequenceAnnotationGenerator.generateOnAlignments
instead of the usual SequenceAnnotationGenerator.generateminimumNumberOfAlignments - the minimum (inclusive) number of nucleotide alignments to match.maximumNumberOfAlignments - the maximum (inclusive) number of nucleotide alignments to match.public static DocumentSelectionSignature forProteinSequences(int minimumNumberOfSequences, int maximumNumberOfSequences, boolean allowSequencesInAlignments)
SequenceListDocument,
SequenceAlignmentDocument (if allowSequencesInAlignments is true)
and AminoAcidSequenceDocument
such that the total number of protein sequences they contain is within the given range, and there are no nucleotide sequences.minimumNumberOfSequences - the minimum (inclusive) number of protein sequences to match.maximumNumberOfSequences - the maximum (inclusive) number of protein sequences to match.allowSequencesInAlignments - whether to allow sequences in alignments as well as stand-alone sequences. If you want a signature that just matches an alignment, use forProteinAlignment(int, int) insteadpublic static DocumentSelectionSignature forProteinSequences(int minimumNumberOfSequences, int maximumNumberOfSequences)
SequenceListDocument and AminoAcidSequenceDocument
such that the total number of protein sequences they contain is within the given range. If an operation uses this selection signature, it must
be prepared to accept SequenceListDocuments as input (i.e. Geneious won't split the sequence list into stand-alone sequences for input to the operation).minimumNumberOfSequences - the minimum (inclusive) number of protein sequences to match.maximumNumberOfSequences - the maximum (inclusive) number of protein sequences to match.public static DocumentSelectionSignature forProteinSequencesAndAlignments(int minimumNumberOfSequences, int maximumNumberOfSequences, int minimumNumberOfAlignments, int maximumNumberOfAlignments)
SequenceListDocument,
and AminoAcidSequenceDocument
such that the total number of protein sequences they contain is within the given range, and there are no nucleotide sequences,
plus a number of protein SequenceAlignmentDocuments within the given rangeminimumNumberOfSequences - the minimum (inclusive) number of protein sequences to match.maximumNumberOfSequences - the maximum (inclusive) number of protein sequences to match.minimumNumberOfAlignments - the minimum (inclusive) number of protein alignments to match.maximumNumberOfAlignments - the maximum (inclusive) number of protein alignments to match.public static DocumentSelectionSignature forProteinAlignments(int minimumNumberOfAlignments, int maximumNumberOfAlignments)
SequenceAlignmentDocuments within the given rangeminimumNumberOfAlignments - the minimum (inclusive) number of protein alignments to match.maximumNumberOfAlignments - the maximum (inclusive) number of protein alignments to match.public static DocumentSelectionSignature forNucleotideAndProteinSequences(int minimumNumberOfNucleotideSequences, int maximumNumberOfNucleotideSequences, int minimumNumberOfProteinSequences, int maximumNumberOfProteinSequences, boolean allowSequencesInAlignments)
SequenceListDocument,
SequenceAlignmentDocument (if allowSequencesInAlignments is true),
NucleotideSequenceDocument
and AminoAcidSequenceDocument
such that the total number of nucleotide sequences they contain is within the given range and the total number of
protein sequences is also within the range.minimumNumberOfNucleotideSequences - the minimum (inclusive) number of nucleotide sequences to match. May be 0.maximumNumberOfNucleotideSequences - the maximum (inclusive) number of nucleotide sequences to match.minimumNumberOfProteinSequences - the minimum (inclusive) number of protein sequences to match. May be 0.maximumNumberOfProteinSequences - the maximum (inclusive) number of protein sequences to match.allowSequencesInAlignments - whether to allow sequences in alignments
SequenceListDocuments that are not of the right typepublic static DocumentSelectionSignature forNucleotideAlignment(int minimumNumberOfSequences, int maximumNumberOfSequences)
minimumNumberOfSequences - the minimum (inclusive) number of sequences the alignment must containmaximumNumberOfSequences - the maximum (inclusive) number of sequences the alignment must containpublic static DocumentSelectionSignature forProteinAlignment(int minimumNumberOfSequences, int maximumNumberOfSequences)
minimumNumberOfSequences - the minimum (inclusive) number of sequences the alignment must containmaximumNumberOfSequences - the maximum (inclusive) number of sequences the alignment must containpublic DocumentSelectionSignature.DocumentSelectionSignatureAtom[] getSignature()
public boolean matches(List<? extends AnnotatedPluginDocument> documents)
documents - the documents to check against. null is equivalent to an empty document list.public static boolean matches(DocumentSelectionSignature[] signatures, List<? extends AnnotatedPluginDocument> documents)
signatures - the signatures to be matcheddocuments - the documents to be matched. null is equivalent to an empty document list.public static boolean isMoreGeneral(DocumentSelectionSignature[] potentiallyMoreGeneralSignatures, DocumentSelectionSignature[] potentiallyMoreSpecificSignatures)
potentiallyMoreGeneralSignatures - the signatures to see if they are more general than the other onespotentiallyMoreSpecificSignatures - the signatures to see if they are more specific than the other ones@Deprecated public static boolean matches(DocumentSelectionSignature[] signatures, Class[] classes)
matches(DocumentSelectionSignature[], java.util.List) instead.signatures - the signatures to be matchedclasses - the classes to be matchedpublic SequenceType getAlignmentSequenceType()
forNucleotideAlignment(int, int) or forProteinAlignment(int, int) or null if it was created using neither of these signaturespublic int getSequencesInAlignmentMinimum()
forNucleotideAlignment(int, int) or forProteinAlignment(int, int).
You can determine if this signature was created using either of these via getAlignmentSequenceType()public int getSequencesInAlignmentMaximum()
forNucleotideAlignment(int, int) or forProteinAlignment(int, int).
You can determine if this signature was created using either of these via getAlignmentSequenceType()