pept.tracking.GroupBy#
- class pept.tracking.GroupBy(column)[source]#
Bases:
Reducer
Stack all samples and split them into a list according to a named / numeric column index.
Reducer signature:
LineData -> SplitAll.fit -> list[LineData] list[LineData] -> SplitAll.fit -> list[LineData] PointData -> SplitAll.fit -> list[PointData] list[PointData] -> SplitAll.fit -> list[PointData] numpy.ndarray -> SplitAll.fit -> list[numpy.ndarray] list[numpy.ndarray] -> SplitAll.fit -> list[numpy.ndarray]
If using a LineData / PointData, you can use a columns name as a string, e.g.
SplitAll("label")
or a numberSplitAll(4)
. If using a NumPy array, only numeric indices are accepted.Methods
__init__
(column)copy
([deep])Create a deep copy of an instance of this class, including all inner attributes.
fit
(samples)load
(filepath)Load a saved / pickled PEPTObject object from filepath.
save
(filepath)Save a PEPTObject instance as a binary pickle object.
- copy(deep=True)#
Create a deep copy of an instance of this class, including all inner attributes.
- static load(filepath)#
Load a saved / pickled PEPTObject object from filepath.
Most often the full object state was saved using the .save method.
- Parameters
- filepath
filename
orfile
handle
If filepath is a path (rather than file handle), it is relative to where python is called.
- filepath
- Returns
pept.PEPTObject
subclass
instance
The loaded object.
Examples
Save a LineData instance, then load it back:
>>> lines = pept.LineData([[1, 2, 3, 4, 5, 6, 7]]) >>> lines.save("lines.pickle")
>>> lines_reloaded = pept.LineData.load("lines.pickle")
- save(filepath)#
Save a PEPTObject instance as a binary pickle object.
Saves the full object state, including inner attributes, in a portable binary format. Load back the object using the load method.
- Parameters
- filepath
filename
orfile
handle
If filepath is a path (rather than file handle), it is relative to where python is called.
- filepath
Examples
Save a LineData instance, then load it back:
>>> lines = pept.LineData([[1, 2, 3, 4, 5, 6, 7]]) >>> lines.save("lines.pickle")
>>> lines_reloaded = pept.LineData.load("lines.pickle")