Package adams.data.threeway
Class ThreeWayData
- java.lang.Object
-
- adams.data.container.AbstractDataContainer<L1Point>
-
- adams.data.threeway.ThreeWayData
-
- All Implemented Interfaces:
adams.core.CloneHandler,adams.core.Mergeable<adams.data.container.DataContainer>,adams.core.UniqueIDHandler,adams.data.container.DataContainer<L1Point>,adams.data.DatabaseNotesHandler,adams.data.id.DatabaseIDHandler,adams.data.id.IDHandler,adams.data.id.MutableIDHandler,adams.data.NotesHandler,adams.data.report.MutableReportHandler<ThreeWayReport>,adams.data.report.ReportHandler<ThreeWayReport>,adams.data.spreadsheet.SpreadSheetSupporter,adams.data.statistics.InformativeStatisticSupporter<ThreeWayDataStatistic>,Serializable,Comparable,Iterable<L1Point>,Collection<L1Point>
public class ThreeWayData extends adams.data.container.AbstractDataContainer<L1Point> implements adams.data.DatabaseNotesHandler, adams.data.report.MutableReportHandler<ThreeWayReport>, adams.data.statistics.InformativeStatisticSupporter<ThreeWayDataStatistic>, adams.data.spreadsheet.SpreadSheetSupporter
Stores 3-way data and associated meta-data.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static adams.data.container.DataPointComparator<L1Point>m_Comparatorthe default comparator.protected intm_DatabaseIDdatabase id.protected L1Pointm_MaxXpoint of greatest X.protected L1Pointm_MaxYpoint of greatest Y.protected L1Pointm_MinXpoint of smallest X.protected L1Pointm_MinYpoint of smallest Y.protected adams.data.Notesm_Notesthe notes for the data structure.protected ThreeWayReportm_Reference'reference' values.
-
Constructor Summary
Constructors Constructor Description ThreeWayData()Initialise data.ThreeWayData(String id)Initialise data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(adams.data.container.DataContainer<L1Point> other)Obtains the stored variables from the other data point, but not the actual data points.intcompareToHeader(Object o)Compares this object with the specified object for order.booleanequalsHeader(Object obj)Indicates whether some other chromatogram's header is "equal to" this ones.L1Pointfind(double x, double y)Returns the level 1 point with the exact X, null if not found.L1PointfindClosest(double x, double y)Returns the level 1 point with a X closest to the one provided.L2Pointget(double x, double y, double z)Returns the L2 point associated with the given x, y and z.gnu.trove.list.TDoubleListgetAllData()Returns all unique data values.gnu.trove.list.TDoubleListgetAllX()Returns all unique Xs.gnu.trove.list.TDoubleListgetAllY()Returns all unique Ys.gnu.trove.list.TDoubleListgetAllZ()Returns all unique Zs.adams.data.container.DataPointComparator<L1Point>getComparator()Returns the comparator in use.intgetDatabaseID()Get database id.L1PointgetMaxX()Get point with greatest timestamp.L1PointgetMaxY()Get point with greatest abundance.L1PointgetMinX()Get point with smallest Timestamp.L1PointgetMinY()Get point with smallest abundance.adams.data.NotesgetNotes()Returns the currently stored notes.ThreeWayReportgetReport()Get the report (reference values).ThreeWayDatagetXSubset(double x)Returns a data structure which contains only the given x values.inthashCode()Returns the hashcode.booleanhasReport()True if Quantitation Report exists for this chromatogram.protected voidinvalidateMinMax()Invalidates the min/max abundance/timestamp points.protected booleanmodifiedListener(boolean modified)Method that gets notified about changes in the collection of data points.adams.data.container.DataPointComparator<L1Point>newComparator()Returns a new instance of the default comparator.L1PointnewPoint()Returns a new instance of a DataContainer point.voidsetDatabaseID(int value)Set the database ID.voidsetID(String value)Sets the ID of the chromatogram.voidsetReport(ThreeWayReport value)Set the report (reference values).adams.data.spreadsheet.SpreadSheettoSpreadSheet()Returns the content as spreadsheet.ThreeWayDataStatistictoStatistic()Returns a statistic object of this data structure.StringtoString()Returns a short string representation of the chromatogram.protected voidvalidateMinMax()Initializes the min/max abundance/timestmap points.-
Methods inherited from class adams.data.container.AbstractDataContainer
add, addAll, clear, compareTo, compareToData, contains, containsAll, ensureCapacity, equals, equalsData, getClone, getHeader, getID, getUniqueID, isEmpty, iterator, mergeWith, newInstance, remove, removeAll, retainAll, size, toArray, toArray, toList, toList, toTreeSet, toTreeSet, trimToSize
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Field Detail
-
m_DatabaseID
protected int m_DatabaseID
database id.
-
m_Reference
protected ThreeWayReport m_Reference
'reference' values.
-
m_MaxY
protected L1Point m_MaxY
point of greatest Y.
-
m_MinY
protected L1Point m_MinY
point of smallest Y.
-
m_MaxX
protected L1Point m_MaxX
point of greatest X.
-
m_MinX
protected L1Point m_MinX
point of smallest X.
-
m_Notes
protected adams.data.Notes m_Notes
the notes for the data structure.
-
m_Comparator
protected static adams.data.container.DataPointComparator<L1Point> m_Comparator
the default comparator.
-
-
Constructor Detail
-
ThreeWayData
public ThreeWayData()
Initialise data.
-
ThreeWayData
public ThreeWayData(String id)
Initialise data.- Parameters:
id- ID for data
-
-
Method Detail
-
newComparator
public adams.data.container.DataPointComparator<L1Point> newComparator()
Returns a new instance of the default comparator.- Specified by:
newComparatorin interfaceadams.data.container.DataContainer<L1Point>- Returns:
- the comparator instance
-
getComparator
public adams.data.container.DataPointComparator<L1Point> getComparator()
Returns the comparator in use.- Specified by:
getComparatorin interfaceadams.data.container.DataContainer<L1Point>- Returns:
- the comparator in use
-
newPoint
public L1Point newPoint()
Returns a new instance of a DataContainer point.- Specified by:
newPointin interfaceadams.data.container.DataContainer<L1Point>- Returns:
- the new DataContainer point
-
invalidateMinMax
protected void invalidateMinMax()
Invalidates the min/max abundance/timestamp points.
-
validateMinMax
protected void validateMinMax()
Initializes the min/max abundance/timestmap points.
-
setID
public void setID(String value)
Sets the ID of the chromatogram.- Specified by:
setIDin interfaceadams.data.id.MutableIDHandler- Overrides:
setIDin classadams.data.container.AbstractDataContainer<L1Point>- Parameters:
value- the new ID
-
setDatabaseID
public void setDatabaseID(int value)
Set the database ID.- Parameters:
value- Database ID
-
getDatabaseID
public int getDatabaseID()
Get database id.- Specified by:
getDatabaseIDin interfaceadams.data.id.DatabaseIDHandler- Returns:
- database ID
-
setReport
public void setReport(ThreeWayReport value)
Set the report (reference values).- Specified by:
setReportin interfaceadams.data.report.MutableReportHandler<ThreeWayReport>- Parameters:
value- report
-
getReport
public ThreeWayReport getReport()
Get the report (reference values).- Specified by:
getReportin interfaceadams.data.report.ReportHandler<ThreeWayReport>- Returns:
- report
-
hasReport
public boolean hasReport()
True if Quantitation Report exists for this chromatogram.- Specified by:
hasReportin interfaceadams.data.report.ReportHandler<ThreeWayReport>- Returns:
- does this chromatogram have a Quantitation Report
-
getMaxY
public L1Point getMaxY()
Get point with greatest abundance.- Returns:
- gc point
-
getMinY
public L1Point getMinY()
Get point with smallest abundance.- Returns:
- gc point
-
getMaxX
public L1Point getMaxX()
Get point with greatest timestamp.- Returns:
- gc point
-
getMinX
public L1Point getMinX()
Get point with smallest Timestamp.- Returns:
- gc point
-
modifiedListener
protected boolean modifiedListener(boolean modified)
Method that gets notified about changes in the collection of data points.- Overrides:
modifiedListenerin classadams.data.container.AbstractDataContainer<L1Point>- Parameters:
modified- whether the action modified the collection- Returns:
- the same as the input
-
find
public L1Point find(double x, double y)
Returns the level 1 point with the exact X, null if not found.- Parameters:
x- the X to look fory- the Y to look for- Returns:
- the level 1 point or null if not found
- See Also:
findClosest(double,double)
-
findClosest
public L1Point findClosest(double x, double y)
Returns the level 1 point with a X closest to the one provided.- Parameters:
x- the X to look for- Returns:
- the level 1 point
- See Also:
find(double,double)
-
getXSubset
public ThreeWayData getXSubset(double x)
Returns a data structure which contains only the given x values. Adds level 1 points with y=0 if a level 1 point does not contain the chosen x.- Parameters:
x- the x to look for- Returns:
- the new data structure
-
assign
public void assign(adams.data.container.DataContainer<L1Point> other)
Obtains the stored variables from the other data point, but not the actual data points.
-
compareToHeader
public int compareToHeader(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- Specified by:
compareToHeaderin interfaceadams.data.container.DataContainer<L1Point>- Overrides:
compareToHeaderin classadams.data.container.AbstractDataContainer<L1Point>- Parameters:
o- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException- if the specified object's type prevents it from being compared to this object.
-
equalsHeader
public boolean equalsHeader(Object obj)
Indicates whether some other chromatogram's header is "equal to" this ones.- Specified by:
equalsHeaderin interfaceadams.data.container.DataContainer<L1Point>- Overrides:
equalsHeaderin classadams.data.container.AbstractDataContainer<L1Point>- Parameters:
obj- the reference object with which to compare.- Returns:
- true if this object is the same as the obj argument; false otherwise.
-
hashCode
public int hashCode()
Returns the hashcode. Just the hashcode of the toString()-generated string.- Specified by:
hashCodein interfaceCollection<L1Point>- Overrides:
hashCodein classadams.data.container.AbstractDataContainer<L1Point>- Returns:
- the hashcode
-
toString
public String toString()
Returns a short string representation of the chromatogram.- Overrides:
toStringin classadams.data.container.AbstractDataContainer<L1Point>- Returns:
- a string representation
-
toStatistic
public ThreeWayDataStatistic toStatistic()
Returns a statistic object of this data structure.- Specified by:
toStatisticin interfaceadams.data.statistics.InformativeStatisticSupporter<ThreeWayDataStatistic>- Returns:
- statistics about this data structure
-
getNotes
public adams.data.Notes getNotes()
Returns the currently stored notes.- Specified by:
getNotesin interfaceadams.data.NotesHandler- Returns:
- the current notes
-
toSpreadSheet
public adams.data.spreadsheet.SpreadSheet toSpreadSheet()
Returns the content as spreadsheet.- Specified by:
toSpreadSheetin interfaceadams.data.spreadsheet.SpreadSheetSupporter- Returns:
- the content
-
get
public L2Point get(double x, double y, double z)
Returns the L2 point associated with the given x, y and z.- Parameters:
x- the X of the point to retrievey- the Y of the point to retrievez- the Z of the point to retrieve- Returns:
- the point, null if not found for these coordinates
-
getAllX
public gnu.trove.list.TDoubleList getAllX()
Returns all unique Xs.- Returns:
- the list of Xs
-
getAllY
public gnu.trove.list.TDoubleList getAllY()
Returns all unique Ys.- Returns:
- the list of Ys
-
getAllZ
public gnu.trove.list.TDoubleList getAllZ()
Returns all unique Zs.- Returns:
- the list of Zs
-
getAllData
public gnu.trove.list.TDoubleList getAllData()
Returns all unique data values.- Returns:
- the list of data values
-
-