sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
def public(self):
"""True if the Slot is public."""
return bool(lib.EnvSlotPublicP(self._env, self._cls, self._name)) | True if the Slot is public. | entailment |
def initializable(self):
"""True if the Slot is initializable."""
return bool(lib.EnvSlotInitableP(self._env, self._cls, self._name)) | True if the Slot is initializable. | entailment |
def writable(self):
"""True if the Slot is writable."""
return bool(lib.EnvSlotWritableP(self._env, self._cls, self._name)) | True if the Slot is writable. | entailment |
def accessible(self):
"""True if the Slot is directly accessible."""
return bool(lib.EnvSlotDirectAccessP(self._env, self._cls, self._name)) | True if the Slot is directly accessible. | entailment |
def types(self):
"""A tuple containing the value types for this Slot.
The Python equivalent of the CLIPS slot-types function.
"""
data = clips.data.DataObject(self._env)
lib.EnvSlotTypes(self._env, self._cls, self._name, data.byref)
return tuple(data.value) if isinsta... | A tuple containing the value types for this Slot.
The Python equivalent of the CLIPS slot-types function. | entailment |
def sources(self):
"""A tuple containing the names of the Class sources for this Slot.
The Python equivalent of the CLIPS slot-sources function.
"""
data = clips.data.DataObject(self._env)
lib.EnvSlotSources(self._env, self._cls, self._name, data.byref)
return tuple(d... | A tuple containing the names of the Class sources for this Slot.
The Python equivalent of the CLIPS slot-sources function. | entailment |
def range(self):
"""A tuple containing the numeric range for this Slot.
The Python equivalent of the CLIPS slot-range function.
"""
data = clips.data.DataObject(self._env)
lib.EnvSlotRange(self._env, self._cls, self._name, data.byref)
return tuple(data.value) if isins... | A tuple containing the numeric range for this Slot.
The Python equivalent of the CLIPS slot-range function. | entailment |
def facets(self):
"""A tuple containing the facets for this Slot.
The Python equivalent of the CLIPS slot-facets function.
"""
data = clips.data.DataObject(self._env)
lib.EnvSlotFacets(self._env, self._cls, self._name, data.byref)
return tuple(data.value) if isinstanc... | A tuple containing the facets for this Slot.
The Python equivalent of the CLIPS slot-facets function. | entailment |
def cardinality(self):
"""A tuple containing the cardinality for this Slot.
The Python equivalent of the CLIPS slot-cardinality function.
"""
data = clips.data.DataObject(self._env)
lib.EnvSlotCardinality(
self._env, self._cls, self._name, data.byref)
retu... | A tuple containing the cardinality for this Slot.
The Python equivalent of the CLIPS slot-cardinality function. | entailment |
def default_value(self):
"""The default value for this Slot.
The Python equivalent of the CLIPS slot-default-value function.
"""
data = clips.data.DataObject(self._env)
lib.EnvSlotDefaultValue(
self._env, self._cls, self._name, data.byref)
return data.valu... | The default value for this Slot.
The Python equivalent of the CLIPS slot-default-value function. | entailment |
def allowed_values(self):
"""A tuple containing the allowed values for this Slot.
The Python equivalent of the CLIPS slot-allowed-values function.
"""
data = clips.data.DataObject(self._env)
lib.EnvSlotAllowedValues(
self._env, self._cls, self._name, data.byref)
... | A tuple containing the allowed values for this Slot.
The Python equivalent of the CLIPS slot-allowed-values function. | entailment |
def allowed_classes(self):
"""Iterate over the allowed classes for this slot.
The Python equivalent of the CLIPS slot-allowed-classes function.
"""
data = clips.data.DataObject(self._env)
lib.EnvSlotAllowedClasses(
self._env, self._cls, self._name, data.byref)
... | Iterate over the allowed classes for this slot.
The Python equivalent of the CLIPS slot-allowed-classes function. | entailment |
def name(self):
"""Instance name."""
return ffi.string(lib.EnvGetInstanceName(self._env, self._ist)).decode() | Instance name. | entailment |
def instance_class(self):
"""Instance class."""
return Class(self._env, lib.EnvGetInstanceClass(self._env, self._ist)) | Instance class. | entailment |
def send(self, message, arguments=None):
"""Send a message to the Instance.
Message arguments must be provided as a string.
"""
output = clips.data.DataObject(self._env)
instance = clips.data.DataObject(
self._env, dtype=CLIPSType.INSTANCE_ADDRESS)
instance.... | Send a message to the Instance.
Message arguments must be provided as a string. | entailment |
def delete(self):
"""Delete the instance."""
if lib.EnvDeleteInstance(self._env, self._ist) != 1:
raise CLIPSError(self._env) | Delete the instance. | entailment |
def unmake(self):
"""This method is equivalent to delete except that it uses
message-passing instead of directly deleting the instance.
"""
if lib.EnvUnmakeInstance(self._env, self._ist) != 1:
raise CLIPSError(self._env) | This method is equivalent to delete except that it uses
message-passing instead of directly deleting the instance. | entailment |
def name(self):
"""MessageHandler name."""
return ffi.string(lib.EnvGetDefmessageHandlerName(
self._env, self._cls, self._idx)).decode() | MessageHandler name. | entailment |
def type(self):
"""MessageHandler type."""
return ffi.string(lib.EnvGetDefmessageHandlerType(
self._env, self._cls, self._idx)).decode() | MessageHandler type. | entailment |
def watch(self):
"""True if the MessageHandler is being watched."""
return bool(lib.EnvGetDefmessageHandlerWatch(
self._env, self._cls, self._idx)) | True if the MessageHandler is being watched. | entailment |
def watch(self, flag):
"""True if the MessageHandler is being watched."""
lib.EnvSetDefmessageHandlerWatch(
self._env, int(flag), self._cls, self._idx) | True if the MessageHandler is being watched. | entailment |
def deletable(self):
"""True if the MessageHandler can be deleted."""
return bool(lib.EnvIsDefmessageHandlerDeletable(
self._env, self._cls, self._idx)) | True if the MessageHandler can be deleted. | entailment |
def undefine(self):
"""Undefine the MessageHandler.
Python equivalent of the CLIPS undefmessage-handler command.
The object becomes unusable after this method has been called.
"""
if lib.EnvUndefmessageHandler(self._env, self._cls, self._idx) != 1:
raise CLIPSError... | Undefine the MessageHandler.
Python equivalent of the CLIPS undefmessage-handler command.
The object becomes unusable after this method has been called. | entailment |
def load(self, path):
"""Load a set of constructs into the CLIPS data base.
Constructs can be in text or binary format.
The Python equivalent of the CLIPS load command.
"""
try:
self._load_binary(path)
except CLIPSError:
self._load_text(path) | Load a set of constructs into the CLIPS data base.
Constructs can be in text or binary format.
The Python equivalent of the CLIPS load command. | entailment |
def save(self, path, binary=False):
"""Save a set of constructs into the CLIPS data base.
If binary is True, the constructs will be saved in binary format.
The Python equivalent of the CLIPS load command.
"""
if binary:
ret = lib.EnvBsave(self._env, path.encode())
... | Save a set of constructs into the CLIPS data base.
If binary is True, the constructs will be saved in binary format.
The Python equivalent of the CLIPS load command. | entailment |
def batch_star(self, path):
"""Evaluate the commands contained in the specific path.
The Python equivalent of the CLIPS batch* command.
"""
if lib.EnvBatchStar(self._env, path.encode()) != 1:
raise CLIPSError(self._env) | Evaluate the commands contained in the specific path.
The Python equivalent of the CLIPS batch* command. | entailment |
def build(self, construct):
"""Build a single construct in CLIPS.
The Python equivalent of the CLIPS build command.
"""
if lib.EnvBuild(self._env, construct.encode()) != 1:
raise CLIPSError(self._env) | Build a single construct in CLIPS.
The Python equivalent of the CLIPS build command. | entailment |
def eval(self, construct):
"""Evaluate an expression returning its value.
The Python equivalent of the CLIPS eval command.
"""
data = clips.data.DataObject(self._env)
if lib.EnvEval(self._env, construct.encode(), data.byref) != 1:
raise CLIPSError(self._env)
... | Evaluate an expression returning its value.
The Python equivalent of the CLIPS eval command. | entailment |
def define_function(self, function, name=None):
"""Define the Python function within the CLIPS environment.
If a name is given, it will be the function name within CLIPS.
Otherwise, the name of the Python function will be used.
The Python function will be accessible within CLIPS via it... | Define the Python function within the CLIPS environment.
If a name is given, it will be the function name within CLIPS.
Otherwise, the name of the Python function will be used.
The Python function will be accessible within CLIPS via its name
as if it was defined via the `deffunction` c... | entailment |
def activate(self):
"""Activate the Router."""
if lib.EnvActivateRouter(self._env, self._name.encode()) == 0:
raise RuntimeError("Unable to activate router %s" % self._name) | Activate the Router. | entailment |
def deactivate(self):
"""Deactivate the Router."""
if lib.EnvDeactivateRouter(self._env, self._name.encode()) == 0:
raise RuntimeError("Unable to deactivate router %s" % self._name) | Deactivate the Router. | entailment |
def delete(self):
"""Delete the Router."""
if lib.EnvDeleteRouter(self._env, self._name.encode()) == 0:
raise RuntimeError("Unable to delete router %s" % self._name) | Delete the Router. | entailment |
def add_to_environment(self, environment):
"""Add the router to the given environment."""
self._env = environment._env
self._userdata = ffi.new_handle(self)
ENVIRONMENT_DATA[self._env].routers[self.name] = self
lib.EnvAddRouterWithContext(
self._env, self._name.enco... | Add the router to the given environment. | entailment |
def value(self):
"""Return the DATA_OBJECT stored value."""
dtype = lib.get_data_type(self._data)
dvalue = lib.get_data_value(self._data)
if dvalue == ffi.NULL:
return None
return self.python_value(dtype, dvalue) | Return the DATA_OBJECT stored value. | entailment |
def value(self, value):
"""Sets the DATA_OBJECT stored value."""
dtype = TYPES[type(value)] if self._type is None else self._type
lib.set_data_type(self._data, dtype)
lib.set_data_value(self._data, self.clips_value(value)) | Sets the DATA_OBJECT stored value. | entailment |
def python_value(self, dtype, dvalue):
"""Convert a CLIPS type into Python."""
try:
return CONVERTERS[dtype](dvalue)
except KeyError:
if dtype == clips.common.CLIPSType.MULTIFIELD:
return self.multifield_to_list()
if dtype == clips.common.CLIPS... | Convert a CLIPS type into Python. | entailment |
def clips_value(self, dvalue):
"""Convert a Python type into CLIPS."""
try:
return VALUES[type(dvalue)](self._env, dvalue)
except KeyError:
if isinstance(dvalue, (list, tuple)):
return self.list_to_multifield(dvalue)
if isinstance(dvalue, (clip... | Convert a Python type into CLIPS. | entailment |
def agenda_changed(self):
"""True if any rule activation changes have occurred."""
value = bool(lib.EnvGetAgendaChanged(self._env))
lib.EnvSetAgendaChanged(self._env, int(False))
return value | True if any rule activation changes have occurred. | entailment |
def rules(self):
"""Iterate over the defined Rules."""
rule = lib.EnvGetNextDefrule(self._env, ffi.NULL)
while rule != ffi.NULL:
yield Rule(self._env, rule)
rule = lib.EnvGetNextDefrule(self._env, rule) | Iterate over the defined Rules. | entailment |
def find_rule(self, rule):
"""Find a Rule by name."""
defrule = lib.EnvFindDefrule(self._env, rule.encode())
if defrule == ffi.NULL:
raise LookupError("Rule '%s' not found" % defrule)
return Rule(self._env, defrule) | Find a Rule by name. | entailment |
def reorder(self, module=None):
"""Reorder the Activations in the Agenda.
If no Module is specified, the current one is used.
To be called after changing the conflict resolution strategy.
"""
module = module._mdl if module is not None else ffi.NULL
lib.EnvReorderAgend... | Reorder the Activations in the Agenda.
If no Module is specified, the current one is used.
To be called after changing the conflict resolution strategy. | entailment |
def refresh(self, module=None):
"""Recompute the salience values of the Activations on the Agenda
and then reorder the agenda.
The Python equivalent of the CLIPS refresh-agenda command.
If no Module is specified, the current one is used.
"""
module = module._mdl if modu... | Recompute the salience values of the Activations on the Agenda
and then reorder the agenda.
The Python equivalent of the CLIPS refresh-agenda command.
If no Module is specified, the current one is used. | entailment |
def activations(self):
"""Iterate over the Activations in the Agenda."""
activation = lib.EnvGetNextActivation(self._env, ffi.NULL)
while activation != ffi.NULL:
yield Activation(self._env, activation)
activation = lib.EnvGetNextActivation(self._env, activation) | Iterate over the Activations in the Agenda. | entailment |
def clear(self):
"""Deletes all activations in the agenda."""
if lib.EnvDeleteActivation(self._env, ffi.NULL) != 1:
raise CLIPSError(self._env) | Deletes all activations in the agenda. | entailment |
def name(self):
"""Rule name."""
return ffi.string(lib.EnvGetDefruleName(self._env, self._rule)).decode() | Rule name. | entailment |
def module(self):
"""The module in which the Rule is defined.
Python equivalent of the CLIPS defrule-module command.
"""
modname = ffi.string(lib.EnvDefruleModule(self._env, self._rule))
defmodule = lib.EnvFindDefmodule(self._env, modname)
return Module(self._env, defm... | The module in which the Rule is defined.
Python equivalent of the CLIPS defrule-module command. | entailment |
def watch_firings(self, flag):
"""Whether or not the Rule firings are being watched."""
lib.EnvSetDefruleWatchFirings(self._env, int(flag), self._rule) | Whether or not the Rule firings are being watched. | entailment |
def watch_activations(self, flag):
"""Whether or not the Rule Activations are being watched."""
lib.EnvSetDefruleWatchActivations(self._env, int(flag), self._rule) | Whether or not the Rule Activations are being watched. | entailment |
def matches(self, verbosity=Verbosity.TERSE):
"""Shows partial matches and activations.
Returns a tuple containing the combined sum of the matches
for each pattern, the combined sum of partial matches
and the number of activations.
The verbosity parameter controls how much to o... | Shows partial matches and activations.
Returns a tuple containing the combined sum of the matches
for each pattern, the combined sum of partial matches
and the number of activations.
The verbosity parameter controls how much to output:
* Verbosity.VERBOSE: detailed matches a... | entailment |
def refresh(self):
"""Refresh the Rule.
The Python equivalent of the CLIPS refresh command.
"""
if lib.EnvRefresh(self._env, self._rule) != 1:
raise CLIPSError(self._env) | Refresh the Rule.
The Python equivalent of the CLIPS refresh command. | entailment |
def undefine(self):
"""Undefine the Rule.
Python equivalent of the CLIPS undefrule command.
The object becomes unusable after this method has been called.
"""
if lib.EnvUndefrule(self._env, self._rule) != 1:
raise CLIPSError(self._env)
self._env = None | Undefine the Rule.
Python equivalent of the CLIPS undefrule command.
The object becomes unusable after this method has been called. | entailment |
def name(self):
"""Activation Rule name."""
return ffi.string(
lib.EnvGetActivationName(self._env, self._act)).decode() | Activation Rule name. | entailment |
def salience(self, salience):
"""Activation salience value."""
lib.EnvSetActivationSalience(self._env, self._act, salience) | Activation salience value. | entailment |
def delete(self):
"""Remove the activation from the agenda."""
if lib.EnvDeleteActivation(self._env, self._act) != 1:
raise CLIPSError(self._env)
self._env = None | Remove the activation from the agenda. | entailment |
def globals_changed(self):
"""True if any Global has changed."""
value = bool(lib.EnvGetGlobalsChanged(self._env))
lib.EnvSetGlobalsChanged(self._env, int(False))
return value | True if any Global has changed. | entailment |
def globals(self):
"""Iterates over the defined Globals."""
defglobal = lib.EnvGetNextDefglobal(self._env, ffi.NULL)
while defglobal != ffi.NULL:
yield Global(self._env, defglobal)
defglobal = lib.EnvGetNextDefglobal(self._env, defglobal) | Iterates over the defined Globals. | entailment |
def find_global(self, name):
"""Find the Global by its name."""
defglobal = lib.EnvFindDefglobal(self._env, name.encode())
if defglobal == ffi.NULL:
raise LookupError("Global '%s' not found" % name)
return Global(self._env, defglobal) | Find the Global by its name. | entailment |
def modules(self):
"""Iterates over the defined Modules."""
defmodule = lib.EnvGetNextDefmodule(self._env, ffi.NULL)
while defmodule != ffi.NULL:
yield Module(self._env, defmodule)
defmodule = lib.EnvGetNextDefmodule(self._env, defmodule) | Iterates over the defined Modules. | entailment |
def find_module(self, name):
"""Find the Module by its name."""
defmodule = lib.EnvFindDefmodule(self._env, name.encode())
if defmodule == ffi.NULL:
raise LookupError("Module '%s' not found" % name)
return Module(self._env, defmodule) | Find the Module by its name. | entailment |
def value(self):
"""Global value."""
data = clips.data.DataObject(self._env)
if lib.EnvGetDefglobalValue(
self._env, self.name.encode(), data.byref) != 1:
raise CLIPSError(self._env)
return data.value | Global value. | entailment |
def name(self):
"""Global name."""
return ffi.string(
lib.EnvGetDefglobalName(self._env, self._glb)).decode() | Global name. | entailment |
def module(self):
"""The module in which the Global is defined.
Python equivalent of the CLIPS defglobal-module command.
"""
modname = ffi.string(lib.EnvDefglobalModule(self._env, self._glb))
defmodule = lib.EnvFindDefmodule(self._env, modname)
return Module(self._env,... | The module in which the Global is defined.
Python equivalent of the CLIPS defglobal-module command. | entailment |
def watch(self, flag):
"""Whether or not the Global is being watched."""
lib.EnvSetDefglobalWatch(self._env, int(flag), self._glb) | Whether or not the Global is being watched. | entailment |
def undefine(self):
"""Undefine the Global.
Python equivalent of the CLIPS undefglobal command.
The object becomes unusable after this method has been called.
"""
if lib.EnvUndefglobal(self._env, self._glb) != 1:
raise CLIPSError(self._env)
self._env = Non... | Undefine the Global.
Python equivalent of the CLIPS undefglobal command.
The object becomes unusable after this method has been called. | entailment |
def name(self):
"""Global name."""
return ffi.string(
lib.EnvGetDefmoduleName(self._env, self._mdl)).decode() | Global name. | entailment |
def functions(self):
"""Iterates over the defined Globals."""
deffunction = lib.EnvGetNextDeffunction(self._env, ffi.NULL)
while deffunction != ffi.NULL:
yield Function(self._env, deffunction)
deffunction = lib.EnvGetNextDeffunction(self._env, deffunction) | Iterates over the defined Globals. | entailment |
def find_function(self, name):
"""Find the Function by its name."""
deffunction = lib.EnvFindDeffunction(self._env, name.encode())
if deffunction == ffi.NULL:
raise LookupError("Function '%s' not found" % name)
return Function(self._env, deffunction) | Find the Function by its name. | entailment |
def generics(self):
"""Iterates over the defined Generics."""
defgeneric = lib.EnvGetNextDefgeneric(self._env, ffi.NULL)
while defgeneric != ffi.NULL:
yield Generic(self._env, defgeneric)
defgeneric = lib.EnvGetNextDefgeneric(self._env, defgeneric) | Iterates over the defined Generics. | entailment |
def find_generic(self, name):
"""Find the Generic by its name."""
defgeneric = lib.EnvFindDefgeneric(self._env, name.encode())
if defgeneric == ffi.NULL:
raise LookupError("Generic '%s' not found" % name)
return Generic(self._env, defgeneric) | Find the Generic by its name. | entailment |
def name(self):
"""Function name."""
return ffi.string(
lib.EnvGetDeffunctionName(self._env, self._fnc)).decode() | Function name. | entailment |
def module(self):
"""The module in which the Function is defined.
Python equivalent of the CLIPS deffunction-module command.
"""
modname = ffi.string(lib.EnvDeffunctionModule(self._env, self._fnc))
defmodule = lib.EnvFindDefmodule(self._env, modname)
return Module(self... | The module in which the Function is defined.
Python equivalent of the CLIPS deffunction-module command. | entailment |
def watch(self, flag):
"""Whether or not the Function is being watched."""
lib.EnvSetDeffunctionWatch(self._env, int(flag), self._fnc) | Whether or not the Function is being watched. | entailment |
def undefine(self):
"""Undefine the Function.
Python equivalent of the CLIPS undeffunction command.
The object becomes unusable after this method has been called.
"""
if lib.EnvUndeffunction(self._env, self._fnc) != 1:
raise CLIPSError(self._env)
self._env... | Undefine the Function.
Python equivalent of the CLIPS undeffunction command.
The object becomes unusable after this method has been called. | entailment |
def undefine(self):
"""Undefine the Generic.
Python equivalent of the CLIPS undefgeneric command.
The object becomes unusable after this method has been called.
"""
if lib.EnvUndefgeneric(self._env, self._gnc) != 1:
raise CLIPSError(self._env)
self._env = ... | Undefine the Generic.
Python equivalent of the CLIPS undefgeneric command.
The object becomes unusable after this method has been called. | entailment |
def undefine(self):
"""Undefine the Method.
Python equivalent of the CLIPS undefmethod command.
The object becomes unusable after this method has been called.
"""
if lib.EnvUndefmethod(self._env, self._gnc, self._idx) != 1:
raise CLIPSError(self._env)
self... | Undefine the Method.
Python equivalent of the CLIPS undefmethod command.
The object becomes unusable after this method has been called. | entailment |
def _get_deviation_of_mean(self, series, multiplier=3):
"""
Returns count of values deviating of the mean, i.e. larger than `multiplier` * `std`.
:type series:
:param multiplier:
:return:
"""
capped_series = np.minimum(
series, series.mean() + multipli... | Returns count of values deviating of the mean, i.e. larger than `multiplier` * `std`.
:type series:
:param multiplier:
:return: | entailment |
def _get_median_absolute_deviation(self, series, multiplier=3):
"""
Returns count of values larger than `multiplier` * `mad`
:type series:
:param multiplier:
:return (array):
"""
capped_series = np.minimum(
series, series.median() + multiplier * series... | Returns count of values larger than `multiplier` * `mad`
:type series:
:param multiplier:
:return (array): | entailment |
def get_columns(self, df, usage, columns=None):
"""
Returns a `data_frame.columns`.
:param df: dataframe to select columns from
:param usage: should be a value from [ALL, INCLUDE, EXCLUDE].
this value only makes sense if attr `columns` is also set.
... | Returns a `data_frame.columns`.
:param df: dataframe to select columns from
:param usage: should be a value from [ALL, INCLUDE, EXCLUDE].
this value only makes sense if attr `columns` is also set.
otherwise, should be used with default value ALL.
... | entailment |
def clustering_gmm(data,
n_clusters,
tol=1e-7,
min_covar=None,
scale='logicle'):
"""
Find clusters in an array using a Gaussian Mixture Model.
Before clustering, `data` can be automatically rescaled as specified by
the `scale` ... | Find clusters in an array using a Gaussian Mixture Model.
Before clustering, `data` can be automatically rescaled as specified by
the `scale` argument.
Parameters
----------
data : FCSData or array_like
Data to cluster.
n_clusters : int
Number of clusters to find.
tol : flo... | entailment |
def selection_std(populations,
low=None,
high=None,
n_std_low=2.5,
n_std_high=2.5,
scale='logicle'):
"""
Select populations if most of their elements are between two values.
This function selects populations from `pop... | Select populations if most of their elements are between two values.
This function selects populations from `populations` if their means are
more than `n_std_low` standard deviations greater than `low` and
`n_std_high` standard deviations lower than `high`.
Optionally, all elements in `populations` ca... | entailment |
def fit_beads_autofluorescence(fl_rfi, fl_mef):
"""
Fit a standard curve using a beads model with autofluorescence.
Parameters
----------
fl_rfi : array
Fluorescence values of bead populations in units of Relative
Fluorescence Intensity (RFI).
fl_mef : array
Fluorescence... | Fit a standard curve using a beads model with autofluorescence.
Parameters
----------
fl_rfi : array
Fluorescence values of bead populations in units of Relative
Fluorescence Intensity (RFI).
fl_mef : array
Fluorescence values of bead populations in MEF units.
Returns
-... | entailment |
def plot_standard_curve(fl_rfi,
fl_mef,
beads_model,
std_crv,
xscale='linear',
yscale='linear',
xlim=None,
ylim=(1.,1e8)):
"""
Plot a standard c... | Plot a standard curve with fluorescence of calibration beads.
Parameters
----------
fl_rfi : array_like
Fluorescence of the calibration beads' subpopulations, in RFI
units.
fl_mef : array_like
Fluorescence of the calibration beads' subpopulations, in MEF
units.
beads... | entailment |
def get_transform_fxn(data_beads,
mef_values,
mef_channels,
clustering_fxn=clustering_gmm,
clustering_params={},
clustering_channels=None,
statistic_fxn=FlowCal.stats.median,
... | Get a transformation function to convert flow cytometry data to MEF.
Parameters
----------
data_beads : FCSData object
Flow cytometry data describing calibration beads.
mef_values : sequence of sequences
Known MEF values for the calibration bead subpopulations, for each
channel ... | entailment |
def read_table(filename, sheetname, index_col=None):
"""
Return the contents of an Excel table as a pandas DataFrame.
Parameters
----------
filename : str
Name of the Excel file to read.
sheetname : str or int
Name or index of the sheet inside the Excel file to read.
index_c... | Return the contents of an Excel table as a pandas DataFrame.
Parameters
----------
filename : str
Name of the Excel file to read.
sheetname : str or int
Name or index of the sheet inside the Excel file to read.
index_col : str, optional
Column name or index to be used as row... | entailment |
def write_workbook(filename, table_list, column_width=None):
"""
Write an Excel workbook from a list of tables.
Parameters
----------
filename : str
Name of the Excel file to write.
table_list : list of ``(str, DataFrame)`` tuples
Tables to be saved as individual sheets in the E... | Write an Excel workbook from a list of tables.
Parameters
----------
filename : str
Name of the Excel file to write.
table_list : list of ``(str, DataFrame)`` tuples
Tables to be saved as individual sheets in the Excel table. Each
tuple contains two values: the name of the sheet... | entailment |
def process_beads_table(beads_table,
instruments_table,
base_dir=".",
verbose=False,
plot=False,
plot_dir=None,
full_output=False,
get_transform_fxn_kwa... | Process calibration bead samples, as specified by an input table.
This function processes the entries in `beads_table`. For each row, the
function does the following:
- Load the FCS file specified in the field "File Path".
- Transform the forward scatter/side scatter and fluorescence
... | entailment |
def process_samples_table(samples_table,
instruments_table,
mef_transform_fxns=None,
beads_table=None,
base_dir=".",
verbose=False,
plot=False,
... | Process flow cytometry samples, as specified by an input table.
The function processes each entry in `samples_table`, and does the
following:
- Load the FCS file specified in the field "File Path".
- Transform the forward scatter/side scatter to RFI.
- Transform the fluorescence channel... | entailment |
def add_beads_stats(beads_table, beads_samples, mef_outputs=None):
"""
Add stats fields to beads table.
The following information is added to each row:
- Notes (warnings, errors) resulting from the analysis
- Number of Events
- Acquisition Time (s)
The following information is... | Add stats fields to beads table.
The following information is added to each row:
- Notes (warnings, errors) resulting from the analysis
- Number of Events
- Acquisition Time (s)
The following information is added for each row, for each channel in
which MEF values have been specifi... | entailment |
def add_samples_stats(samples_table, samples):
"""
Add stats fields to samples table.
The following information is added to each row:
- Notes (warnings, errors) resulting from the analysis
- Number of Events
- Acquisition Time (s)
The following information is added for each ro... | Add stats fields to samples table.
The following information is added to each row:
- Notes (warnings, errors) resulting from the analysis
- Number of Events
- Acquisition Time (s)
The following information is added for each row, for each channel in
which fluorescence units have be... | entailment |
def generate_histograms_table(samples_table, samples, max_bins=1024):
"""
Generate a table of histograms as a DataFrame.
Parameters
----------
samples_table : DataFrame
Table specifying samples to analyze. For more information about the
fields required in this table, please consult ... | Generate a table of histograms as a DataFrame.
Parameters
----------
samples_table : DataFrame
Table specifying samples to analyze. For more information about the
fields required in this table, please consult the module's
documentation.
samples : list
FCSData objects fro... | entailment |
def generate_about_table(extra_info={}):
"""
Make a table with information about FlowCal and the current analysis.
Parameters
----------
extra_info : dict, optional
Additional keyword:value pairs to include in the table.
Returns
-------
about_table : DataFrame
Table wit... | Make a table with information about FlowCal and the current analysis.
Parameters
----------
extra_info : dict, optional
Additional keyword:value pairs to include in the table.
Returns
-------
about_table : DataFrame
Table with information about FlowCal and the current analysis,... | entailment |
def show_open_file_dialog(filetypes):
"""
Show an open file dialog and return the path of the file selected.
Parameters
----------
filetypes : list of tuples
Types of file to show on the dialog. Each tuple on the list must
have two elements associated with a filetype: the first elem... | Show an open file dialog and return the path of the file selected.
Parameters
----------
filetypes : list of tuples
Types of file to show on the dialog. Each tuple on the list must
have two elements associated with a filetype: the first element is
a description, and the second is th... | entailment |
def run(input_path=None,
output_path=None,
verbose=True,
plot=True,
hist_sheet=False):
"""
Run the MS Excel User Interface.
This function performs the following:
1. If `input_path` is not specified, show a dialog to choose an input
Excel file.
2. Extract d... | Run the MS Excel User Interface.
This function performs the following:
1. If `input_path` is not specified, show a dialog to choose an input
Excel file.
2. Extract data from the Instruments, Beads, and Samples tables.
3. Process all the bead samples specified in the Beads table.
4. Gen... | entailment |
def run_command_line(args=None):
"""
Entry point for the FlowCal and flowcal console scripts.
Parameters
----------
args: list of strings, optional
Command line arguments. If None or not specified, get arguments
from ``sys.argv``.
See Also
----------
FlowCal.excel_ui.ru... | Entry point for the FlowCal and flowcal console scripts.
Parameters
----------
args: list of strings, optional
Command line arguments. If None or not specified, get arguments
from ``sys.argv``.
See Also
----------
FlowCal.excel_ui.run()
http://amir.rachum.com/blog/2017/07/... | entailment |
def read_fcs_header_segment(buf, begin=0):
"""
Read HEADER segment of FCS file.
Parameters
----------
buf : file-like object
Buffer containing data to interpret as HEADER segment.
begin : int
Offset (in bytes) to first byte of HEADER segment in `buf`.
Returns
-------
... | Read HEADER segment of FCS file.
Parameters
----------
buf : file-like object
Buffer containing data to interpret as HEADER segment.
begin : int
Offset (in bytes) to first byte of HEADER segment in `buf`.
Returns
-------
header : namedtuple
Version information and b... | entailment |
def read_fcs_text_segment(buf, begin, end, delim=None, supplemental=False):
"""
Read TEXT segment of FCS file.
Parameters
----------
buf : file-like object
Buffer containing data to interpret as TEXT segment.
begin : int
Offset (in bytes) to first byte of TEXT segment in `buf`.
... | Read TEXT segment of FCS file.
Parameters
----------
buf : file-like object
Buffer containing data to interpret as TEXT segment.
begin : int
Offset (in bytes) to first byte of TEXT segment in `buf`.
end : int
Offset (in bytes) to last byte of TEXT segment in `buf`.
delim... | entailment |
def read_fcs_data_segment(buf,
begin,
end,
datatype,
num_events,
param_bit_widths,
big_endian,
param_ranges=None):
"""
Read DATA s... | Read DATA segment of FCS file.
Parameters
----------
buf : file-like object
Buffer containing data to interpret as DATA segment.
begin : int
Offset (in bytes) to first byte of DATA segment in `buf`.
end : int
Offset (in bytes) to last byte of DATA segment in `buf`.
datat... | entailment |
def acquisition_time(self):
"""
Acquisition time, in seconds.
The acquisition time is calculated using the 'time' channel by
default (channel name is case independent). If the 'time' channel
is not available, the acquisition_start_time and
acquisition_end_time, extracted... | Acquisition time, in seconds.
The acquisition time is calculated using the 'time' channel by
default (channel name is case independent). If the 'time' channel
is not available, the acquisition_start_time and
acquisition_end_time, extracted from the $BTIM and $ETIM keyword
parame... | entailment |
def amplification_type(self, channels=None):
"""
Get the amplification type used for the specified channel(s).
Each channel uses one of two amplification types: linear or
logarithmic. This function returns, for each channel, a tuple of
two numbers, in which the first number indi... | Get the amplification type used for the specified channel(s).
Each channel uses one of two amplification types: linear or
logarithmic. This function returns, for each channel, a tuple of
two numbers, in which the first number indicates the number of
decades covered by the logarithmic am... | entailment |
def detector_voltage(self, channels=None):
"""
Get the detector voltage used for the specified channel(s).
The detector voltage for channel "n" is extracted from the $PnV
parameter, if available.
Parameters
----------
channels : int, str, list of int, list of st... | Get the detector voltage used for the specified channel(s).
The detector voltage for channel "n" is extracted from the $PnV
parameter, if available.
Parameters
----------
channels : int, str, list of int, list of str
Channel(s) for which to get the detector voltage.... | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.