public abstract class AbstractMolecule extends AbstractMarsRecord implements Molecule
MoleculeArchive
s to allow for fast and efficient retrieval and
optimal organization.
Molecule records are designed to allow for storage of many different kinds of
single-molecule time-series data. They contain a primary MarsTable
with molecule properties typically with each row containing features of a
given time point. This may include position or intensity information. To
facilitate efficient and reproducible processing molecule records may also
contain calculated parameters, tags, notes, and kinetic change point segment
MarsTable
s generated by KCPCommand
. Molecule records are
assigned a random UID string at the time of creation derived from a base58
encoded UUID for readability. This serves as their primary identifier within
MoleculeArchive
s and for a range of transformations and merging
operations. Molecule records also have a UID string for corresponding
MarsMetadata
records, which contain the experiments metadata
information from.
Molecule records can be saved to Json for storage when done processing. They are then either stored as an array within MoleculeArchive .yama files or as individual sml or json files within .yama.store directories.
parent
Constructor and Description |
---|
AbstractMolecule()
Constructor for creating an empty Molecule record.
|
AbstractMolecule(com.fasterxml.jackson.core.JsonParser jParser)
Constructor for loading a Molecule record from a file.
|
AbstractMolecule(java.lang.String UID)
Constructor for creating an empty Molecule record with the specified UID.
|
AbstractMolecule(java.lang.String UID,
MarsTable table)
Constructor for creating a new Molecule record with the specified UID and
the
MarsTable given as the DataTable. |
Modifier and Type | Method and Description |
---|---|
void |
addTag(java.lang.String tag)
Add a string tag to the record.
|
protected void |
createIOMaps()
Must be implemented in subclasses to define how fields, objects, arrays
should be saved based on the Jackson streaming API.
|
int |
getChannel()
Get the channel for these molecules.
|
int |
getImage()
Get the image index for this molecule.
|
java.lang.String |
getMetadataUID()
Get the UID of the
MarsMetadata record associated with this
molecule. |
MarsTable |
getSegmentsTable(java.util.List<java.lang.String> tableColumnNames)
Retrieve a segments table (
MarsTable ) generated using x column, y
column and region names provided in index positions 0, 1 and 2 of a List,
respectively. |
MarsTable |
getSegmentsTable(java.lang.String xColumn,
java.lang.String yColumn)
Retrieve a segments table (
MarsTable ) generated using xColumn and
yColumn. |
MarsTable |
getSegmentsTable(java.lang.String xColumn,
java.lang.String yColumn,
java.lang.String region)
Retrieve a Segments table (
MarsTable ) generated using xColum,
yColumn and region names. |
java.util.Set<java.util.List<java.lang.String>> |
getSegmentsTableNames()
Get the set of segment table names as lists of x and y column names.
|
MarsTable |
getTable()
Get the
MarsTable holding the primary data for this record. |
boolean |
hasSegmentsTable(java.lang.String xColumn,
java.lang.String yColumn)
Check if record has a segments table (
MarsTable ) generated using
xColumn and yColumn. |
boolean |
hasSegmentsTable(java.lang.String xColumn,
java.lang.String yColumn,
java.lang.String region)
Check if record has a Segments table (
MarsTable ) generated using
xColumn, yColumn and region names. |
void |
merge(Molecule molecule)
Used to merge another molecule record into this one.
|
void |
putPosition(MarsPosition positionOfInterest)
Add or update a
MarsPosition . |
void |
putRegion(MarsRegion regionOfInterest)
Add or update a
MarsRegion . |
void |
putSegmentsTable(java.lang.String xColumn,
java.lang.String yColumn,
MarsTable segmentsTable)
Add or update a segments table (
MarsTable ) generated using the x
column and y column names. |
void |
putSegmentsTable(java.lang.String xColumn,
java.lang.String yColumn,
java.lang.String region,
MarsTable segmentsTable)
Add or update a segments table (
MarsTable ) generated using the x
column, y column and region names. |
void |
removeSegmentsTable(java.util.List<java.lang.String> tableColumnNames)
Remove the Segments table (
MarsTable ) generated using x column, y
column and region names provided. |
void |
removeSegmentsTable(java.lang.String xColumn,
java.lang.String yColumn)
Remove the Segments table (
MarsTable ) generated using xColumn and
yColumn. |
void |
removeSegmentsTable(java.lang.String xColumn,
java.lang.String yColumn,
java.lang.String region)
Remove the segments table (
MarsTable ) generated using x column, y
column, and region names provided. |
void |
setChannel(int channel)
Set the channel for this molecule.
|
void |
setImage(int image)
Set the image index for this molecule.
|
void |
setMetadataUID(java.lang.String metadataUID)
Set the UID of the
MarsMetadata record associated with this
molecule. |
void |
setParameter(java.lang.String parameter,
boolean value)
Add or update a parameter value.
|
void |
setParameter(java.lang.String parameter,
double value)
Add or update a parameter value.
|
void |
setParameter(java.lang.String parameter,
java.lang.String value)
Add or update a parameter value.
|
void |
setTable(MarsTable table)
Set the
MarsTable holding the primary data for this record. |
addNote, getBooleanParameter, getNotes, getParameter, getParameters, getPosition, getPositionNames, getPositions, getRegion, getRegionNames, getRegions, getStringParameter, getTags, getTagsArray, getUID, hasBooleanParameter, hasDoubleParameter, hasNoTags, hasParameter, hasPosition, hasRegion, hasStringParameter, hasTag, merge, removeAllParameters, removeAllPositions, removeAllRegions, removeAllTags, removeParameter, removePosition, removeRegion, removeTag, setNotes, setParent
dumpJSON, fromJSON, getJsonGenerator, getJsonParser, setJsonField, setShowWarnings, toJSON
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addNote, getBooleanParameter, getNotes, getParameter, getParameters, getPosition, getPositionNames, getPositions, getRegion, getRegionNames, getRegions, getStringParameter, getTags, getTagsArray, getUID, hasBooleanParameter, hasDoubleParameter, hasNoTags, hasParameter, hasPosition, hasRegion, hasStringParameter, hasTag, merge, removeAllParameters, removeAllPositions, removeAllRegions, removeAllTags, removeParameter, removePosition, removeRegion, removeTag, setNotes, setParent
dumpJSON, fromJSON, getJsonGenerator, getJsonParser, setJsonField, setShowWarnings, toJSON
public AbstractMolecule()
public AbstractMolecule(com.fasterxml.jackson.core.JsonParser jParser) throws java.io.IOException
AbstractMoleculeArchive
or when a record is retrieved from the
virtual store.jParser
- A JsonParser at the start of the molecule record Json for
loading the molecule record from a file.java.io.IOException
- Thrown if unable to read Json from the JsonParser
stream.public AbstractMolecule(java.lang.String UID)
UID
- The unique identifier for this Molecule record.public AbstractMolecule(java.lang.String UID, MarsTable table)
MarsTable
given as the DataTable.UID
- The unique identifier for this Molecule record.table
- The MarsTable
to use for initialization.protected void createIOMaps()
AbstractJsonConvertibleRecord
createIOMaps
in class AbstractMarsRecord
public void setImage(int image)
public int getImage()
public void setChannel(int channel)
setChannel
in interface Molecule
channel
- Integer value for the channel.public int getChannel()
getChannel
in interface Molecule
public void setParameter(java.lang.String parameter, double value)
setParameter
in interface MarsRecord
setParameter
in class AbstractMarsRecord
parameter
- The string parameter name.value
- The double value to set for the parameter name.public void setParameter(java.lang.String parameter, java.lang.String value)
setParameter
in interface MarsRecord
setParameter
in class AbstractMarsRecord
parameter
- The string parameter name.value
- The string value to set for the parameter name.public void setParameter(java.lang.String parameter, boolean value)
setParameter
in interface MarsRecord
setParameter
in class AbstractMarsRecord
parameter
- The string parameter name.value
- The boolean value to set for the parameter name.public void addTag(java.lang.String tag)
addTag
in interface MarsRecord
addTag
in class AbstractMarsRecord
tag
- The string tag to be added.public void putRegion(MarsRegion regionOfInterest)
MarsRegion
. This can be a region of interest for
further analysis steps: slope calculations or KCP calculations
KCPCommand
. Region names are unique. If a region that has this name
already exists in the record it will be overwritten by this method.putRegion
in interface MarsRecord
putRegion
in class AbstractMarsRecord
regionOfInterest
- The region to add to the record.public void putPosition(MarsPosition positionOfInterest)
MarsPosition
. This can be a position of interest
for further analysis steps. Position names are unique. If a position with
has this name already exists in the record it will be overwritten by this
method.putPosition
in interface MarsRecord
putPosition
in class AbstractMarsRecord
positionOfInterest
- The position to add to the record.public void setTable(MarsTable table)
MarsTable
holding the primary data for this record. Usually
this is tracking or intensity as a function of time.public void setMetadataUID(java.lang.String metadataUID)
MarsMetadata
record associated with this
molecule. The MarsMetadata
contains information about the data
collection (Timing of frames, colors, collection date, etc...)setMetadataUID
in interface Molecule
metadataUID
- The new MarsMetadata UID to set.public java.lang.String getMetadataUID()
MarsMetadata
record associated with this
molecule. The MarsMetadata
contains information about the data
collection (Timing of frames, colors, collection date, etc...)getMetadataUID
in interface Molecule
public void putSegmentsTable(java.lang.String xColumn, java.lang.String yColumn, MarsTable segmentsTable)
MarsTable
) generated using the x
column and y column names. The KCPCommand
performs kinetic change
point analysis generating segments to fit regions of a trace. The
information about these segments is added using this method.putSegmentsTable
in interface Molecule
xColumn
- The name of the column used for x for KCP analysis.yColumn
- The name of the column used for y for KCP analysis.segmentsTable
- The MarsTable
to add that contains the
segments.public void putSegmentsTable(java.lang.String xColumn, java.lang.String yColumn, java.lang.String region, MarsTable segmentsTable)
MarsTable
) generated using the x
column, y column and region names. The KCPCommand
performs kinetic
change point analysis generating segments to fit regions of a trace. The
information about these segments is added using this method.putSegmentsTable
in interface Molecule
xColumn
- The name of the column used for x for KCP analysis.yColumn
- The name of the column used for y for KCP analysis.region
- The name of the region used for analysis.segmentsTable
- The MarsTable
to add that contains the
segments.public MarsTable getSegmentsTable(java.lang.String xColumn, java.lang.String yColumn)
MarsTable
) generated using xColumn and
yColumn.getSegmentsTable
in interface Molecule
xColumn
- The name of the x column used for analysis.yColumn
- The name of the y column used for analysis.public MarsTable getSegmentsTable(java.lang.String xColumn, java.lang.String yColumn, java.lang.String region)
MarsTable
) generated using xColum,
yColumn and region names.getSegmentsTable
in interface Molecule
xColumn
- The name of the x column used for analysis.yColumn
- The name of the y column used for analysis.region
- The name of the region used for analysis.public boolean hasSegmentsTable(java.lang.String xColumn, java.lang.String yColumn)
MarsTable
) generated using
xColumn and yColumn.hasSegmentsTable
in interface Molecule
xColumn
- The name of the x column used for analysis.yColumn
- The name of the y column used for analysis.public boolean hasSegmentsTable(java.lang.String xColumn, java.lang.String yColumn, java.lang.String region)
MarsTable
) generated using
xColumn, yColumn and region names.hasSegmentsTable
in interface Molecule
xColumn
- The name of the x column used for analysis.yColumn
- The name of the y column used for analysis.region
- The name of the region used for analysis.public MarsTable getSegmentsTable(java.util.List<java.lang.String> tableColumnNames)
MarsTable
) generated using x column, y
column and region names provided in index positions 0, 1 and 2 of a List,
respectively.getSegmentsTable
in interface Molecule
tableColumnNames
- The list of x column, y column and region names.public void removeSegmentsTable(java.util.List<java.lang.String> tableColumnNames)
MarsTable
) generated using x column, y
column and region names provided.removeSegmentsTable
in interface Molecule
tableColumnNames
- List of the x column, y column, and region names of
the segment table to remove.public void removeSegmentsTable(java.lang.String xColumn, java.lang.String yColumn)
MarsTable
) generated using xColumn and
yColumn.removeSegmentsTable
in interface Molecule
xColumn
- The name of the x column used for analysis.yColumn
- The name of the y column used for analysis.public void removeSegmentsTable(java.lang.String xColumn, java.lang.String yColumn, java.lang.String region)
MarsTable
) generated using x column, y
column, and region names provided.removeSegmentsTable
in interface Molecule
xColumn
- The name of the x column used for analysis.yColumn
- The name of the y column used for analysis.region
- The name of the region used for analysis.public java.util.Set<java.util.List<java.lang.String>> getSegmentsTableNames()
getSegmentsTableNames
in interface Molecule