|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.data.sequences.Sequence<float[]>
de.jstacs.data.sequences.ArbitraryFloatSequence
public class ArbitraryFloatSequence
This class is for any continuous or hybrid sequence.
In contrast to ArbitrarySequence
s, the numeric values are represented by float
s instead of double
s.
This may be useful if either the represented data are known to be only of float
precision or if double
precision is dispensible
for the sake of memory consumption.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.jstacs.data.sequences.Sequence |
---|
Sequence.CompositeSequence<T>, Sequence.RecursiveSequence<T>, Sequence.SubSequence<T> |
Field Summary |
---|
Fields inherited from class de.jstacs.data.sequences.Sequence |
---|
alphabetCon, annotation, rc |
Constructor Summary | |
---|---|
ArbitraryFloatSequence(AlphabetContainer alphabetContainer,
float[] content)
Creates a new ArbitraryFloatSequence from an array of
float -encoded alphabet symbols. |
|
ArbitraryFloatSequence(AlphabetContainer alphabetContainer,
SequenceAnnotation[] annotation,
String sequence,
String delim)
Creates a new ArbitraryFloatSequence from a String
representation using the delimiter delim . |
|
ArbitraryFloatSequence(AlphabetContainer alphabetContainer,
SequenceAnnotation[] annotation,
SymbolExtractor extractor)
Creates a new ArbitraryFloatSequence from a SymbolExtractor . |
|
ArbitraryFloatSequence(AlphabetContainer alphabetContainer,
String sequence)
Creates a new ArbitraryFloatSequence from a String
representation using the default delimiter. |
Method Summary | |
---|---|
protected void |
addToRepresentation(Object representation,
int pos,
String delim)
This method adds the information of one position to the representation using the specified delimiter |
int |
compareTo(float[] t1,
float[] t2)
This method compares to container and is used in Sequence.compareTo(Sequence) . |
double |
continuousVal(int pos)
Returns the continuous value at position pos of the
Sequence . |
int |
discreteVal(int pos)
Returns the discrete value at position pos of the
Sequence . |
void |
fillContainer(float[] container,
int pos)
The method fills the content of a specific position in to the container. |
protected ArbitraryFloatSequence |
flatCloneWithoutAnnotation()
Works in analogy to Object.clone() , but does not clone the
annotation. |
static DataSet |
getDataSet(AlphabetContainer con,
AbstractStringExtractor... se)
This method allows to create a DataSet containing ArbitraryFloatSequence s. |
static DataSet |
getDataSet(AlphabetContainer con,
String filename)
This method allows to create a DataSet containing ArbitraryFloatSequence s using
a file name. |
static DataSet |
getDataSet(AlphabetContainer con,
String filename,
SequenceAnnotationParser parser)
This method allows to create a DataSet containing ArbitraryFloatSequence s using
a file name. |
float[] |
getEmptyContainer()
The method returns a container that can be used for accessing the symbols for each position. |
protected Object |
getEmptyRepresentation()
Returns an empty representation which is used to create the String representation of this instance in the method Sequence.toString(String, int, int) . |
int |
getLength()
Returns the length of the Sequence . |
protected String |
getStringRepresentation(Object representation)
This method creates a String representation from the given representation. |
protected int |
hashCodeForPos(int pos)
This method is used in Sequence.hashCode() and the hash code for one specific position. |
boolean |
isMultiDimensional()
The method returns true if the sequence is multidimensional, otherwise . |
Methods inherited from class de.jstacs.data.sequences.Sequence |
---|
annotate, compareTo, complement, complement, create, create, create, equals, getAlphabetContainer, getAnnotation, getCompositeSequence, getCompositeSequence, getHammingDistance, getNumberOfSequenceAnnotationsByType, getSequenceAnnotationByType, getSequenceAnnotationByTypeAndIdentifier, getSubSequence, getSubSequence, getSubSequence, getSubSequence, hashCode, matches, reverse, reverse, reverseComplement, reverseComplement, toDiscrete, toString, toString, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ArbitraryFloatSequence(AlphabetContainer alphabetContainer, float[] content) throws WrongAlphabetException, WrongSequenceTypeException
ArbitraryFloatSequence
from an array of
float
-encoded alphabet symbols. This constructor is
designed for the method
StatisticalModel.emitDataSet(int, int...)
.
alphabetContainer
- the AlphabetContainer
for the sequencecontent
- an array containing the encoded symbols
WrongAlphabetException
- if the sequence is not defined over
alphabetContainer
WrongSequenceTypeException
- if alphabetContainer
contains alphabets that can
not be encoded with float
sStatisticalModel.emitDataSet(int, int...)
,
Sequence.Sequence(AlphabetContainer, SequenceAnnotation[])
public ArbitraryFloatSequence(AlphabetContainer alphabetContainer, String sequence) throws WrongAlphabetException, WrongSequenceTypeException
ArbitraryFloatSequence
from a String
representation using the default delimiter.
alphabetContainer
- the AlphabetContainer
for the sequencesequence
- a String
representation of the sequence
WrongAlphabetException
- if the sequence is not defined over
alphabetContainer
WrongSequenceTypeException
- if alphabetContainer
contains alphabets that can
not be encoded with float
sArbitraryFloatSequence(AlphabetContainer, SequenceAnnotation[], SymbolExtractor)
public ArbitraryFloatSequence(AlphabetContainer alphabetContainer, SequenceAnnotation[] annotation, String sequence, String delim) throws WrongAlphabetException, WrongSequenceTypeException, IllegalArgumentException
ArbitraryFloatSequence
from a String
representation using the delimiter delim
. Annotations for
this sequence are considered by annotation
.
alphabetContainer
- the AlphabetContainer
for the sequenceannotation
- the annotation for this sequencesequence
- a String
representation of the sequencedelim
- the delimiter, a String
that separates the symbols
WrongAlphabetException
- if the sequence is not defined over
alphabetContainer
WrongSequenceTypeException
- if alphabetContainer
contains alphabets that can
not be encoded with float
s
IllegalArgumentException
- if the delimiter is empty and the alphabet container is not
discreteArbitraryFloatSequence(AlphabetContainer, SequenceAnnotation[], SymbolExtractor)
public ArbitraryFloatSequence(AlphabetContainer alphabetContainer, SequenceAnnotation[] annotation, SymbolExtractor extractor) throws WrongAlphabetException, WrongSequenceTypeException
ArbitraryFloatSequence
from a SymbolExtractor
.
Annotations for this sequence are considered by annotation
.
alphabetContainer
- the alphabet container for the sequenceannotation
- the annotation for this sequenceextractor
- the SymbolExtractor
WrongAlphabetException
- if the sequence is not defined over
alphabetContainer
WrongSequenceTypeException
- if alphabetContainer
contains alphabets that can
not be encoded with float
sSequence.Sequence(AlphabetContainer, SequenceAnnotation[])
Method Detail |
---|
public double continuousVal(int pos)
Sequence
pos
of the
Sequence
.
continuousVal
in class Sequence<float[]>
pos
- the position of the Sequence
pos
of the
Sequence
public int discreteVal(int pos)
Sequence
pos
of the
Sequence
.
discreteVal
in class Sequence<float[]>
pos
- the position of the Sequence
pos
of the
Sequence
public int getLength()
Sequence
Sequence
.
getLength
in class Sequence<float[]>
Sequence
protected ArbitraryFloatSequence flatCloneWithoutAnnotation()
Sequence
Object.clone()
, but does not clone the
annotation. This method is used in
Sequence.annotate(boolean, SequenceAnnotation...)
.
flatCloneWithoutAnnotation
in class Sequence<float[]>
Sequence
without annotationpublic boolean isMultiDimensional()
Sequence
true
if the sequence is multidimensional, otherwise .
isMultiDimensional
in class Sequence<float[]>
true
if the sequence is multidimensional, otherwise
public float[] getEmptyContainer()
Sequence
getEmptyContainer
in class Sequence<float[]>
Sequence.fillContainer(Object, int)
,
Sequence.isMultiDimensional()
public void fillContainer(float[] container, int pos)
Sequence
fillContainer
in class Sequence<float[]>
container
- the container which is used for filling the content.pos
- the positionSequence.getEmptyContainer()
,
Sequence.isMultiDimensional()
public int compareTo(float[] t1, float[] t2)
Sequence
Sequence.compareTo(Sequence)
.
compareTo
in class Sequence<float[]>
t1
- the first containert2
- the second container
Sequence.getEmptyContainer()
,
Sequence.fillContainer(Object, int)
,
Comparable.compareTo(java.lang.Object)
protected Object getEmptyRepresentation()
Sequence
String
representation of this instance in the method Sequence.toString(String, int, int)
.
getEmptyRepresentation
in class Sequence<float[]>
String
representationSequence.toString(String, int, int)
protected void addToRepresentation(Object representation, int pos, String delim)
Sequence
addToRepresentation
in class Sequence<float[]>
representation
- the representationpos
- the positiondelim
- the delimiter separating the information for different positionsSequence.getEmptyRepresentation()
,
Sequence.toString(String, int, int)
protected String getStringRepresentation(Object representation)
Sequence
getStringRepresentation
in class Sequence<float[]>
representation
- the representation instance (which should be created by Sequence.getEmptyContainer()
and filled by Sequence.addToRepresentation(Object, int, String)
)
Sequence.getEmptyRepresentation()
,
Sequence.addToRepresentation(Object, int, String)
,
Sequence.toString(String, int, int)
protected int hashCodeForPos(int pos)
Sequence
Sequence.hashCode()
and the hash code for one specific position.
hashCodeForPos
in class Sequence<float[]>
pos
- the position
public static DataSet getDataSet(AlphabetContainer con, String filename, SequenceAnnotationParser parser) throws FileNotFoundException, WrongAlphabetException, WrongSequenceTypeException, EmptyDataSetException, IOException
DataSet
containing ArbitraryFloatSequence
s using
a file name. Annotations are parsed by the supplied SequenceAnnotationParser
. The file is
assumed to be in FastA format.
con
- the AlphabetContainer
for the DataSet
and ArbitraryFloatSequence
sfilename
- the file nameparser
- a parser for the annotations of the ArbitraryFloatSequence
s
DataSet
containing ArbitraryFloatSequence
s
FileNotFoundException
- if the file filename
could not be found
WrongAlphabetException
- if the alphabet does not fit the data
WrongSequenceTypeException
- if the data can not be represented as floats
EmptyDataSetException
- if not sequences exist in filename
IOException
- if the file could not be readpublic static DataSet getDataSet(AlphabetContainer con, String filename) throws FileNotFoundException, WrongAlphabetException, WrongSequenceTypeException, EmptyDataSetException, IOException
DataSet
containing ArbitraryFloatSequence
s using
a file name.
con
- the AlphabetContainer
for the DataSet
and ArbitraryFloatSequence
sfilename
- the file name
DataSet
containing ArbitraryFloatSequence
s
FileNotFoundException
- if the file filename
could not be found
WrongAlphabetException
- if the alphabet does not fit the data
WrongSequenceTypeException
- if the data can not be represented as floats
EmptyDataSetException
- if not sequences exist in filename
IOException
- if the file could not be readpublic static DataSet getDataSet(AlphabetContainer con, AbstractStringExtractor... se) throws WrongAlphabetException, WrongSequenceTypeException, EmptyDataSetException
DataSet
containing ArbitraryFloatSequence
s.
con
- the AlphabetContainer
for the DataSet
and ArbitraryFloatSequence
sse
- the AbstractStringExtractor
s that handle the DataSet
as String
DataSet
containing ArbitraryFloatSequence
s
WrongAlphabetException
- if the alphabet does not fit the data
WrongSequenceTypeException
- if the data can not be represented as floats
EmptyDataSetException
- if a DataSet
with 0 (zero) ArbitraryFloatSequence
s should be created
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |