|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.upenn.gloDB.Sequence
public class Sequence
Sequence.
Field Summary | |
---|---|
private java.util.HashMap |
attributes
Metadata related to the sequence. |
private byte[] |
cData
|
private java.lang.String |
data
The sequence raw data as an unformatted string. |
private int |
dataLength
|
private boolean |
dataLoaded
This is a flag for whether data has been loaded. |
private SequenceLoader |
dataLoader
This is the object that will handle getting the data for this Sequence. |
static int |
FORMAT_WIDTH
This is the number of characters to print out per line when formatting the output in getDataFormatted(). |
private java.lang.String |
id
This is a unique name for the sequence, that is used by the parser to identify the sequence. |
private java.util.HashMap |
loaderArgs
This is a map of key:value pairs needed to load the data from the data source, as defined by 'dataLoader': URL, file, database, etc. |
private int |
offset
This is the starting position for this Sequence on the chromosome. |
private static java.util.Random |
random
Used to create random ids. |
static boolean |
USE_COMPRESSION
When true then sequence data will be stored in the Sequence object in a compressed format. |
Constructor Summary | |
---|---|
Sequence()
Create a new Sequence object and add it to the set of Sequence objects. |
|
Sequence(boolean addToPool)
Create a new Sequence object and add the newly created Sequence object to the set of sequence objects if addToPool is true. |
|
Sequence(boolean addToPool,
java.lang.String id)
Create a new Sequence object and add the newly created Sequence object to the set of sequence objects if addToPool is true. |
|
Sequence(java.lang.String id)
Create a new Sequence object with the specified id, and add it to the set of Sequence objects. |
Method Summary | |
---|---|
void |
addAttribute(java.lang.Object key,
java.lang.Object value)
Add a sequence attribute. |
void |
addLoaderArg(java.lang.Object key,
java.lang.Object value)
Add a sequence parserArg. |
boolean |
contains(Feature feature)
Returns 'true' if 'feature' is contained in this Sequence object. |
boolean |
contains(int pos)
Returns 'true' if the position 'pos' is contained in this Sequence object. |
boolean |
containsAttribute(java.lang.Object key)
Returns true if attribute 'key' exists. |
void |
delAttribute(java.lang.Object key)
Remove an attribute. |
java.lang.Object |
getAttribute(java.lang.Object key)
Get a sequence attribute. |
java.util.HashMap |
getAttributes()
Get the sequence attributes. |
java.lang.String |
getData()
Returns the Sequence data as a single unformatted string. |
java.lang.String |
getDataBounded(int min,
int max)
Returns the sequence data between position '(min-1)' and position 'max'. |
java.lang.String |
getDataBoundedFormatted(int min,
int max)
Returns the bounded sequence data with "\n" inserted every FORMAT_WIDTH characters. |
java.lang.String |
getDataFormatted()
Returns the sequence data with "\n" inserted every FORMAT_WIDTH characters. |
SequenceLoader |
getDataLoader()
Returns the parser for the Sequence source. |
java.lang.String |
getID()
Get the id. |
java.lang.Object |
getLoaderArg(java.lang.Object key)
Get a sequence parserArg. |
java.util.HashMap |
getLoaderArgs()
Get the sequence loaderArgs. |
int |
getMax()
Returns the maximum position of the Sequence on the chromosome. |
int |
getMin()
Returns the initial position of the Sequence on the chromosome. |
int |
getOffset()
Returns the Sequence starting position on the chromosome. |
int |
getType()
Returns Feature type (see GloDBUtils) |
boolean |
isDataLoaded()
Returns true if data was loaded. |
int |
length()
Returns the length of the data string. |
java.lang.String |
loadData()
This will load the data from 'dataLoader' if data is currently empty. |
static java.lang.String |
randomID(java.lang.String base)
|
void |
reloadData()
This will load the data from 'dataLoader' if overwriting the current value of data. |
void |
setAttributes(java.util.HashMap attributes)
Set the sequence attributes. |
void |
setData(java.lang.String data)
Set the Sequence data, expecting a single unformatted string. |
void |
setDataLoader(SequenceLoader dataLoader)
Set the Sequence source parser. |
void |
setLoaderArgs(java.util.HashMap loaderArgs)
Set the sequence loaderArgs. |
void |
setOffset(int offset)
Set the Sequence starting position on the chromosome. |
java.lang.String |
toString()
Returns attributes information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int FORMAT_WIDTH
public static boolean USE_COMPRESSION
private java.lang.String id
private SequenceLoader dataLoader
private java.util.HashMap loaderArgs
private boolean dataLoaded
private int offset
private java.util.HashMap attributes
private java.lang.String data
private byte[] cData
private int dataLength
private static java.util.Random random
Constructor Detail |
---|
public Sequence()
public Sequence(java.lang.String id)
public Sequence(boolean addToPool)
public Sequence(boolean addToPool, java.lang.String id)
Method Detail |
---|
public int getType()
public java.lang.String getID()
public void setDataLoader(SequenceLoader dataLoader)
public SequenceLoader getDataLoader()
public void setLoaderArgs(java.util.HashMap loaderArgs)
public java.util.HashMap getLoaderArgs()
public void addLoaderArg(java.lang.Object key, java.lang.Object value)
public java.lang.Object getLoaderArg(java.lang.Object key)
public boolean isDataLoaded()
public void setOffset(int offset)
public int getOffset()
public void setData(java.lang.String data)
public java.lang.String getData()
public void setAttributes(java.util.HashMap attributes)
public java.util.HashMap getAttributes()
public void addAttribute(java.lang.Object key, java.lang.Object value)
public void delAttribute(java.lang.Object key)
public boolean containsAttribute(java.lang.Object key)
public java.lang.Object getAttribute(java.lang.Object key)
public void reloadData()
public java.lang.String loadData()
public int length()
public int getMin()
public int getMax()
public boolean contains(int pos)
public boolean contains(Feature feature)
public java.lang.String getDataBounded(int min, int max)
min
- the starting positionmax
- the ending positionpublic java.lang.String getDataBoundedFormatted(int min, int max)
public java.lang.String getDataFormatted()
public static java.lang.String randomID(java.lang.String base)
public java.lang.String toString()
getData()
or getDataFormatted()
.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |