T - the type of the SequenceScoringParameterSetpublic abstract class SequenceScoringParameterSet<T extends InstantiableFromParameterSet> extends InstanceParameterSet<T>
ParameterSet containing all parameters necessary
to construct an Object that implements
InstantiableFromParameterSet. This parameter set handles the
AlphabetContainer and if necessary the length of a sequence, so it is
well suited as parameter set for AbstractTrainableStatisticalModel and
AbstractClassifier.InstantiableFromParameterSet,
ParameterSet,
AbstractTrainableStatisticalModel,
AbstractClassifierParameterSet.ParameterList| Modifier and Type | Field and Description |
|---|---|
protected Parameter |
alphabet
The alphabet the model works on
|
protected Parameter |
length
The length of sequences the model can work on or
0 for
arbitrary length |
errorMessage, parameters, parent| Constructor and Description |
|---|
SequenceScoringParameterSet(Class<T> instanceClass,
AlphabetContainer.AlphabetContainerType type,
boolean simple)
Constructs an
InstanceParameterSet having empty parameter values. |
SequenceScoringParameterSet(Class<T> instanceClass,
AlphabetContainer.AlphabetContainerType type,
boolean simple,
boolean variableLength)
Constructs a
SequenceScoringParameterSet having empty parameter
values. |
SequenceScoringParameterSet(Class<T> instanceClass,
AlphabetContainer alphabet)
Constructs a
SequenceScoringParameterSet for an object that can
handle sequences of variable length and with the
AlphabetContainer alphabet. |
SequenceScoringParameterSet(Class<T> instanceClass,
AlphabetContainer alphabet,
int length,
boolean variableLength)
Constructs a
SequenceScoringParameterSet from an
AlphabetContainer and the length of a sequence. |
SequenceScoringParameterSet(StringBuffer representation)
The standard constructor for the interface
Storable. |
| Modifier and Type | Method and Description |
|---|---|
SequenceScoringParameterSet<T> |
clone()
Creates a full clone (deep copy) of this
ParameterSet. |
boolean |
equals(Object o) |
protected void |
fromXML(StringBuffer representation)
Parses the instance fields of a
ParameterSet from the XML
representation as returned by ParameterSet.toXML(). |
AlphabetContainer |
getAlphabetContainer()
Returns the
AlphabetContainer of the current instance. |
int |
getLength()
Returns the length of the sequences the model can work on.
|
int |
getNumberOfParameters()
Returns the number of parameters in the
ParameterSet. |
Parameter |
getParameterAt(int i)
Returns the
Parameter at position i. |
boolean |
hasDefaultOrIsSet()
Returns
true if all parameters in this ParameterSet
are either set by the user or have default values. |
void |
reset()
Resets all
Parameters in this ParameterSet to their
default values or null if not default value was provided. |
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
getInstance, getInstanceClass, getInstanceComment, getInstanceNamefromGalaxy, getAllParameterNames, getComment, getComment, getErrorMessage, getIndex, getName, getName, getParameterForName, getParent, initParameterList, initParameterList, isAtomic, isComparable, parametersLoaded, setParent, toGalaxyprotected Parameter alphabet
protected Parameter length
0 for
arbitrary lengthpublic SequenceScoringParameterSet(Class<T> instanceClass, AlphabetContainer.AlphabetContainerType type, boolean simple)
InstanceParameterSet having empty parameter values.
This constructor should only be used if the object can handle sequences
of fixed length.instanceClass - the class of the instancetype - the type of the alphabet(s)simple - determines whether the alphabet should be simpleAlphabetContainer.AlphabetContainerTypepublic SequenceScoringParameterSet(Class<T> instanceClass, AlphabetContainer.AlphabetContainerType type, boolean simple, boolean variableLength)
SequenceScoringParameterSet having empty parameter
values. The user can specify a-priori if the object can handle sequences
of variable lengths. If that is the case the object is not queried from
the user as it is 0 anyway.instanceClass - the (sub-)class of the instancetype - the type of the alphabet(s)simple - determines whether the alphabet should be simplevariableLength - true if the object can handle sequences of
arbitrary length, false otherwiseAlphabetContainer.AlphabetContainerTypepublic SequenceScoringParameterSet(StringBuffer representation) throws NonParsableException
Storable.
Constructs a SequenceScoringParameterSet from its XML
representation. Automatically calls the current implementation of
fromXML(StringBuffer).representation - the XML representation as StringBufferNonParsableException - if the StringBuffer representation could
not be parsedpublic SequenceScoringParameterSet(Class<T> instanceClass, AlphabetContainer alphabet, int length, boolean variableLength) throws Exception
SequenceScoringParameterSet from an
AlphabetContainer and the length of a sequence. This constructor
can be used to implement a SequenceScoringParameterSet that is
already instantiated with known parameter values.instanceClass - the class of the instancealphabet - the AlphabetContainer for a sequencelength - the length of sequencevariableLength - true if the object can handle sequences of
arbitrary length, false otherwiseException - if the alphabets or the length are not in the expected range
of valuespublic SequenceScoringParameterSet(Class<T> instanceClass, AlphabetContainer alphabet) throws Exception
SequenceScoringParameterSet for an object that can
handle sequences of variable length and with the
AlphabetContainer alphabet. This constructor can be
used to implement a SequenceScoringParameterSet that is already
instantiated with known parameter values.
0.instanceClass - the (sub-)class of the instancealphabet - the AlphabetContainer for a sequenceException - if the alphabets or the length are not in the expected range
of valuespublic boolean hasDefaultOrIsSet()
ParameterSettrue if all parameters in this ParameterSet
are either set by the user or have default values. If any additional
constraints are required on your parameters you should either specify
some ParameterValidator on these parameters or implement these
constraints by overriding this method in your implementation of
ParameterSet. It is recommended to specify a useful remark which
constraint failed in the member-variable errorMessage, which
will be displayed to the user. In the overriding method
super.ParameterSet.hasDefaultOrIsSet() should be called prior to
checking specific constraints.hasDefaultOrIsSet in class ParameterSettrue if all parameters have some allowed value set,
false otherwisepublic void reset()
ParameterSetParameters in this ParameterSet to their
default values or null if not default value was provided.reset in class ParameterSetParameter.reset()public AlphabetContainer getAlphabetContainer()
AlphabetContainer of the current instance.AlphabetContainerpublic int getLength()
throws IllegalArgumentException
IllegalArgumentException - if the length is not correct, i.e. the length is not suitable
for the chosen requirementsprotected void fromXML(StringBuffer representation) throws NonParsableException
ParameterSetParameterSet from the XML
representation as returned by ParameterSet.toXML().fromXML in class InstanceParameterSet<T extends InstantiableFromParameterSet>representation - the XML representation as StringBufferNonParsableException - if the XML code could not be parsedParameterSet.toXML()public int getNumberOfParameters()
ParameterSetParameterSet.getNumberOfParameters in class ParameterSetParameterSetpublic Parameter getParameterAt(int i)
ParameterSetParameter at position i.getParameterAt in class ParameterSeti - the position in the ParameterSetParameter at position ipublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.toXML in interface StorabletoXML in class InstanceParameterSet<T extends InstantiableFromParameterSet>public SequenceScoringParameterSet<T> clone() throws CloneNotSupportedException
ParameterSetParameterSet. As a
convenience-method the user can use
fillWithStandardFieldsForClone(ParameterSet) on a newly
created instance of a subclass of ParameterSet to obtain a
clone/copy of all standard member variables (those already defined in
ParameterSet) in the passed ParameterSet. Using this
method, the cloning process becomes merely three-step:ParameterSet, most
likely with an empty constructor or the one taking just the instance
class.
this.fillWithStandardFieldsForClone on this
instance.
Object's method
Object.clone().clone in class ParameterSetParameterSetCloneNotSupportedException