A class for holding flow cytometry data from a single well or a single tube.
Methods
ID_from_data([ID_field]) | Returns the well ID from the src keyword in the FCS file. (e.g., A2) |
apply(func[, applyto, noneval, setdata]) | Apply func either to self or to associated data. |
copy([deep]) | Make a copy of this object |
gate(gate) | Apply given gate and return new gated sample (with assigned data). |
get_data(**kwargs) | Get the measurement data. |
get_meta(**kwargs) | Get the measurement metadata. |
get_meta_fields(fields[, kwargs]) | Return a dictionary of metadata fields |
load(path) | Loads object from a pickled file. |
plot(channel_names[, transform, kind, ...]) | Plots the flow cytometry data associated with the sample on the current axis. |
read_data(**kwargs) | Read the datafile specified in Sample.datafile and |
read_meta(**kwargs) | |
save(path) | Saves objec to a pickled file. |
set_data([data, datafile]) | Assign values to self.data and self.meta. |
set_meta([meta, metafile]) | Assign values to self.data and self.meta. |
transform(transform[, direction, channels, ...]) | Applies a transformation to the specified channels. |
view() | Loads the current FCS sample viewer |
Returns the well ID from the src keyword in the FCS file. (e.g., A2) This keyword may not appear in FCS files generated by other machines, in which case this function will raise an exception.
A tuple containing the channel names.
A DataFrame containing complete channel information
Returns total number of events.
Apply given gate and return new gated sample (with assigned data). Note that no transformation is done by this funciton.
Parameters: | gate : [ThresholdGate, IntervalGate, QuadGate, PolyGate ] |
---|
Return a dictionary of metadata fields
Plots the flow cytometry data associated with the sample on the current axis.
To produce the plot, follow up with a call to matplotlib’s show() function.
Parameters: | channel_names : [str | iterable of str]
kind : [‘scatter’ | ‘histogram’]
autolabel : [False | True]
colorbar : [False | True]
xlabel_kwargs : dict
ylabel_kwargs : dict
transform : [valid transform | tuple of valid transforms | None]
gates : [None | Gate | iterable of Gate]
transform_first : bool
ax : [None | ax]
gates : [None, Gate, list of Gate]
kwargs : dict
|
---|---|
Returns: | None : if no data is present plot_output : output of plot command used to draw (e.g., output of hist) |
Examples
>>> sample.plot('Y2-A', bins=100, alpha=0.7, color='green', normed=1) # 1d histogram
>>> sample.plot(['B1-A', 'Y2-A'], cmap=cm.Oranges, colorbar=False) # 2d histogram
Read the datafile specified in Sample.datafile and return the resulting object. Does NOT assign the data to self.data
Applies a transformation to the specified channels.
The transformation parameters are shared between all transformed channels. If different parameters need to be applied to different channels, use several calls to transform.
Parameters: | transform : [‘hlog’ | ‘tlog’ | ‘glog’ | callable]
direction : [‘forward’ | ‘inverse’]
channels : str | list of str | None
return_all : bool
auto_range : bool
use_spln : bool
get_transformer : bool
args : :
kwargs : :
ID : hashable | None
|
---|---|
Returns: | new : FCMeasurement
transformer : Transformation
|
Examples
>>> trans = original.transform('hlog')
>>> trans = original.transform('tlog', th=2)
>>> trans = original.transform('hlog', d=log10(2**18), auto_range=False)
>>> trans = original.transform('hlog', r=1000, use_spln=True, get_transformer=True)
>>> trans = original.transform('hlog', channels=['FSC-A', 'SSC-A'], b=500).transform('hlog', channels='B1-A', b=100)
Loads the current FCS sample viewer
Parameters: | channel_names : str | list of str
|
---|---|
Returns: | TODO: Implement channel_names : |