partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
test | D.filter_trim | Remove points from the start and end of filter regions.
Parameters
----------
start, end : int
The number of points to remove from the start and end of
the specified filter.
filt : valid filter string or bool
Which filter to trim. If True, app... | latools/D_obj.py | def filter_trim(self, start=1, end=1, filt=True):
"""
Remove points from the start and end of filter regions.
Parameters
----------
start, end : int
The number of points to remove from the start and end of
the specified filter.
filt : vali... | def filter_trim(self, start=1, end=1, filt=True):
"""
Remove points from the start and end of filter regions.
Parameters
----------
start, end : int
The number of points to remove from the start and end of
the specified filter.
filt : vali... | [
"Remove",
"points",
"from",
"the",
"start",
"and",
"end",
"of",
"filter",
"regions",
".",
"Parameters",
"----------",
"start",
"end",
":",
"int",
"The",
"number",
"of",
"points",
"to",
"remove",
"from",
"the",
"start",
"and",
"end",
"of",
"the",
"specified... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1099-L1121 | [
"def",
"filter_trim",
"(",
"self",
",",
"start",
"=",
"1",
",",
"end",
"=",
"1",
",",
"filt",
"=",
"True",
")",
":",
"params",
"=",
"locals",
"(",
")",
"del",
"(",
"params",
"[",
"'self'",
"]",
")",
"f",
"=",
"self",
".",
"filt",
".",
"grab_fil... | cd25a650cfee318152f234d992708511f7047fbe |
test | D.filter_exclude_downhole | Exclude all points down-hole (after) the first excluded data.
Parameters
----------
threhold : int
The minimum number of contiguous excluded data points
that must exist before downhole exclusion occurs.
file : valid filter string or bool
Which filter ... | latools/D_obj.py | def filter_exclude_downhole(self, threshold, filt=True):
"""
Exclude all points down-hole (after) the first excluded data.
Parameters
----------
threhold : int
The minimum number of contiguous excluded data points
that must exist before downhole exclusion... | def filter_exclude_downhole(self, threshold, filt=True):
"""
Exclude all points down-hole (after) the first excluded data.
Parameters
----------
threhold : int
The minimum number of contiguous excluded data points
that must exist before downhole exclusion... | [
"Exclude",
"all",
"points",
"down",
"-",
"hole",
"(",
"after",
")",
"the",
"first",
"excluded",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1124-L1152 | [
"def",
"filter_exclude_downhole",
"(",
"self",
",",
"threshold",
",",
"filt",
"=",
"True",
")",
":",
"f",
"=",
"self",
".",
"filt",
".",
"grab_filt",
"(",
"filt",
")",
"if",
"self",
".",
"n",
"==",
"1",
":",
"nfilt",
"=",
"filters",
".",
"exclude_dow... | cd25a650cfee318152f234d992708511f7047fbe |
test | D.signal_optimiser | Optimise data selection based on specified analytes.
Identifies the longest possible contiguous data region in
the signal where the relative standard deviation (std) and
concentration of all analytes is minimised.
Optimisation is performed via a grid search of all possible
con... | latools/D_obj.py | def signal_optimiser(self, analytes, min_points=5,
threshold_mode='kde_first_max',
threshold_mult=1., x_bias=0,
weights=None, filt=True, mode='minimise'):
"""
Optimise data selection based on specified analytes.
Identifi... | def signal_optimiser(self, analytes, min_points=5,
threshold_mode='kde_first_max',
threshold_mult=1., x_bias=0,
weights=None, filt=True, mode='minimise'):
"""
Optimise data selection based on specified analytes.
Identifi... | [
"Optimise",
"data",
"selection",
"based",
"on",
"specified",
"analytes",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1156-L1252 | [
"def",
"signal_optimiser",
"(",
"self",
",",
"analytes",
",",
"min_points",
"=",
"5",
",",
"threshold_mode",
"=",
"'kde_first_max'",
",",
"threshold_mult",
"=",
"1.",
",",
"x_bias",
"=",
"0",
",",
"weights",
"=",
"None",
",",
"filt",
"=",
"True",
",",
"m... | cd25a650cfee318152f234d992708511f7047fbe |
test | D.tplot | Plot analytes as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to plot.
None = all analytes.
figsize : tuple
size of final figure.
scale : str or None
'log' = plot data ... | latools/D_obj.py | def tplot(self, analytes=None, figsize=[10, 4], scale='log', filt=None,
ranges=False, stats=False, stat='nanmean', err='nanstd',
focus_stage=None, err_envelope=False, ax=None):
"""
Plot analytes as a function of Time.
Parameters
----------
analytes : ... | def tplot(self, analytes=None, figsize=[10, 4], scale='log', filt=None,
ranges=False, stats=False, stat='nanmean', err='nanstd',
focus_stage=None, err_envelope=False, ax=None):
"""
Plot analytes as a function of Time.
Parameters
----------
analytes : ... | [
"Plot",
"analytes",
"as",
"a",
"function",
"of",
"Time",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1274-L1312 | [
"def",
"tplot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"figsize",
"=",
"[",
"10",
",",
"4",
"]",
",",
"scale",
"=",
"'log'",
",",
"filt",
"=",
"None",
",",
"ranges",
"=",
"False",
",",
"stats",
"=",
"False",
",",
"stat",
"=",
"'nanmean'"... | cd25a650cfee318152f234d992708511f7047fbe |
test | D.gplot | Plot analytes gradients as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to plot.
None = all analytes.
win : int
The window over which to calculate the rolling gradient.
figsize : ... | latools/D_obj.py | def gplot(self, analytes=None, win=5, figsize=[10, 4],
ranges=False, focus_stage=None, ax=None):
"""
Plot analytes gradients as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to plot.
... | def gplot(self, analytes=None, win=5, figsize=[10, 4],
ranges=False, focus_stage=None, ax=None):
"""
Plot analytes gradients as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to plot.
... | [
"Plot",
"analytes",
"gradients",
"as",
"a",
"function",
"of",
"Time",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1315-L1338 | [
"def",
"gplot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"win",
"=",
"5",
",",
"figsize",
"=",
"[",
"10",
",",
"4",
"]",
",",
"ranges",
"=",
"False",
",",
"focus_stage",
"=",
"None",
",",
"ax",
"=",
"None",
")",
":",
"return",
"plot",
".... | cd25a650cfee318152f234d992708511f7047fbe |
test | D.crossplot | Plot analytes against each other.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
lognorm : bool
Whether or not to log normalise the colour scale
of the 2D histogram.
bins : int
... | latools/D_obj.py | def crossplot(self, analytes=None, bins=25, lognorm=True, filt=True, colourful=True, figsize=(12, 12)):
"""
Plot analytes against each other.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
lognor... | def crossplot(self, analytes=None, bins=25, lognorm=True, filt=True, colourful=True, figsize=(12, 12)):
"""
Plot analytes against each other.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
lognor... | [
"Plot",
"analytes",
"against",
"each",
"other",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1392-L1507 | [
"def",
"crossplot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"bins",
"=",
"25",
",",
"lognorm",
"=",
"True",
",",
"filt",
"=",
"True",
",",
"colourful",
"=",
"True",
",",
"figsize",
"=",
"(",
"12",
",",
"12",
")",
")",
":",
"if",
"analytes... | cd25a650cfee318152f234d992708511f7047fbe |
test | D.crossplot_filters | Plot the results of a group of filters in a crossplot.
Parameters
----------
filter_string : str
A string that identifies a group of filters.
e.g. 'test' would plot all filters with 'test' in the
name.
analytes : optional, array_like or str
... | latools/D_obj.py | def crossplot_filters(self, filter_string, analytes=None):
"""
Plot the results of a group of filters in a crossplot.
Parameters
----------
filter_string : str
A string that identifies a group of filters.
e.g. 'test' would plot all filters with 'test' in ... | def crossplot_filters(self, filter_string, analytes=None):
"""
Plot the results of a group of filters in a crossplot.
Parameters
----------
filter_string : str
A string that identifies a group of filters.
e.g. 'test' would plot all filters with 'test' in ... | [
"Plot",
"the",
"results",
"of",
"a",
"group",
"of",
"filters",
"in",
"a",
"crossplot",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1509-L1606 | [
"def",
"crossplot_filters",
"(",
"self",
",",
"filter_string",
",",
"analytes",
"=",
"None",
")",
":",
"if",
"analytes",
"is",
"None",
":",
"analytes",
"=",
"[",
"a",
"for",
"a",
"in",
"self",
".",
"analytes",
"if",
"'Ca'",
"not",
"in",
"a",
"]",
"# ... | cd25a650cfee318152f234d992708511f7047fbe |
test | D.filter_report | Visualise effect of data filters.
Parameters
----------
filt : str
Exact or partial name of filter to plot. Supports
partial matching. i.e. if 'cluster' is specified, all
filters with 'cluster' in the name will be plotted.
Defaults to all filters.... | latools/D_obj.py | def filter_report(self, filt=None, analytes=None, savedir=None, nbin=5):
"""
Visualise effect of data filters.
Parameters
----------
filt : str
Exact or partial name of filter to plot. Supports
partial matching. i.e. if 'cluster' is specified, all
... | def filter_report(self, filt=None, analytes=None, savedir=None, nbin=5):
"""
Visualise effect of data filters.
Parameters
----------
filt : str
Exact or partial name of filter to plot. Supports
partial matching. i.e. if 'cluster' is specified, all
... | [
"Visualise",
"effect",
"of",
"data",
"filters",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1615-L1635 | [
"def",
"filter_report",
"(",
"self",
",",
"filt",
"=",
"None",
",",
"analytes",
"=",
"None",
",",
"savedir",
"=",
"None",
",",
"nbin",
"=",
"5",
")",
":",
"return",
"plot",
".",
"filter_report",
"(",
"self",
",",
"filt",
",",
"analytes",
",",
"savedi... | cd25a650cfee318152f234d992708511f7047fbe |
test | D.get_params | Returns paramters used to process data.
Returns
-------
dict
dict of analysis parameters | latools/D_obj.py | def get_params(self):
"""
Returns paramters used to process data.
Returns
-------
dict
dict of analysis parameters
"""
outputs = ['sample',
'ratio_params',
'despike_params',
'autorange_params',
... | def get_params(self):
"""
Returns paramters used to process data.
Returns
-------
dict
dict of analysis parameters
"""
outputs = ['sample',
'ratio_params',
'despike_params',
'autorange_params',
... | [
"Returns",
"paramters",
"used",
"to",
"process",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/D_obj.py#L1638-L1661 | [
"def",
"get_params",
"(",
"self",
")",
":",
"outputs",
"=",
"[",
"'sample'",
",",
"'ratio_params'",
",",
"'despike_params'",
",",
"'autorange_params'",
",",
"'bkgcorrect_params'",
"]",
"out",
"=",
"{",
"}",
"for",
"o",
"in",
"outputs",
":",
"out",
"[",
"o"... | cd25a650cfee318152f234d992708511f7047fbe |
test | tplot | Plot analytes as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to plot.
None = all analytes.
figsize : tuple
size of final figure.
scale : str or None
'log' = plot data ... | latools/helpers/plot.py | def tplot(self, analytes=None, figsize=[10, 4], scale='log', filt=None,
ranges=False, stats=False, stat='nanmean', err='nanstd',
focus_stage=None, err_envelope=False, ax=None):
"""
Plot analytes as a function of Time.
Parameters
----------
analytes : ... | def tplot(self, analytes=None, figsize=[10, 4], scale='log', filt=None,
ranges=False, stats=False, stat='nanmean', err='nanstd',
focus_stage=None, err_envelope=False, ax=None):
"""
Plot analytes as a function of Time.
Parameters
----------
analytes : ... | [
"Plot",
"analytes",
"as",
"a",
"function",
"of",
"Time",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/plot.py#L23-L173 | [
"def",
"tplot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"figsize",
"=",
"[",
"10",
",",
"4",
"]",
",",
"scale",
"=",
"'log'",
",",
"filt",
"=",
"None",
",",
"ranges",
"=",
"False",
",",
"stats",
"=",
"False",
",",
"stat",
"=",
"'nanmean'"... | cd25a650cfee318152f234d992708511f7047fbe |
test | gplot | Plot analytes gradients as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to plot.
None = all analytes.
win : int
The window over which to calculate the rolling gradient.
figsize : ... | latools/helpers/plot.py | def gplot(self, analytes=None, win=25, figsize=[10, 4],
ranges=False, focus_stage=None, ax=None, recalc=True):
"""
Plot analytes gradients as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to... | def gplot(self, analytes=None, win=25, figsize=[10, 4],
ranges=False, focus_stage=None, ax=None, recalc=True):
"""
Plot analytes gradients as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to... | [
"Plot",
"analytes",
"gradients",
"as",
"a",
"function",
"of",
"Time",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/plot.py#L175-L254 | [
"def",
"gplot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"win",
"=",
"25",
",",
"figsize",
"=",
"[",
"10",
",",
"4",
"]",
",",
"ranges",
"=",
"False",
",",
"focus_stage",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"recalc",
"=",
"True",
"... | cd25a650cfee318152f234d992708511f7047fbe |
test | crossplot | Plot analytes against each other.
The number of plots is n**2 - n, where n = len(keys).
Parameters
----------
dat : dict
A dictionary of key: data pairs, where data is the same
length in each entry.
keys : optional, array_like or str
The keys of dat to plot. Defaults to all... | latools/helpers/plot.py | def crossplot(dat, keys=None, lognorm=True, bins=25, figsize=(12, 12),
colourful=True, focus_stage=None, denominator=None,
mode='hist2d', cmap=None, **kwargs):
"""
Plot analytes against each other.
The number of plots is n**2 - n, where n = len(keys).
Parameters
-------... | def crossplot(dat, keys=None, lognorm=True, bins=25, figsize=(12, 12),
colourful=True, focus_stage=None, denominator=None,
mode='hist2d', cmap=None, **kwargs):
"""
Plot analytes against each other.
The number of plots is n**2 - n, where n = len(keys).
Parameters
-------... | [
"Plot",
"analytes",
"against",
"each",
"other",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/plot.py#L256-L390 | [
"def",
"crossplot",
"(",
"dat",
",",
"keys",
"=",
"None",
",",
"lognorm",
"=",
"True",
",",
"bins",
"=",
"25",
",",
"figsize",
"=",
"(",
"12",
",",
"12",
")",
",",
"colourful",
"=",
"True",
",",
"focus_stage",
"=",
"None",
",",
"denominator",
"=",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | histograms | Plot histograms of all items in dat.
Parameters
----------
dat : dict
Data in {key: array} pairs.
keys : arra-like
The keys in dat that you want to plot. If None,
all are plotted.
bins : int
The number of bins in each histogram (default = 25)
logy : bool
... | latools/helpers/plot.py | def histograms(dat, keys=None, bins=25, logy=False, cmap=None, ncol=4):
"""
Plot histograms of all items in dat.
Parameters
----------
dat : dict
Data in {key: array} pairs.
keys : arra-like
The keys in dat that you want to plot. If None,
all are plotted.
bins : int
... | def histograms(dat, keys=None, bins=25, logy=False, cmap=None, ncol=4):
"""
Plot histograms of all items in dat.
Parameters
----------
dat : dict
Data in {key: array} pairs.
keys : arra-like
The keys in dat that you want to plot. If None,
all are plotted.
bins : int
... | [
"Plot",
"histograms",
"of",
"all",
"items",
"in",
"dat",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/plot.py#L393-L456 | [
"def",
"histograms",
"(",
"dat",
",",
"keys",
"=",
"None",
",",
"bins",
"=",
"25",
",",
"logy",
"=",
"False",
",",
"cmap",
"=",
"None",
",",
"ncol",
"=",
"4",
")",
":",
"if",
"keys",
"is",
"None",
":",
"keys",
"=",
"dat",
".",
"keys",
"(",
")... | cd25a650cfee318152f234d992708511f7047fbe |
test | autorange_plot | Function for visualising the autorange mechanism.
Parameters
----------
t : array-like
Independent variable (usually time).
sig : array-like
Dependent signal, with distinctive 'on' and 'off' regions.
gwin : int
The window used for calculating first derivative.
Defaul... | latools/helpers/plot.py | def autorange_plot(t, sig, gwin=7, swin=None, win=30,
on_mult=(1.5, 1.), off_mult=(1., 1.5),
nbin=10, thresh=None):
"""
Function for visualising the autorange mechanism.
Parameters
----------
t : array-like
Independent variable (usually time).
sig :... | def autorange_plot(t, sig, gwin=7, swin=None, win=30,
on_mult=(1.5, 1.), off_mult=(1., 1.5),
nbin=10, thresh=None):
"""
Function for visualising the autorange mechanism.
Parameters
----------
t : array-like
Independent variable (usually time).
sig :... | [
"Function",
"for",
"visualising",
"the",
"autorange",
"mechanism",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/plot.py#L459-L690 | [
"def",
"autorange_plot",
"(",
"t",
",",
"sig",
",",
"gwin",
"=",
"7",
",",
"swin",
"=",
"None",
",",
"win",
"=",
"30",
",",
"on_mult",
"=",
"(",
"1.5",
",",
"1.",
")",
",",
"off_mult",
"=",
"(",
"1.",
",",
"1.5",
")",
",",
"nbin",
"=",
"10",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | calibration_plot | Plot the calibration lines between measured and known SRM values.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
datarange : boolean
Whether or not to show the distribution of the measured data
alongside the calibra... | latools/helpers/plot.py | def calibration_plot(self, analytes=None, datarange=True, loglog=False, ncol=3, srm_group=None, save=True):
"""
Plot the calibration lines between measured and known SRM values.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
... | def calibration_plot(self, analytes=None, datarange=True, loglog=False, ncol=3, srm_group=None, save=True):
"""
Plot the calibration lines between measured and known SRM values.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
... | [
"Plot",
"the",
"calibration",
"lines",
"between",
"measured",
"and",
"known",
"SRM",
"values",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/plot.py#L692-L941 | [
"def",
"calibration_plot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"datarange",
"=",
"True",
",",
"loglog",
"=",
"False",
",",
"ncol",
"=",
"3",
",",
"srm_group",
"=",
"None",
",",
"save",
"=",
"True",
")",
":",
"if",
"isinstance",
"(",
"anal... | cd25a650cfee318152f234d992708511f7047fbe |
test | filter_report | Visualise effect of data filters.
Parameters
----------
filt : str
Exact or partial name of filter to plot. Supports
partial matching. i.e. if 'cluster' is specified, all
filters with 'cluster' in the name will be plotted.
Defaults to all filters.
analyte : str
N... | latools/helpers/plot.py | def filter_report(Data, filt=None, analytes=None, savedir=None, nbin=5):
"""
Visualise effect of data filters.
Parameters
----------
filt : str
Exact or partial name of filter to plot. Supports
partial matching. i.e. if 'cluster' is specified, all
filters with 'cluster' in t... | def filter_report(Data, filt=None, analytes=None, savedir=None, nbin=5):
"""
Visualise effect of data filters.
Parameters
----------
filt : str
Exact or partial name of filter to plot. Supports
partial matching. i.e. if 'cluster' is specified, all
filters with 'cluster' in t... | [
"Visualise",
"effect",
"of",
"data",
"filters",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/plot.py#L1002-L1159 | [
"def",
"filter_report",
"(",
"Data",
",",
"filt",
"=",
"None",
",",
"analytes",
"=",
"None",
",",
"savedir",
"=",
"None",
",",
"nbin",
"=",
"5",
")",
":",
"if",
"filt",
"is",
"None",
"or",
"filt",
"==",
"'all'",
":",
"sets",
"=",
"Data",
".",
"fi... | cd25a650cfee318152f234d992708511f7047fbe |
test | pairwise_reproducibility | Calculate the reproducibility of LA-ICPMS based on unique pairs of repeat analyses.
Pairwise differences are fit with a half-Cauchy distribution, and the median and
95% confidence limits are returned for each analyte.
Parameters
----------
df : pandas.DataFrame
A dataset
... | Supplement/comparison_tools/stats.py | def pairwise_reproducibility(df, plot=False):
"""
Calculate the reproducibility of LA-ICPMS based on unique pairs of repeat analyses.
Pairwise differences are fit with a half-Cauchy distribution, and the median and
95% confidence limits are returned for each analyte.
Parameters
------... | def pairwise_reproducibility(df, plot=False):
"""
Calculate the reproducibility of LA-ICPMS based on unique pairs of repeat analyses.
Pairwise differences are fit with a half-Cauchy distribution, and the median and
95% confidence limits are returned for each analyte.
Parameters
------... | [
"Calculate",
"the",
"reproducibility",
"of",
"LA",
"-",
"ICPMS",
"based",
"on",
"unique",
"pairs",
"of",
"repeat",
"analyses",
".",
"Pairwise",
"differences",
"are",
"fit",
"with",
"a",
"half",
"-",
"Cauchy",
"distribution",
"and",
"the",
"median",
"and",
"9... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/Supplement/comparison_tools/stats.py#L14-L81 | [
"def",
"pairwise_reproducibility",
"(",
"df",
",",
"plot",
"=",
"False",
")",
":",
"ans",
"=",
"df",
".",
"columns",
".",
"values",
"pdifs",
"=",
"[",
"]",
"# calculate differences between unique pairs",
"for",
"ind",
",",
"d",
"in",
"df",
".",
"groupby",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | comparison_stats | Compute comparison stats for test and LAtools data.
Population-level similarity assessed by a Kolmogorov-Smirnov test.
Individual similarity assessed by a pairwise Wilcoxon signed rank test.
Trends in residuals assessed by regression analysis, where significance of
the slope and intercept... | Supplement/comparison_tools/stats.py | def comparison_stats(df, els=['Mg', 'Sr', 'Ba', 'Al', 'Mn']):
"""
Compute comparison stats for test and LAtools data.
Population-level similarity assessed by a Kolmogorov-Smirnov test.
Individual similarity assessed by a pairwise Wilcoxon signed rank test.
Trends in residuals assessed... | def comparison_stats(df, els=['Mg', 'Sr', 'Ba', 'Al', 'Mn']):
"""
Compute comparison stats for test and LAtools data.
Population-level similarity assessed by a Kolmogorov-Smirnov test.
Individual similarity assessed by a pairwise Wilcoxon signed rank test.
Trends in residuals assessed... | [
"Compute",
"comparison",
"stats",
"for",
"test",
"and",
"LAtools",
"data",
".",
"Population",
"-",
"level",
"similarity",
"assessed",
"by",
"a",
"Kolmogorov",
"-",
"Smirnov",
"test",
".",
"Individual",
"similarity",
"assessed",
"by",
"a",
"pairwise",
"Wilcoxon",... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/Supplement/comparison_tools/stats.py#L83-L144 | [
"def",
"comparison_stats",
"(",
"df",
",",
"els",
"=",
"[",
"'Mg'",
",",
"'Sr'",
",",
"'Ba'",
",",
"'Al'",
",",
"'Mn'",
"]",
")",
":",
"# get corresponding analyte and ratio names",
"As",
"=",
"[",
"]",
"Rs",
"=",
"[",
"]",
"analytes",
"=",
"[",
"c",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | summary_stats | Compute summary statistics for paired x, y data.
Tests
-----
Parameters
----------
x, y : array-like
Data to compare
nm : str (optional)
Index value of created dataframe.
Returns
-------
pandas dataframe of statistics. | Supplement/comparison_tools/stats.py | def summary_stats(x, y, nm=None):
"""
Compute summary statistics for paired x, y data.
Tests
-----
Parameters
----------
x, y : array-like
Data to compare
nm : str (optional)
Index value of created dataframe.
Returns
-------
pandas dataframe of statistics.
... | def summary_stats(x, y, nm=None):
"""
Compute summary statistics for paired x, y data.
Tests
-----
Parameters
----------
x, y : array-like
Data to compare
nm : str (optional)
Index value of created dataframe.
Returns
-------
pandas dataframe of statistics.
... | [
"Compute",
"summary",
"statistics",
"for",
"paired",
"x",
"y",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/Supplement/comparison_tools/stats.py#L146-L225 | [
"def",
"summary_stats",
"(",
"x",
",",
"y",
",",
"nm",
"=",
"None",
")",
":",
"# create datafrane for results",
"if",
"isinstance",
"(",
"nm",
",",
"str",
")",
":",
"nm",
"=",
"[",
"nm",
"]",
"# cols = pd.MultiIndex.from_arrays([['', 'Pairwise', 'Pairwise', cat, c... | cd25a650cfee318152f234d992708511f7047fbe |
test | load_reference_data | Fetch LAtools reference data from online repository.
Parameters
----------
name : str<
Which data to download. Can be one of 'culture_reference',
'culture_test', 'downcore_reference', 'downcore_test', 'iolite_reference'
or 'zircon_reference'.
If None, all are downloaded and ... | Supplement/comparison_tools/helpers.py | def load_reference_data(name=None):
"""
Fetch LAtools reference data from online repository.
Parameters
----------
name : str<
Which data to download. Can be one of 'culture_reference',
'culture_test', 'downcore_reference', 'downcore_test', 'iolite_reference'
or 'zircon_refe... | def load_reference_data(name=None):
"""
Fetch LAtools reference data from online repository.
Parameters
----------
name : str<
Which data to download. Can be one of 'culture_reference',
'culture_test', 'downcore_reference', 'downcore_test', 'iolite_reference'
or 'zircon_refe... | [
"Fetch",
"LAtools",
"reference",
"data",
"from",
"online",
"repository",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/Supplement/comparison_tools/helpers.py#L18-L57 | [
"def",
"load_reference_data",
"(",
"name",
"=",
"None",
")",
":",
"base_url",
"=",
"'https://docs.google.com/spreadsheets/d/e/2PACX-1vQJfCeuqrtFFMAeSpA9rguzLAo9OVuw50AHhAULuqjMJzbd3h46PK1KjF69YiJAeNAAjjMDkJK7wMpG/pub?gid={:}&single=true&output=csv'",
"gids",
"=",
"{",
"'culture_reference... | cd25a650cfee318152f234d992708511f7047fbe |
test | AllInstances.lookup | Find an instance of the type class `TC` for type `G`.
Iterates `G`'s parent classes, looking up instances for each,
checking whether the instance is a subclass of the target type
class `TC`. | amino/tc/base.py | def lookup(self, TC: type, G: type) -> Optional[TypeClass]:
''' Find an instance of the type class `TC` for type `G`.
Iterates `G`'s parent classes, looking up instances for each,
checking whether the instance is a subclass of the target type
class `TC`.
'''
if isinstance... | def lookup(self, TC: type, G: type) -> Optional[TypeClass]:
''' Find an instance of the type class `TC` for type `G`.
Iterates `G`'s parent classes, looking up instances for each,
checking whether the instance is a subclass of the target type
class `TC`.
'''
if isinstance... | [
"Find",
"an",
"instance",
"of",
"the",
"type",
"class",
"TC",
"for",
"type",
"G",
".",
"Iterates",
"G",
"s",
"parent",
"classes",
"looking",
"up",
"instances",
"for",
"each",
"checking",
"whether",
"the",
"instance",
"is",
"a",
"subclass",
"of",
"the",
"... | tek/amino | python | https://github.com/tek/amino/blob/51b314933e047a45587a24ecff02c836706d27ff/amino/tc/base.py#L375-L401 | [
"def",
"lookup",
"(",
"self",
",",
"TC",
":",
"type",
",",
"G",
":",
"type",
")",
"->",
"Optional",
"[",
"TypeClass",
"]",
":",
"if",
"isinstance",
"(",
"G",
",",
"str",
")",
":",
"raise",
"ImplicitNotFound",
"(",
"TC",
",",
"G",
",",
"f'{G} is a s... | 51b314933e047a45587a24ecff02c836706d27ff |
test | rangecalc | Calculate padded range limits for axes. | Supplement/comparison_tools/plots.py | def rangecalc(x, y=None, pad=0.05):
"""
Calculate padded range limits for axes.
"""
mn = np.nanmin([np.nanmin(x), np.nanmin(y)])
mx = np.nanmax([np.nanmax(x), np.nanmax(y)])
rn = mx - mn
return (mn - pad * rn, mx + pad * rn) | def rangecalc(x, y=None, pad=0.05):
"""
Calculate padded range limits for axes.
"""
mn = np.nanmin([np.nanmin(x), np.nanmin(y)])
mx = np.nanmax([np.nanmax(x), np.nanmax(y)])
rn = mx - mn
return (mn - pad * rn, mx + pad * rn) | [
"Calculate",
"padded",
"range",
"limits",
"for",
"axes",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/Supplement/comparison_tools/plots.py#L19-L27 | [
"def",
"rangecalc",
"(",
"x",
",",
"y",
"=",
"None",
",",
"pad",
"=",
"0.05",
")",
":",
"mn",
"=",
"np",
".",
"nanmin",
"(",
"[",
"np",
".",
"nanmin",
"(",
"x",
")",
",",
"np",
".",
"nanmin",
"(",
"y",
")",
"]",
")",
"mx",
"=",
"np",
".",... | cd25a650cfee318152f234d992708511f7047fbe |
test | rangecalcx | Calculate padded range limits for axes. | Supplement/comparison_tools/plots.py | def rangecalcx(x, pad=0.05):
"""
Calculate padded range limits for axes.
"""
mn = np.nanmin(x)
mx = np.nanmax(x)
rn = mx - mn
return (mn - pad * rn, mx + pad * rn) | def rangecalcx(x, pad=0.05):
"""
Calculate padded range limits for axes.
"""
mn = np.nanmin(x)
mx = np.nanmax(x)
rn = mx - mn
return (mn - pad * rn, mx + pad * rn) | [
"Calculate",
"padded",
"range",
"limits",
"for",
"axes",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/Supplement/comparison_tools/plots.py#L29-L37 | [
"def",
"rangecalcx",
"(",
"x",
",",
"pad",
"=",
"0.05",
")",
":",
"mn",
"=",
"np",
".",
"nanmin",
"(",
"x",
")",
"mx",
"=",
"np",
".",
"nanmax",
"(",
"x",
")",
"rn",
"=",
"mx",
"-",
"mn",
"return",
"(",
"mn",
"-",
"pad",
"*",
"rn",
",",
"... | cd25a650cfee318152f234d992708511f7047fbe |
test | bland_altman | Draw a Bland-Altman plot of x and y data.
https://en.wikipedia.org/wiki/Bland%E2%80%93Altman_plot
Parameters
----------
x, y : array-like
x and y data to compare.
interval : float
Percentile band to draw on the residuals.
indep_conf : float
Independently determi... | Supplement/comparison_tools/plots.py | def bland_altman(x, y, interval=None, indep_conf=None, ax=None, c=None, **kwargs):
"""
Draw a Bland-Altman plot of x and y data.
https://en.wikipedia.org/wiki/Bland%E2%80%93Altman_plot
Parameters
----------
x, y : array-like
x and y data to compare.
interval : float
... | def bland_altman(x, y, interval=None, indep_conf=None, ax=None, c=None, **kwargs):
"""
Draw a Bland-Altman plot of x and y data.
https://en.wikipedia.org/wiki/Bland%E2%80%93Altman_plot
Parameters
----------
x, y : array-like
x and y data to compare.
interval : float
... | [
"Draw",
"a",
"Bland",
"-",
"Altman",
"plot",
"of",
"x",
"and",
"y",
"data",
".",
"https",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Bland%E2%80%93Altman_plot",
"Parameters",
"----------",
"x",
"y",
":",
"array",
"-",
"like",
"x"... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/Supplement/comparison_tools/plots.py#L250-L305 | [
"def",
"bland_altman",
"(",
"x",
",",
"y",
",",
"interval",
"=",
"None",
",",
"indep_conf",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"c",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"False",
"if",
"ax",
"is",
"None",
":",
"fig"... | cd25a650cfee318152f234d992708511f7047fbe |
test | autorange | Automatically separates signal and background in an on/off data stream.
**Step 1: Thresholding.**
The background signal is determined using a gaussian kernel density
estimator (kde) of all the data. Under normal circumstances, this
kde should find two distinct data distributions, corresponding to
'... | latools/processes/signal_id.py | def autorange(t, sig, gwin=7, swin=None, win=30,
on_mult=(1.5, 1.), off_mult=(1., 1.5),
nbin=10, transform='log', thresh=None):
"""
Automatically separates signal and background in an on/off data stream.
**Step 1: Thresholding.**
The background signal is determined using a g... | def autorange(t, sig, gwin=7, swin=None, win=30,
on_mult=(1.5, 1.), off_mult=(1., 1.5),
nbin=10, transform='log', thresh=None):
"""
Automatically separates signal and background in an on/off data stream.
**Step 1: Thresholding.**
The background signal is determined using a g... | [
"Automatically",
"separates",
"signal",
"and",
"background",
"in",
"an",
"on",
"/",
"off",
"data",
"stream",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/processes/signal_id.py#L8-L189 | [
"def",
"autorange",
"(",
"t",
",",
"sig",
",",
"gwin",
"=",
"7",
",",
"swin",
"=",
"None",
",",
"win",
"=",
"30",
",",
"on_mult",
"=",
"(",
"1.5",
",",
"1.",
")",
",",
"off_mult",
"=",
"(",
"1.",
",",
"1.5",
")",
",",
"nbin",
"=",
"10",
","... | cd25a650cfee318152f234d992708511f7047fbe |
test | autorange_components | Returns the components underlying the autorange algorithm.
Returns
-------
t : array-like
Time axis (independent variable)
sig : array-like
Raw signal (dependent variable)
sigs : array-like
Smoothed signal (swin)
tsig : array-like
Transformed raw signal (transfor... | latools/processes/signal_id.py | def autorange_components(t, sig, transform='log', gwin=7, swin=None,
win=30, on_mult=(1.5, 1.), off_mult=(1., 1.5),
thresh=None):
"""
Returns the components underlying the autorange algorithm.
Returns
-------
t : array-like
Time axis (indepe... | def autorange_components(t, sig, transform='log', gwin=7, swin=None,
win=30, on_mult=(1.5, 1.), off_mult=(1., 1.5),
thresh=None):
"""
Returns the components underlying the autorange algorithm.
Returns
-------
t : array-like
Time axis (indepe... | [
"Returns",
"the",
"components",
"underlying",
"the",
"autorange",
"algorithm",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/processes/signal_id.py#L191-L330 | [
"def",
"autorange_components",
"(",
"t",
",",
"sig",
",",
"transform",
"=",
"'log'",
",",
"gwin",
"=",
"7",
",",
"swin",
"=",
"None",
",",
"win",
"=",
"30",
",",
"on_mult",
"=",
"(",
"1.5",
",",
"1.",
")",
",",
"off_mult",
"=",
"(",
"1.",
",",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | elements | Loads a DataFrame of all elements and isotopes.
Scraped from https://www.webelements.com/
Returns
-------
pandas DataFrame with columns (element, atomic_number, isotope, atomic_weight, percent) | latools/helpers/chemistry.py | def elements(all_isotopes=True):
"""
Loads a DataFrame of all elements and isotopes.
Scraped from https://www.webelements.com/
Returns
-------
pandas DataFrame with columns (element, atomic_number, isotope, atomic_weight, percent)
"""
el = pd.read_pickle(pkgrs.resource_filename('latool... | def elements(all_isotopes=True):
"""
Loads a DataFrame of all elements and isotopes.
Scraped from https://www.webelements.com/
Returns
-------
pandas DataFrame with columns (element, atomic_number, isotope, atomic_weight, percent)
"""
el = pd.read_pickle(pkgrs.resource_filename('latool... | [
"Loads",
"a",
"DataFrame",
"of",
"all",
"elements",
"and",
"isotopes",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/chemistry.py#L6-L24 | [
"def",
"elements",
"(",
"all_isotopes",
"=",
"True",
")",
":",
"el",
"=",
"pd",
".",
"read_pickle",
"(",
"pkgrs",
".",
"resource_filename",
"(",
"'latools'",
",",
"'resources/elements.pkl'",
")",
")",
"if",
"all_isotopes",
":",
"return",
"el",
".",
"set_inde... | cd25a650cfee318152f234d992708511f7047fbe |
test | calc_M | Returns molecular weight of molecule.
Where molecule is in standard chemical notation,
e.g. 'CO2', 'HCO3' or B(OH)4
Returns
-------
molecular_weight : float | latools/helpers/chemistry.py | def calc_M(molecule):
"""
Returns molecular weight of molecule.
Where molecule is in standard chemical notation,
e.g. 'CO2', 'HCO3' or B(OH)4
Returns
-------
molecular_weight : float
"""
# load periodic table
els = elements()
# define regexs
parens = re.compile('\(([A... | def calc_M(molecule):
"""
Returns molecular weight of molecule.
Where molecule is in standard chemical notation,
e.g. 'CO2', 'HCO3' or B(OH)4
Returns
-------
molecular_weight : float
"""
# load periodic table
els = elements()
# define regexs
parens = re.compile('\(([A... | [
"Returns",
"molecular",
"weight",
"of",
"molecule",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/chemistry.py#L26-L75 | [
"def",
"calc_M",
"(",
"molecule",
")",
":",
"# load periodic table",
"els",
"=",
"elements",
"(",
")",
"# define regexs",
"parens",
"=",
"re",
".",
"compile",
"(",
"'\\(([A-z0-9]+)\\)([0-9]+)?'",
")",
"stoich",
"=",
"re",
".",
"compile",
"(",
"'([A-Z][a-z]?)([0-... | cd25a650cfee318152f234d992708511f7047fbe |
test | gen_keywords | generate single escape sequence mapping. | amino/string/hues.py | def gen_keywords(*args: Union[ANSIColors, ANSIStyles], **kwargs: Union[ANSIColors, ANSIStyles]) -> tuple:
'''generate single escape sequence mapping.'''
fields: tuple = tuple()
values: tuple = tuple()
for tpl in args:
fields += tpl._fields
values += tpl
for prefix, tpl in kwargs.item... | def gen_keywords(*args: Union[ANSIColors, ANSIStyles], **kwargs: Union[ANSIColors, ANSIStyles]) -> tuple:
'''generate single escape sequence mapping.'''
fields: tuple = tuple()
values: tuple = tuple()
for tpl in args:
fields += tpl._fields
values += tpl
for prefix, tpl in kwargs.item... | [
"generate",
"single",
"escape",
"sequence",
"mapping",
"."
] | tek/amino | python | https://github.com/tek/amino/blob/51b314933e047a45587a24ecff02c836706d27ff/amino/string/hues.py#L50-L60 | [
"def",
"gen_keywords",
"(",
"*",
"args",
":",
"Union",
"[",
"ANSIColors",
",",
"ANSIStyles",
"]",
",",
"*",
"*",
"kwargs",
":",
"Union",
"[",
"ANSIColors",
",",
"ANSIStyles",
"]",
")",
"->",
"tuple",
":",
"fields",
":",
"tuple",
"=",
"tuple",
"(",
")... | 51b314933e047a45587a24ecff02c836706d27ff |
test | zero_break | Handle Resets in input stack.
Breaks the input stack if a Reset operator (zero) is encountered. | amino/string/hues.py | def zero_break(stack: tuple) -> tuple:
'''Handle Resets in input stack.
Breaks the input stack if a Reset operator (zero) is encountered.
'''
reducer = lambda x, y: tuple() if y == 0 else x + (y,)
return reduce(reducer, stack, tuple()) | def zero_break(stack: tuple) -> tuple:
'''Handle Resets in input stack.
Breaks the input stack if a Reset operator (zero) is encountered.
'''
reducer = lambda x, y: tuple() if y == 0 else x + (y,)
return reduce(reducer, stack, tuple()) | [
"Handle",
"Resets",
"in",
"input",
"stack",
".",
"Breaks",
"the",
"input",
"stack",
"if",
"a",
"Reset",
"operator",
"(",
"zero",
")",
"is",
"encountered",
"."
] | tek/amino | python | https://github.com/tek/amino/blob/51b314933e047a45587a24ecff02c836706d27ff/amino/string/hues.py#L65-L70 | [
"def",
"zero_break",
"(",
"stack",
":",
"tuple",
")",
"->",
"tuple",
":",
"reducer",
"=",
"lambda",
"x",
",",
"y",
":",
"tuple",
"(",
")",
"if",
"y",
"==",
"0",
"else",
"x",
"+",
"(",
"y",
",",
")",
"return",
"reduce",
"(",
"reducer",
",",
"sta... | 51b314933e047a45587a24ecff02c836706d27ff |
test | annihilate | Squash and reduce the input stack.
Removes the elements of input that match predicate and only keeps the last
match at the end of the stack. | amino/string/hues.py | def annihilate(predicate: tuple, stack: tuple) -> tuple:
'''Squash and reduce the input stack.
Removes the elements of input that match predicate and only keeps the last
match at the end of the stack.
'''
extra = tuple(filter(lambda x: x not in predicate, stack))
head = reduce(lambda x, y: y if ... | def annihilate(predicate: tuple, stack: tuple) -> tuple:
'''Squash and reduce the input stack.
Removes the elements of input that match predicate and only keeps the last
match at the end of the stack.
'''
extra = tuple(filter(lambda x: x not in predicate, stack))
head = reduce(lambda x, y: y if ... | [
"Squash",
"and",
"reduce",
"the",
"input",
"stack",
".",
"Removes",
"the",
"elements",
"of",
"input",
"that",
"match",
"predicate",
"and",
"only",
"keeps",
"the",
"last",
"match",
"at",
"the",
"end",
"of",
"the",
"stack",
"."
] | tek/amino | python | https://github.com/tek/amino/blob/51b314933e047a45587a24ecff02c836706d27ff/amino/string/hues.py#L73-L80 | [
"def",
"annihilate",
"(",
"predicate",
":",
"tuple",
",",
"stack",
":",
"tuple",
")",
"->",
"tuple",
":",
"extra",
"=",
"tuple",
"(",
"filter",
"(",
"lambda",
"x",
":",
"x",
"not",
"in",
"predicate",
",",
"stack",
")",
")",
"head",
"=",
"reduce",
"... | 51b314933e047a45587a24ecff02c836706d27ff |
test | dedup | Remove duplicates from the stack in first-seen order. | amino/string/hues.py | def dedup(stack: tuple) -> tuple:
'''Remove duplicates from the stack in first-seen order.'''
# Initializes with an accumulator and then reduces the stack with first match
# deduplication.
reducer = lambda x, y: x if y in x else x + (y,)
return reduce(reducer, stack, tuple()) | def dedup(stack: tuple) -> tuple:
'''Remove duplicates from the stack in first-seen order.'''
# Initializes with an accumulator and then reduces the stack with first match
# deduplication.
reducer = lambda x, y: x if y in x else x + (y,)
return reduce(reducer, stack, tuple()) | [
"Remove",
"duplicates",
"from",
"the",
"stack",
"in",
"first",
"-",
"seen",
"order",
"."
] | tek/amino | python | https://github.com/tek/amino/blob/51b314933e047a45587a24ecff02c836706d27ff/amino/string/hues.py#L88-L93 | [
"def",
"dedup",
"(",
"stack",
":",
"tuple",
")",
"->",
"tuple",
":",
"# Initializes with an accumulator and then reduces the stack with first match",
"# deduplication.",
"reducer",
"=",
"lambda",
"x",
",",
"y",
":",
"x",
"if",
"y",
"in",
"x",
"else",
"x",
"+",
"... | 51b314933e047a45587a24ecff02c836706d27ff |
test | gauss_weighted_stats | Calculate gaussian weigted moving mean, SD and SE.
Parameters
----------
x : array-like
The independent variable
yarray : (n,m) array
Where n = x.size, and m is the number of
dependent variables to smooth.
x_new : array-like
The new x-scale to interpolate the data
... | latools/helpers/stat_fns.py | def gauss_weighted_stats(x, yarray, x_new, fwhm):
"""
Calculate gaussian weigted moving mean, SD and SE.
Parameters
----------
x : array-like
The independent variable
yarray : (n,m) array
Where n = x.size, and m is the number of
dependent variables to smooth.
x_new :... | def gauss_weighted_stats(x, yarray, x_new, fwhm):
"""
Calculate gaussian weigted moving mean, SD and SE.
Parameters
----------
x : array-like
The independent variable
yarray : (n,m) array
Where n = x.size, and m is the number of
dependent variables to smooth.
x_new :... | [
"Calculate",
"gaussian",
"weigted",
"moving",
"mean",
"SD",
"and",
"SE",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/stat_fns.py#L51-L96 | [
"def",
"gauss_weighted_stats",
"(",
"x",
",",
"yarray",
",",
"x_new",
",",
"fwhm",
")",
":",
"sigma",
"=",
"fwhm",
"/",
"(",
"2",
"*",
"np",
".",
"sqrt",
"(",
"2",
"*",
"np",
".",
"log",
"(",
"2",
")",
")",
")",
"# create empty mask array",
"mask",... | cd25a650cfee318152f234d992708511f7047fbe |
test | gauss | Gaussian function.
Parameters
----------
x : array_like
Independent variable.
*p : parameters unpacked to A, mu, sigma
A = amplitude, mu = centre, sigma = width
Return
------
array_like
gaussian descriped by *p. | latools/helpers/stat_fns.py | def gauss(x, *p):
""" Gaussian function.
Parameters
----------
x : array_like
Independent variable.
*p : parameters unpacked to A, mu, sigma
A = amplitude, mu = centre, sigma = width
Return
------
array_like
gaussian descriped by *p.
"""
A, mu, sigma = p... | def gauss(x, *p):
""" Gaussian function.
Parameters
----------
x : array_like
Independent variable.
*p : parameters unpacked to A, mu, sigma
A = amplitude, mu = centre, sigma = width
Return
------
array_like
gaussian descriped by *p.
"""
A, mu, sigma = p... | [
"Gaussian",
"function",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/stat_fns.py#L99-L115 | [
"def",
"gauss",
"(",
"x",
",",
"*",
"p",
")",
":",
"A",
",",
"mu",
",",
"sigma",
"=",
"p",
"return",
"A",
"*",
"np",
".",
"exp",
"(",
"-",
"0.5",
"*",
"(",
"-",
"mu",
"+",
"x",
")",
"**",
"2",
"/",
"sigma",
"**",
"2",
")"
] | cd25a650cfee318152f234d992708511f7047fbe |
test | stderr | Calculate the standard error of a. | latools/helpers/stat_fns.py | def stderr(a):
"""
Calculate the standard error of a.
"""
return np.nanstd(a) / np.sqrt(sum(np.isfinite(a))) | def stderr(a):
"""
Calculate the standard error of a.
"""
return np.nanstd(a) / np.sqrt(sum(np.isfinite(a))) | [
"Calculate",
"the",
"standard",
"error",
"of",
"a",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/stat_fns.py#L119-L123 | [
"def",
"stderr",
"(",
"a",
")",
":",
"return",
"np",
".",
"nanstd",
"(",
"a",
")",
"/",
"np",
".",
"sqrt",
"(",
"sum",
"(",
"np",
".",
"isfinite",
"(",
"a",
")",
")",
")"
] | cd25a650cfee318152f234d992708511f7047fbe |
test | H15_mean | Calculate the Huber (H15) Robust mean of x.
For details, see:
http://www.cscjp.co.jp/fera/document/ANALYSTVol114Decpgs1693-97_1989.pdf
http://www.rsc.org/images/robust-statistics-technical-brief-6_tcm18-214850.pdf | latools/helpers/stat_fns.py | def H15_mean(x):
"""
Calculate the Huber (H15) Robust mean of x.
For details, see:
http://www.cscjp.co.jp/fera/document/ANALYSTVol114Decpgs1693-97_1989.pdf
http://www.rsc.org/images/robust-statistics-technical-brief-6_tcm18-214850.pdf
"""
mu = np.nanmean(x)
sd = np.nanstd(x) * 1... | def H15_mean(x):
"""
Calculate the Huber (H15) Robust mean of x.
For details, see:
http://www.cscjp.co.jp/fera/document/ANALYSTVol114Decpgs1693-97_1989.pdf
http://www.rsc.org/images/robust-statistics-technical-brief-6_tcm18-214850.pdf
"""
mu = np.nanmean(x)
sd = np.nanstd(x) * 1... | [
"Calculate",
"the",
"Huber",
"(",
"H15",
")",
"Robust",
"mean",
"of",
"x",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/stat_fns.py#L132-L152 | [
"def",
"H15_mean",
"(",
"x",
")",
":",
"mu",
"=",
"np",
".",
"nanmean",
"(",
"x",
")",
"sd",
"=",
"np",
".",
"nanstd",
"(",
"x",
")",
"*",
"1.134",
"sig",
"=",
"1.5",
"hi",
"=",
"x",
">",
"mu",
"+",
"sig",
"*",
"sd",
"lo",
"=",
"x",
"<",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | H15_se | Calculate the Huber (H15) Robust standard deviation of x.
For details, see:
http://www.cscjp.co.jp/fera/document/ANALYSTVol114Decpgs1693-97_1989.pdf
http://www.rsc.org/images/robust-statistics-technical-brief-6_tcm18-214850.pdf | latools/helpers/stat_fns.py | def H15_se(x):
"""
Calculate the Huber (H15) Robust standard deviation of x.
For details, see:
http://www.cscjp.co.jp/fera/document/ANALYSTVol114Decpgs1693-97_1989.pdf
http://www.rsc.org/images/robust-statistics-technical-brief-6_tcm18-214850.pdf
"""
sd = H15_std(x)
return sd / ... | def H15_se(x):
"""
Calculate the Huber (H15) Robust standard deviation of x.
For details, see:
http://www.cscjp.co.jp/fera/document/ANALYSTVol114Decpgs1693-97_1989.pdf
http://www.rsc.org/images/robust-statistics-technical-brief-6_tcm18-214850.pdf
"""
sd = H15_std(x)
return sd / ... | [
"Calculate",
"the",
"Huber",
"(",
"H15",
")",
"Robust",
"standard",
"deviation",
"of",
"x",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/helpers/stat_fns.py#L178-L187 | [
"def",
"H15_se",
"(",
"x",
")",
":",
"sd",
"=",
"H15_std",
"(",
"x",
")",
"return",
"sd",
"/",
"np",
".",
"sqrt",
"(",
"sum",
"(",
"np",
".",
"isfinite",
"(",
"x",
")",
")",
")"
] | cd25a650cfee318152f234d992708511f7047fbe |
test | reproduce | Reproduce a previous analysis exported with :func:`latools.analyse.minimal_export`
For normal use, supplying `log_file` and specifying a plotting option should be
enough to reproduce an analysis. All requisites (raw data, SRM table and any
custom stat functions) will then be imported from the minimal_expor... | latools/latools.py | def reproduce(past_analysis, plotting=False, data_folder=None,
srm_table=None, custom_stat_functions=None):
"""
Reproduce a previous analysis exported with :func:`latools.analyse.minimal_export`
For normal use, supplying `log_file` and specifying a plotting option should be
enough to repr... | def reproduce(past_analysis, plotting=False, data_folder=None,
srm_table=None, custom_stat_functions=None):
"""
Reproduce a previous analysis exported with :func:`latools.analyse.minimal_export`
For normal use, supplying `log_file` and specifying a plotting option should be
enough to repr... | [
"Reproduce",
"a",
"previous",
"analysis",
"exported",
"with",
":",
"func",
":",
"latools",
".",
"analyse",
".",
"minimal_export"
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L4018-L4091 | [
"def",
"reproduce",
"(",
"past_analysis",
",",
"plotting",
"=",
"False",
",",
"data_folder",
"=",
"None",
",",
"srm_table",
"=",
"None",
",",
"custom_stat_functions",
"=",
"None",
")",
":",
"if",
"'.zip'",
"in",
"past_analysis",
":",
"dirpath",
"=",
"utils",... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse._get_samples | Helper function to get sample names from subset.
Parameters
----------
subset : str
Subset name. If None, returns all samples.
Returns
-------
List of sample names | latools/latools.py | def _get_samples(self, subset=None):
"""
Helper function to get sample names from subset.
Parameters
----------
subset : str
Subset name. If None, returns all samples.
Returns
-------
List of sample names
"""
if subset is None... | def _get_samples(self, subset=None):
"""
Helper function to get sample names from subset.
Parameters
----------
subset : str
Subset name. If None, returns all samples.
Returns
-------
List of sample names
"""
if subset is None... | [
"Helper",
"function",
"to",
"get",
"sample",
"names",
"from",
"subset",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L337-L359 | [
"def",
"_get_samples",
"(",
"self",
",",
"subset",
"=",
"None",
")",
":",
"if",
"subset",
"is",
"None",
":",
"samples",
"=",
"self",
".",
"subsets",
"[",
"'All_Samples'",
"]",
"else",
":",
"try",
":",
"samples",
"=",
"self",
".",
"subsets",
"[",
"sub... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.autorange | Automatically separates signal and background data regions.
Automatically detect signal and background regions in the laser
data, based on the behaviour of a single analyte. The analyte used
should be abundant and homogenous in the sample.
**Step 1: Thresholding.**
The backgrou... | latools/latools.py | def autorange(self, analyte='total_counts', gwin=5, swin=3, win=20,
on_mult=[1., 1.5], off_mult=[1.5, 1],
transform='log', ploterrs=True, focus_stage='despiked'):
"""
Automatically separates signal and background data regions.
Automatically detect signal and ... | def autorange(self, analyte='total_counts', gwin=5, swin=3, win=20,
on_mult=[1., 1.5], off_mult=[1.5, 1],
transform='log', ploterrs=True, focus_stage='despiked'):
"""
Automatically separates signal and background data regions.
Automatically detect signal and ... | [
"Automatically",
"separates",
"signal",
"and",
"background",
"data",
"regions",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L406-L525 | [
"def",
"autorange",
"(",
"self",
",",
"analyte",
"=",
"'total_counts'",
",",
"gwin",
"=",
"5",
",",
"swin",
"=",
"3",
",",
"win",
"=",
"20",
",",
"on_mult",
"=",
"[",
"1.",
",",
"1.5",
"]",
",",
"off_mult",
"=",
"[",
"1.5",
",",
"1",
"]",
",",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.find_expcoef | Determines exponential decay coefficient for despike filter.
Fits an exponential decay function to the washout phase of standards
to determine the washout time of your laser cell. The exponential
coefficient reported is `nsd_below` standard deviations below the
fitted exponent, to ensur... | latools/latools.py | def find_expcoef(self, nsd_below=0., plot=False,
trimlim=None, autorange_kwargs={}):
"""
Determines exponential decay coefficient for despike filter.
Fits an exponential decay function to the washout phase of standards
to determine the washout time of your laser cel... | def find_expcoef(self, nsd_below=0., plot=False,
trimlim=None, autorange_kwargs={}):
"""
Determines exponential decay coefficient for despike filter.
Fits an exponential decay function to the washout phase of standards
to determine the washout time of your laser cel... | [
"Determines",
"exponential",
"decay",
"coefficient",
"for",
"despike",
"filter",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L527-L633 | [
"def",
"find_expcoef",
"(",
"self",
",",
"nsd_below",
"=",
"0.",
",",
"plot",
"=",
"False",
",",
"trimlim",
"=",
"None",
",",
"autorange_kwargs",
"=",
"{",
"}",
")",
":",
"print",
"(",
"'Calculating exponential decay coefficient\\nfrom SRM washouts...'",
")",
"d... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.despike | Despikes data with exponential decay and noise filters.
Parameters
----------
expdecay_despiker : bool
Whether or not to apply the exponential decay filter.
exponent : None or float
The exponent for the exponential decay filter. If None,
it is determi... | latools/latools.py | def despike(self, expdecay_despiker=False, exponent=None,
noise_despiker=True, win=3, nlim=12., exponentplot=False,
maxiter=4, autorange_kwargs={}, focus_stage='rawdata'):
"""
Despikes data with exponential decay and noise filters.
Parameters
----------
... | def despike(self, expdecay_despiker=False, exponent=None,
noise_despiker=True, win=3, nlim=12., exponentplot=False,
maxiter=4, autorange_kwargs={}, focus_stage='rawdata'):
"""
Despikes data with exponential decay and noise filters.
Parameters
----------
... | [
"Despikes",
"data",
"with",
"exponential",
"decay",
"and",
"noise",
"filters",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L636-L700 | [
"def",
"despike",
"(",
"self",
",",
"expdecay_despiker",
"=",
"False",
",",
"exponent",
"=",
"None",
",",
"noise_despiker",
"=",
"True",
",",
"win",
"=",
"3",
",",
"nlim",
"=",
"12.",
",",
"exponentplot",
"=",
"False",
",",
"maxiter",
"=",
"4",
",",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.get_background | Extract all background data from all samples on universal time scale.
Used by both 'polynomial' and 'weightedmean' methods.
Parameters
----------
n_min : int
The minimum number of points a background region must
have to be included in calculation.
n_max :... | latools/latools.py | def get_background(self, n_min=10, n_max=None, focus_stage='despiked', bkg_filter=False, f_win=5, f_n_lim=3):
"""
Extract all background data from all samples on universal time scale.
Used by both 'polynomial' and 'weightedmean' methods.
Parameters
----------
n_min : int... | def get_background(self, n_min=10, n_max=None, focus_stage='despiked', bkg_filter=False, f_win=5, f_n_lim=3):
"""
Extract all background data from all samples on universal time scale.
Used by both 'polynomial' and 'weightedmean' methods.
Parameters
----------
n_min : int... | [
"Extract",
"all",
"background",
"data",
"from",
"all",
"samples",
"on",
"universal",
"time",
"scale",
".",
"Used",
"by",
"both",
"polynomial",
"and",
"weightedmean",
"methods",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L703-L795 | [
"def",
"get_background",
"(",
"self",
",",
"n_min",
"=",
"10",
",",
"n_max",
"=",
"None",
",",
"focus_stage",
"=",
"'despiked'",
",",
"bkg_filter",
"=",
"False",
",",
"f_win",
"=",
"5",
",",
"f_n_lim",
"=",
"3",
")",
":",
"allbkgs",
"=",
"{",
"'uTime... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.bkg_calc_weightedmean | Background calculation using a gaussian weighted mean.
Parameters
----------
analytes : str or iterable
Which analyte or analytes to calculate.
weight_fwhm : float
The full-width-at-half-maximum of the gaussian used
to calculate the weighted average.
... | latools/latools.py | def bkg_calc_weightedmean(self, analytes=None, weight_fwhm=None,
n_min=20, n_max=None, cstep=None,
bkg_filter=False, f_win=7, f_n_lim=3, focus_stage='despiked'):
"""
Background calculation using a gaussian weighted mean.
Parameters
... | def bkg_calc_weightedmean(self, analytes=None, weight_fwhm=None,
n_min=20, n_max=None, cstep=None,
bkg_filter=False, f_win=7, f_n_lim=3, focus_stage='despiked'):
"""
Background calculation using a gaussian weighted mean.
Parameters
... | [
"Background",
"calculation",
"using",
"a",
"gaussian",
"weighted",
"mean",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L798-L875 | [
"def",
"bkg_calc_weightedmean",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"weight_fwhm",
"=",
"None",
",",
"n_min",
"=",
"20",
",",
"n_max",
"=",
"None",
",",
"cstep",
"=",
"None",
",",
"bkg_filter",
"=",
"False",
",",
"f_win",
"=",
"7",
",",
"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.bkg_calc_interp1d | Background calculation using a 1D interpolation.
scipy.interpolate.interp1D is used for interpolation.
Parameters
----------
analytes : str or iterable
Which analyte or analytes to calculate.
kind : str or int
Integer specifying the order of the spline i... | latools/latools.py | def bkg_calc_interp1d(self, analytes=None, kind=1, n_min=10, n_max=None, cstep=None,
bkg_filter=False, f_win=7, f_n_lim=3, focus_stage='despiked'):
"""
Background calculation using a 1D interpolation.
scipy.interpolate.interp1D is used for interpolation.
Param... | def bkg_calc_interp1d(self, analytes=None, kind=1, n_min=10, n_max=None, cstep=None,
bkg_filter=False, f_win=7, f_n_lim=3, focus_stage='despiked'):
"""
Background calculation using a 1D interpolation.
scipy.interpolate.interp1D is used for interpolation.
Param... | [
"Background",
"calculation",
"using",
"a",
"1D",
"interpolation",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L878-L961 | [
"def",
"bkg_calc_interp1d",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"kind",
"=",
"1",
",",
"n_min",
"=",
"10",
",",
"n_max",
"=",
"None",
",",
"cstep",
"=",
"None",
",",
"bkg_filter",
"=",
"False",
",",
"f_win",
"=",
"7",
",",
"f_n_lim",
"=... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.bkg_subtract | Subtract calculated background from data.
Must run bkg_calc first!
Parameters
----------
analytes : str or iterable
Which analyte(s) to subtract.
errtype : str
Which type of error to propagate. default is 'stderr'.
focus_stage : str
W... | latools/latools.py | def bkg_subtract(self, analytes=None, errtype='stderr', focus_stage='despiked'):
"""
Subtract calculated background from data.
Must run bkg_calc first!
Parameters
----------
analytes : str or iterable
Which analyte(s) to subtract.
errtype : str
... | def bkg_subtract(self, analytes=None, errtype='stderr', focus_stage='despiked'):
"""
Subtract calculated background from data.
Must run bkg_calc first!
Parameters
----------
analytes : str or iterable
Which analyte(s) to subtract.
errtype : str
... | [
"Subtract",
"calculated",
"background",
"from",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L964-L1018 | [
"def",
"bkg_subtract",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"errtype",
"=",
"'stderr'",
",",
"focus_stage",
"=",
"'despiked'",
")",
":",
"if",
"analytes",
"is",
"None",
":",
"analytes",
"=",
"self",
".",
"analytes",
"elif",
"isinstance",
"(",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.correct_spectral_interference | Correct spectral interference.
Subtract interference counts from target_analyte, based on the
intensity of a source_analayte and a known fractional contribution (f).
Correction takes the form:
target_analyte -= source_analyte * f
Only operates on background-corrected data ('bk... | latools/latools.py | def correct_spectral_interference(self, target_analyte, source_analyte, f):
"""
Correct spectral interference.
Subtract interference counts from target_analyte, based on the
intensity of a source_analayte and a known fractional contribution (f).
Correction takes the form:
... | def correct_spectral_interference(self, target_analyte, source_analyte, f):
"""
Correct spectral interference.
Subtract interference counts from target_analyte, based on the
intensity of a source_analayte and a known fractional contribution (f).
Correction takes the form:
... | [
"Correct",
"spectral",
"interference",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1021-L1069 | [
"def",
"correct_spectral_interference",
"(",
"self",
",",
"target_analyte",
",",
"source_analyte",
",",
"f",
")",
":",
"if",
"target_analyte",
"not",
"in",
"self",
".",
"analytes",
":",
"raise",
"ValueError",
"(",
"'target_analyte: {:} not in available analytes ({:})'",... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.bkg_plot | Plot the calculated background.
Parameters
----------
analytes : str or iterable
Which analyte(s) to plot.
figsize : tuple
The (width, height) of the figure, in inches.
If None, calculated based on number of samples.
yscale : str
'... | latools/latools.py | def bkg_plot(self, analytes=None, figsize=None, yscale='log',
ylim=None, err='stderr', save=True):
"""
Plot the calculated background.
Parameters
----------
analytes : str or iterable
Which analyte(s) to plot.
figsize : tuple
The ... | def bkg_plot(self, analytes=None, figsize=None, yscale='log',
ylim=None, err='stderr', save=True):
"""
Plot the calculated background.
Parameters
----------
analytes : str or iterable
Which analyte(s) to plot.
figsize : tuple
The ... | [
"Plot",
"the",
"calculated",
"background",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1072-L1181 | [
"def",
"bkg_plot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"figsize",
"=",
"None",
",",
"yscale",
"=",
"'log'",
",",
"ylim",
"=",
"None",
",",
"err",
"=",
"'stderr'",
",",
"save",
"=",
"True",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.ratio | Calculates the ratio of all analytes to a single analyte.
Parameters
----------
internal_standard : str
The name of the analyte to divide all other analytes
by.
Returns
-------
None | latools/latools.py | def ratio(self, internal_standard=None):
"""
Calculates the ratio of all analytes to a single analyte.
Parameters
----------
internal_standard : str
The name of the analyte to divide all other analytes
by.
Returns
-------
None
... | def ratio(self, internal_standard=None):
"""
Calculates the ratio of all analytes to a single analyte.
Parameters
----------
internal_standard : str
The name of the analyte to divide all other analytes
by.
Returns
-------
None
... | [
"Calculates",
"the",
"ratio",
"of",
"all",
"analytes",
"to",
"a",
"single",
"analyte",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1185-L1213 | [
"def",
"ratio",
"(",
"self",
",",
"internal_standard",
"=",
"None",
")",
":",
"if",
"'bkgsub'",
"not",
"in",
"self",
".",
"stages_complete",
":",
"raise",
"RuntimeError",
"(",
"'Cannot calculate ratios before background subtraction.'",
")",
"if",
"internal_standard",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.srm_id_auto | Function for automarically identifying SRMs
Parameters
----------
srms_used : iterable
Which SRMs have been used. Must match SRM names
in SRM database *exactly* (case sensitive!).
n_min : int
The minimum number of data points a SRM measurement
... | latools/latools.py | def srm_id_auto(self, srms_used=['NIST610', 'NIST612', 'NIST614'], n_min=10, reload_srm_database=False):
"""
Function for automarically identifying SRMs
Parameters
----------
srms_used : iterable
Which SRMs have been used. Must match SRM names
in SRM ... | def srm_id_auto(self, srms_used=['NIST610', 'NIST612', 'NIST614'], n_min=10, reload_srm_database=False):
"""
Function for automarically identifying SRMs
Parameters
----------
srms_used : iterable
Which SRMs have been used. Must match SRM names
in SRM ... | [
"Function",
"for",
"automarically",
"identifying",
"SRMs",
"Parameters",
"----------",
"srms_used",
":",
"iterable",
"Which",
"SRMs",
"have",
"been",
"used",
".",
"Must",
"match",
"SRM",
"names",
"in",
"SRM",
"database",
"*",
"exactly",
"*",
"(",
"case",
"sens... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1319-L1422 | [
"def",
"srm_id_auto",
"(",
"self",
",",
"srms_used",
"=",
"[",
"'NIST610'",
",",
"'NIST612'",
",",
"'NIST614'",
"]",
",",
"n_min",
"=",
"10",
",",
"reload_srm_database",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"srms_used",
",",
"str",
")",
":",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.calibrate | Calibrates the data to measured SRM values.
Assumes that y intercept is zero.
Parameters
----------
analytes : str or iterable
Which analytes you'd like to calibrate. Defaults to all.
drift_correct : bool
Whether to pool all SRM measurements into a sin... | latools/latools.py | def calibrate(self, analytes=None, drift_correct=True,
srms_used=['NIST610', 'NIST612', 'NIST614'],
zero_intercept=True, n_min=10, reload_srm_database=False):
"""
Calibrates the data to measured SRM values.
Assumes that y intercept is zero.
Parameter... | def calibrate(self, analytes=None, drift_correct=True,
srms_used=['NIST610', 'NIST612', 'NIST614'],
zero_intercept=True, n_min=10, reload_srm_database=False):
"""
Calibrates the data to measured SRM values.
Assumes that y intercept is zero.
Parameter... | [
"Calibrates",
"the",
"data",
"to",
"measured",
"SRM",
"values",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1431-L1576 | [
"def",
"calibrate",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"drift_correct",
"=",
"True",
",",
"srms_used",
"=",
"[",
"'NIST610'",
",",
"'NIST612'",
",",
"'NIST614'",
"]",
",",
"zero_intercept",
"=",
"True",
",",
"n_min",
"=",
"10",
",",
"reload_... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.make_subset | Creates a subset of samples, which can be treated independently.
Parameters
----------
samples : str or array - like
Name of sample, or list of sample names.
name : (optional) str or number
The name of the sample group. Defaults to n + 1, where n is
t... | latools/latools.py | def make_subset(self, samples=None, name=None):
"""
Creates a subset of samples, which can be treated independently.
Parameters
----------
samples : str or array - like
Name of sample, or list of sample names.
name : (optional) str or number
The n... | def make_subset(self, samples=None, name=None):
"""
Creates a subset of samples, which can be treated independently.
Parameters
----------
samples : str or array - like
Name of sample, or list of sample names.
name : (optional) str or number
The n... | [
"Creates",
"a",
"subset",
"of",
"samples",
"which",
"can",
"be",
"treated",
"independently",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1711-L1753 | [
"def",
"make_subset",
"(",
"self",
",",
"samples",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"# Check if a subset containing the same samples already exists.",
"for",
"k",
",",
"v",
"in",
"self",
".",
"subsets",
".",
"items",
"(",
")",
":",
"if",
"set... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.zeroscreen | Remove all points containing data below zero (which are impossible!) | latools/latools.py | def zeroscreen(self, focus_stage=None):
"""
Remove all points containing data below zero (which are impossible!)
"""
if focus_stage is None:
focus_stage = self.focus_stage
for s in self.data.values():
ind = np.ones(len(s.Time), dtype=bool)
for... | def zeroscreen(self, focus_stage=None):
"""
Remove all points containing data below zero (which are impossible!)
"""
if focus_stage is None:
focus_stage = self.focus_stage
for s in self.data.values():
ind = np.ones(len(s.Time), dtype=bool)
for... | [
"Remove",
"all",
"points",
"containing",
"data",
"below",
"zero",
"(",
"which",
"are",
"impossible!",
")"
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1756-L1773 | [
"def",
"zeroscreen",
"(",
"self",
",",
"focus_stage",
"=",
"None",
")",
":",
"if",
"focus_stage",
"is",
"None",
":",
"focus_stage",
"=",
"self",
".",
"focus_stage",
"for",
"s",
"in",
"self",
".",
"data",
".",
"values",
"(",
")",
":",
"ind",
"=",
"np"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_threshold | Applies a threshold filter to the data.
Generates two filters above and below the threshold value for a
given analyte.
Parameters
----------
analyte : str
The analyte that the filter applies to.
threshold : float
The threshold value.
filt... | latools/latools.py | def filter_threshold(self, analyte, threshold,
samples=None, subset=None):
"""
Applies a threshold filter to the data.
Generates two filters above and below the threshold value for a
given analyte.
Parameters
----------
analyte : str
... | def filter_threshold(self, analyte, threshold,
samples=None, subset=None):
"""
Applies a threshold filter to the data.
Generates two filters above and below the threshold value for a
given analyte.
Parameters
----------
analyte : str
... | [
"Applies",
"a",
"threshold",
"filter",
"to",
"the",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1776-L1814 | [
"def",
"filter_threshold",
"(",
"self",
",",
"analyte",
",",
"threshold",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
".",
"make_subset",
"(",
"samples",
")",
"sam... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_threshold_percentile | Applies a threshold filter to the data.
Generates two filters above and below the threshold value for a
given analyte.
Parameters
----------
analyte : str
The analyte that the filter applies to.
percentiles : float or iterable of len=2
The percen... | latools/latools.py | def filter_threshold_percentile(self, analyte, percentiles, level='population', filt=False,
samples=None, subset=None):
"""
Applies a threshold filter to the data.
Generates two filters above and below the threshold value for a
given analyte.
... | def filter_threshold_percentile(self, analyte, percentiles, level='population', filt=False,
samples=None, subset=None):
"""
Applies a threshold filter to the data.
Generates two filters above and below the threshold value for a
given analyte.
... | [
"Applies",
"a",
"threshold",
"filter",
"to",
"the",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1817-L1907 | [
"def",
"filter_threshold_percentile",
"(",
"self",
",",
"analyte",
",",
"percentiles",
",",
"level",
"=",
"'population'",
",",
"filt",
"=",
"False",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"params",
"=",
"locals",
"(",
")",
"de... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_gradient_threshold_percentile | Calculate a gradient threshold filter to the data.
Generates two filters above and below the threshold value for a
given analyte.
Parameters
----------
analyte : str
The analyte that the filter applies to.
win : int
The window over which to calcu... | latools/latools.py | def filter_gradient_threshold_percentile(self, analyte, percentiles, level='population', win=15, filt=False,
samples=None, subset=None):
"""
Calculate a gradient threshold filter to the data.
Generates two filters above and below the threshold value ... | def filter_gradient_threshold_percentile(self, analyte, percentiles, level='population', win=15, filt=False,
samples=None, subset=None):
"""
Calculate a gradient threshold filter to the data.
Generates two filters above and below the threshold value ... | [
"Calculate",
"a",
"gradient",
"threshold",
"filter",
"to",
"the",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L1954-L2043 | [
"def",
"filter_gradient_threshold_percentile",
"(",
"self",
",",
"analyte",
",",
"percentiles",
",",
"level",
"=",
"'population'",
",",
"win",
"=",
"15",
",",
"filt",
"=",
"False",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"params"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_clustering | Applies an n - dimensional clustering filter to the data.
Parameters
----------
analytes : str
The analyte(s) that the filter applies to.
filt : bool
Whether or not to apply existing filters to the data before
calculating this filter.
nor... | latools/latools.py | def filter_clustering(self, analytes, filt=False, normalise=True,
method='kmeans', include_time=False, samples=None,
sort=True, subset=None, level='sample', min_data=10, **kwargs):
"""
Applies an n - dimensional clustering filter to the data.
... | def filter_clustering(self, analytes, filt=False, normalise=True,
method='kmeans', include_time=False, samples=None,
sort=True, subset=None, level='sample', min_data=10, **kwargs):
"""
Applies an n - dimensional clustering filter to the data.
... | [
"Applies",
"an",
"n",
"-",
"dimensional",
"clustering",
"filter",
"to",
"the",
"data",
".",
"Parameters",
"----------",
"analytes",
":",
"str",
"The",
"analyte",
"(",
"s",
")",
"that",
"the",
"filter",
"applies",
"to",
".",
"filt",
":",
"bool",
"Whether",
... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2046-L2143 | [
"def",
"filter_clustering",
"(",
"self",
",",
"analytes",
",",
"filt",
"=",
"False",
",",
"normalise",
"=",
"True",
",",
"method",
"=",
"'kmeans'",
",",
"include_time",
"=",
"False",
",",
"samples",
"=",
"None",
",",
"sort",
"=",
"True",
",",
"subset",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.fit_classifier | Create a clustering classifier based on all samples, or a subset.
Parameters
----------
name : str
The name of the classifier.
analytes : str or iterable
Which analytes the clustering algorithm should consider.
method : str
Which clustering al... | latools/latools.py | def fit_classifier(self, name, analytes, method, samples=None,
subset=None, filt=True, sort_by=0, **kwargs):
"""
Create a clustering classifier based on all samples, or a subset.
Parameters
----------
name : str
The name of the classifier.
... | def fit_classifier(self, name, analytes, method, samples=None,
subset=None, filt=True, sort_by=0, **kwargs):
"""
Create a clustering classifier based on all samples, or a subset.
Parameters
----------
name : str
The name of the classifier.
... | [
"Create",
"a",
"clustering",
"classifier",
"based",
"on",
"all",
"samples",
"or",
"a",
"subset",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2146-L2211 | [
"def",
"fit_classifier",
"(",
"self",
",",
"name",
",",
"analytes",
",",
"method",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"filt",
"=",
"True",
",",
"sort_by",
"=",
"0",
",",
"*",
"*",
"kwargs",
")",
":",
"# isolate data",
"if",... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.apply_classifier | Apply a clustering classifier based on all samples, or a subset.
Parameters
----------
name : str
The name of the classifier to apply.
subset : str
The subset of samples to apply the classifier to.
Returns
-------
name : str | latools/latools.py | def apply_classifier(self, name, samples=None, subset=None):
"""
Apply a clustering classifier based on all samples, or a subset.
Parameters
----------
name : str
The name of the classifier to apply.
subset : str
The subset of samples to apply the... | def apply_classifier(self, name, samples=None, subset=None):
"""
Apply a clustering classifier based on all samples, or a subset.
Parameters
----------
name : str
The name of the classifier to apply.
subset : str
The subset of samples to apply the... | [
"Apply",
"a",
"clustering",
"classifier",
"based",
"on",
"all",
"samples",
"or",
"a",
"subset",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2214-L2252 | [
"def",
"apply_classifier",
"(",
"self",
",",
"name",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
".",
"make_subset",
"(",
"samples",
")",
"samples",
"=",
"self",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_correlation | Applies a correlation filter to the data.
Calculates a rolling correlation between every `window` points of
two analytes, and excludes data where their Pearson's R value is
above `r_threshold` and statistically significant.
Data will be excluded where their absolute R value is greater ... | latools/latools.py | def filter_correlation(self, x_analyte, y_analyte, window=None,
r_threshold=0.9, p_threshold=0.05, filt=True,
samples=None, subset=None):
"""
Applies a correlation filter to the data.
Calculates a rolling correlation between every `window` p... | def filter_correlation(self, x_analyte, y_analyte, window=None,
r_threshold=0.9, p_threshold=0.05, filt=True,
samples=None, subset=None):
"""
Applies a correlation filter to the data.
Calculates a rolling correlation between every `window` p... | [
"Applies",
"a",
"correlation",
"filter",
"to",
"the",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2255-L2305 | [
"def",
"filter_correlation",
"(",
"self",
",",
"x_analyte",
",",
"y_analyte",
",",
"window",
"=",
"None",
",",
"r_threshold",
"=",
"0.9",
",",
"p_threshold",
"=",
"0.05",
",",
"filt",
"=",
"True",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.correlation_plots | Plot the local correlation between two analytes.
Parameters
----------
x_analyte, y_analyte : str
The names of the x and y analytes to correlate.
window : int, None
The rolling window used when calculating the correlation.
filt : bool
Whether ... | latools/latools.py | def correlation_plots(self, x_analyte, y_analyte, window=15, filt=True, recalc=False, samples=None, subset=None, outdir=None):
"""
Plot the local correlation between two analytes.
Parameters
----------
x_analyte, y_analyte : str
The names of the x and y analytes to c... | def correlation_plots(self, x_analyte, y_analyte, window=15, filt=True, recalc=False, samples=None, subset=None, outdir=None):
"""
Plot the local correlation between two analytes.
Parameters
----------
x_analyte, y_analyte : str
The names of the x and y analytes to c... | [
"Plot",
"the",
"local",
"correlation",
"between",
"two",
"analytes",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2308-L2347 | [
"def",
"correlation_plots",
"(",
"self",
",",
"x_analyte",
",",
"y_analyte",
",",
"window",
"=",
"15",
",",
"filt",
"=",
"True",
",",
"recalc",
"=",
"False",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"outdir",
"=",
"None",
")",
":... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_on | Turns data filters on for particular analytes and samples.
Parameters
----------
filt : optional, str or array_like
Name, partial name or list of names of filters. Supports
partial matching. i.e. if 'cluster' is specified, all
filters with 'cluster' in the na... | latools/latools.py | def filter_on(self, filt=None, analyte=None, samples=None, subset=None, show_status=False):
"""
Turns data filters on for particular analytes and samples.
Parameters
----------
filt : optional, str or array_like
Name, partial name or list of names of filters. Support... | def filter_on(self, filt=None, analyte=None, samples=None, subset=None, show_status=False):
"""
Turns data filters on for particular analytes and samples.
Parameters
----------
filt : optional, str or array_like
Name, partial name or list of names of filters. Support... | [
"Turns",
"data",
"filters",
"on",
"for",
"particular",
"analytes",
"and",
"samples",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2352-L2386 | [
"def",
"filter_on",
"(",
"self",
",",
"filt",
"=",
"None",
",",
"analyte",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"show_status",
"=",
"False",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_off | Turns data filters off for particular analytes and samples.
Parameters
----------
filt : optional, str or array_like
Name, partial name or list of names of filters. Supports
partial matching. i.e. if 'cluster' is specified, all
filters with 'cluster' in the n... | latools/latools.py | def filter_off(self, filt=None, analyte=None, samples=None, subset=None, show_status=False):
"""
Turns data filters off for particular analytes and samples.
Parameters
----------
filt : optional, str or array_like
Name, partial name or list of names of filters. Suppo... | def filter_off(self, filt=None, analyte=None, samples=None, subset=None, show_status=False):
"""
Turns data filters off for particular analytes and samples.
Parameters
----------
filt : optional, str or array_like
Name, partial name or list of names of filters. Suppo... | [
"Turns",
"data",
"filters",
"off",
"for",
"particular",
"analytes",
"and",
"samples",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2389-L2423 | [
"def",
"filter_off",
"(",
"self",
",",
"filt",
"=",
"None",
",",
"analyte",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"show_status",
"=",
"False",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_status | Prints the current status of filters for specified samples.
Parameters
----------
sample : str
Which sample to print.
subset : str
Specify a subset
stds : bool
Whether or not to include standards. | latools/latools.py | def filter_status(self, sample=None, subset=None, stds=False):
"""
Prints the current status of filters for specified samples.
Parameters
----------
sample : str
Which sample to print.
subset : str
Specify a subset
stds : bool
... | def filter_status(self, sample=None, subset=None, stds=False):
"""
Prints the current status of filters for specified samples.
Parameters
----------
sample : str
Which sample to print.
subset : str
Specify a subset
stds : bool
... | [
"Prints",
"the",
"current",
"status",
"of",
"filters",
"for",
"specified",
"samples",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2425-L2474 | [
"def",
"filter_status",
"(",
"self",
",",
"sample",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"stds",
"=",
"False",
")",
":",
"s",
"=",
"''",
"if",
"sample",
"is",
"None",
"and",
"subset",
"is",
"None",
":",
"if",
"not",
"self",
".",
"_has_subs... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_clear | Clears (deletes) all data filters. | latools/latools.py | def filter_clear(self, samples=None, subset=None):
"""
Clears (deletes) all data filters.
"""
if samples is not None:
subset = self.make_subset(samples)
samples = self._get_samples(subset)
for s in samples:
self.data[s].filt.clear() | def filter_clear(self, samples=None, subset=None):
"""
Clears (deletes) all data filters.
"""
if samples is not None:
subset = self.make_subset(samples)
samples = self._get_samples(subset)
for s in samples:
self.data[s].filt.clear() | [
"Clears",
"(",
"deletes",
")",
"all",
"data",
"filters",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2477-L2487 | [
"def",
"filter_clear",
"(",
"self",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
".",
"make_subset",
"(",
"samples",
")",
"samples",
"=",
"self",
".",
"_get_samples... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_defragment | Remove 'fragments' from the calculated filter
Parameters
----------
threshold : int
Contiguous data regions that contain this number
or fewer points are considered 'fragments'
mode : str
Specifies wither to 'include' or 'exclude' the identified
... | latools/latools.py | def filter_defragment(self, threshold, mode='include', filt=True, samples=None, subset=None):
"""
Remove 'fragments' from the calculated filter
Parameters
----------
threshold : int
Contiguous data regions that contain this number
or fewer points are cons... | def filter_defragment(self, threshold, mode='include', filt=True, samples=None, subset=None):
"""
Remove 'fragments' from the calculated filter
Parameters
----------
threshold : int
Contiguous data regions that contain this number
or fewer points are cons... | [
"Remove",
"fragments",
"from",
"the",
"calculated",
"filter"
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2490-L2525 | [
"def",
"filter_defragment",
"(",
"self",
",",
"threshold",
",",
"mode",
"=",
"'include'",
",",
"filt",
"=",
"True",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_exclude_downhole | Exclude all points down-hole (after) the first excluded data.
Parameters
----------
threhold : int
The minimum number of contiguous excluded data points
that must exist before downhole exclusion occurs.
file : valid filter string or bool
Which filter ... | latools/latools.py | def filter_exclude_downhole(self, threshold, filt=True, samples=None, subset=None):
"""
Exclude all points down-hole (after) the first excluded data.
Parameters
----------
threhold : int
The minimum number of contiguous excluded data points
that must exis... | def filter_exclude_downhole(self, threshold, filt=True, samples=None, subset=None):
"""
Exclude all points down-hole (after) the first excluded data.
Parameters
----------
threhold : int
The minimum number of contiguous excluded data points
that must exis... | [
"Exclude",
"all",
"points",
"down",
"-",
"hole",
"(",
"after",
")",
"the",
"first",
"excluded",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2528-L2547 | [
"def",
"filter_exclude_downhole",
"(",
"self",
",",
"threshold",
",",
"filt",
"=",
"True",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
".",
"make_subset",
"(",
"sa... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_trim | Remove points from the start and end of filter regions.
Parameters
----------
start, end : int
The number of points to remove from the start and end of
the specified filter.
filt : valid filter string or bool
Which filter to trim. If True, app... | latools/latools.py | def filter_trim(self, start=1, end=1, filt=True, samples=None, subset=None):
"""
Remove points from the start and end of filter regions.
Parameters
----------
start, end : int
The number of points to remove from the start and end of
the specified ... | def filter_trim(self, start=1, end=1, filt=True, samples=None, subset=None):
"""
Remove points from the start and end of filter regions.
Parameters
----------
start, end : int
The number of points to remove from the start and end of
the specified ... | [
"Remove",
"points",
"from",
"the",
"start",
"and",
"end",
"of",
"filter",
"regions",
".",
"Parameters",
"----------",
"start",
"end",
":",
"int",
"The",
"number",
"of",
"points",
"to",
"remove",
"from",
"the",
"start",
"and",
"end",
"of",
"the",
"specified... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2550-L2569 | [
"def",
"filter_trim",
"(",
"self",
",",
"start",
"=",
"1",
",",
"end",
"=",
"1",
",",
"filt",
"=",
"True",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
".",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_nremoved | Report how many data are removed by the active filters. | latools/latools.py | def filter_nremoved(self, filt=True, quiet=False):
"""
Report how many data are removed by the active filters.
"""
rminfo = {}
for n in self.subsets['All_Samples']:
s = self.data[n]
rminfo[n] = s.filt_nremoved(filt)
if not quiet:
maxL =... | def filter_nremoved(self, filt=True, quiet=False):
"""
Report how many data are removed by the active filters.
"""
rminfo = {}
for n in self.subsets['All_Samples']:
s = self.data[n]
rminfo[n] = s.filt_nremoved(filt)
if not quiet:
maxL =... | [
"Report",
"how",
"many",
"data",
"are",
"removed",
"by",
"the",
"active",
"filters",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2571-L2591 | [
"def",
"filter_nremoved",
"(",
"self",
",",
"filt",
"=",
"True",
",",
"quiet",
"=",
"False",
")",
":",
"rminfo",
"=",
"{",
"}",
"for",
"n",
"in",
"self",
".",
"subsets",
"[",
"'All_Samples'",
"]",
":",
"s",
"=",
"self",
".",
"data",
"[",
"n",
"]"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.optimise_signal | Optimise data selection based on specified analytes.
Identifies the longest possible contiguous data region in
the signal where the relative standard deviation (std) and
concentration of all analytes is minimised.
Optimisation is performed via a grid search of all possible
con... | latools/latools.py | def optimise_signal(self, analytes, min_points=5,
threshold_mode='kde_first_max',
threshold_mult=1., x_bias=0, filt=True,
weights=None, mode='minimise',
samples=None, subset=None):
"""
Optimise data selectio... | def optimise_signal(self, analytes, min_points=5,
threshold_mode='kde_first_max',
threshold_mult=1., x_bias=0, filt=True,
weights=None, mode='minimise',
samples=None, subset=None):
"""
Optimise data selectio... | [
"Optimise",
"data",
"selection",
"based",
"on",
"specified",
"analytes",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2594-L2668 | [
"def",
"optimise_signal",
"(",
"self",
",",
"analytes",
",",
"min_points",
"=",
"5",
",",
"threshold_mode",
"=",
"'kde_first_max'",
",",
"threshold_mult",
"=",
"1.",
",",
"x_bias",
"=",
"0",
",",
"filt",
"=",
"True",
",",
"weights",
"=",
"None",
",",
"mo... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.optimisation_plots | Plot the result of signal_optimise.
`signal_optimiser` must be run first, and the output
stored in the `opt` attribute of the latools.D object.
Parameters
----------
d : latools.D object
A latools data object.
overlay_alpha : float
The opacity of... | latools/latools.py | def optimisation_plots(self, overlay_alpha=0.5, samples=None, subset=None, **kwargs):
"""
Plot the result of signal_optimise.
`signal_optimiser` must be run first, and the output
stored in the `opt` attribute of the latools.D object.
Parameters
----------
d : la... | def optimisation_plots(self, overlay_alpha=0.5, samples=None, subset=None, **kwargs):
"""
Plot the result of signal_optimise.
`signal_optimiser` must be run first, and the output
stored in the `opt` attribute of the latools.D object.
Parameters
----------
d : la... | [
"Plot",
"the",
"result",
"of",
"signal_optimise",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2671-L2706 | [
"def",
"optimisation_plots",
"(",
"self",
",",
"overlay_alpha",
"=",
"0.5",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
".",
"make_subset"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.set_focus | Set the 'focus' attribute of the data file.
The 'focus' attribute of the object points towards data from a
particular stage of analysis. It is used to identify the 'working
stage' of the data. Processing functions operate on the 'focus'
stage, so if steps are done out of sequence, thing... | latools/latools.py | def set_focus(self, focus_stage=None, samples=None, subset=None):
"""
Set the 'focus' attribute of the data file.
The 'focus' attribute of the object points towards data from a
particular stage of analysis. It is used to identify the 'working
stage' of the data. Processing funct... | def set_focus(self, focus_stage=None, samples=None, subset=None):
"""
Set the 'focus' attribute of the data file.
The 'focus' attribute of the object points towards data from a
particular stage of analysis. It is used to identify the 'working
stage' of the data. Processing funct... | [
"Set",
"the",
"focus",
"attribute",
"of",
"the",
"data",
"file",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2716-L2763 | [
"def",
"set_focus",
"(",
"self",
",",
"focus_stage",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
".",
"make_subset",
"(",
"samples",
")",
"if",
"sub... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.get_focus | Collect all data from all samples into a single array.
Data from standards is not collected.
Parameters
----------
filt : str, dict or bool
Either logical filter expression contained in a str,
a dict of expressions specifying the filter string to
use ... | latools/latools.py | def get_focus(self, filt=False, samples=None, subset=None, nominal=False):
"""
Collect all data from all samples into a single array.
Data from standards is not collected.
Parameters
----------
filt : str, dict or bool
Either logical filter expression contain... | def get_focus(self, filt=False, samples=None, subset=None, nominal=False):
"""
Collect all data from all samples into a single array.
Data from standards is not collected.
Parameters
----------
filt : str, dict or bool
Either logical filter expression contain... | [
"Collect",
"all",
"data",
"from",
"all",
"samples",
"into",
"a",
"single",
"array",
".",
"Data",
"from",
"standards",
"is",
"not",
"collected",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2766-L2810 | [
"def",
"get_focus",
"(",
"self",
",",
"filt",
"=",
"False",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"nominal",
"=",
"False",
")",
":",
"if",
"samples",
"is",
"not",
"None",
":",
"subset",
"=",
"self",
".",
"make_subset",
"(",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.get_gradients | Collect all data from all samples into a single array.
Data from standards is not collected.
Parameters
----------
filt : str, dict or bool
Either logical filter expression contained in a str,
a dict of expressions specifying the filter string to
use ... | latools/latools.py | def get_gradients(self, analytes=None, win=15, filt=False, samples=None, subset=None, recalc=True):
"""
Collect all data from all samples into a single array.
Data from standards is not collected.
Parameters
----------
filt : str, dict or bool
Either logical ... | def get_gradients(self, analytes=None, win=15, filt=False, samples=None, subset=None, recalc=True):
"""
Collect all data from all samples into a single array.
Data from standards is not collected.
Parameters
----------
filt : str, dict or bool
Either logical ... | [
"Collect",
"all",
"data",
"from",
"all",
"samples",
"into",
"a",
"single",
"array",
".",
"Data",
"from",
"standards",
"is",
"not",
"collected",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2813-L2870 | [
"def",
"get_gradients",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"win",
"=",
"15",
",",
"filt",
"=",
"False",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"recalc",
"=",
"True",
")",
":",
"if",
"analytes",
"is",
"None",
":",... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.gradient_histogram | Plot a histogram of the gradients in all samples.
Parameters
----------
filt : str, dict or bool
Either logical filter expression contained in a str,
a dict of expressions specifying the filter string to
use for each analyte or a boolean. Passed to `grab_filt... | latools/latools.py | def gradient_histogram(self, analytes=None, win=15, filt=False, bins=None, samples=None, subset=None, recalc=True, ncol=4):
"""
Plot a histogram of the gradients in all samples.
Parameters
----------
filt : str, dict or bool
Either logical filter expression contained... | def gradient_histogram(self, analytes=None, win=15, filt=False, bins=None, samples=None, subset=None, recalc=True, ncol=4):
"""
Plot a histogram of the gradients in all samples.
Parameters
----------
filt : str, dict or bool
Either logical filter expression contained... | [
"Plot",
"a",
"histogram",
"of",
"the",
"gradients",
"in",
"all",
"samples",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2872-L2944 | [
"def",
"gradient_histogram",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"win",
"=",
"15",
",",
"filt",
"=",
"False",
",",
"bins",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"recalc",
"=",
"True",
",",
"ncol",
"=... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.crossplot | Plot analytes against each other.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
lognorm : bool
Whether or not to log normalise the colour scale
of the 2D histogram.
bins : int
... | latools/latools.py | def crossplot(self, analytes=None, lognorm=True,
bins=25, filt=False, samples=None,
subset=None, figsize=(12, 12), save=False,
colourful=True, mode='hist2d', **kwargs):
"""
Plot analytes against each other.
Parameters
----------
... | def crossplot(self, analytes=None, lognorm=True,
bins=25, filt=False, samples=None,
subset=None, figsize=(12, 12), save=False,
colourful=True, mode='hist2d', **kwargs):
"""
Plot analytes against each other.
Parameters
----------
... | [
"Plot",
"analytes",
"against",
"each",
"other",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L2948-L3006 | [
"def",
"crossplot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"lognorm",
"=",
"True",
",",
"bins",
"=",
"25",
",",
"filt",
"=",
"False",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"figsize",
"=",
"(",
"12",
",",
"12",
")"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.gradient_crossplot | Plot analyte gradients against each other.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
lognorm : bool
Whether or not to log normalise the colour scale
of the 2D histogram.
bins... | latools/latools.py | def gradient_crossplot(self, analytes=None, win=15, lognorm=True,
bins=25, filt=False, samples=None,
subset=None, figsize=(12, 12), save=False,
colourful=True, mode='hist2d', recalc=True, **kwargs):
"""
Plot analyte gradien... | def gradient_crossplot(self, analytes=None, win=15, lognorm=True,
bins=25, filt=False, samples=None,
subset=None, figsize=(12, 12), save=False,
colourful=True, mode='hist2d', recalc=True, **kwargs):
"""
Plot analyte gradien... | [
"Plot",
"analyte",
"gradients",
"against",
"each",
"other",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3009-L3073 | [
"def",
"gradient_crossplot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"win",
"=",
"15",
",",
"lognorm",
"=",
"True",
",",
"bins",
"=",
"25",
",",
"filt",
"=",
"False",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"figsize",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.histograms | Plot histograms of analytes.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
bins : int
The number of bins in each histogram (default = 25)
logy : bool
If true, y axis is a log sca... | latools/latools.py | def histograms(self, analytes=None, bins=25, logy=False,
filt=False, colourful=True):
"""
Plot histograms of analytes.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
bins : int... | def histograms(self, analytes=None, bins=25, logy=False,
filt=False, colourful=True):
"""
Plot histograms of analytes.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
bins : int... | [
"Plot",
"histograms",
"of",
"analytes",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3075-L3112 | [
"def",
"histograms",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"bins",
"=",
"25",
",",
"logy",
"=",
"False",
",",
"filt",
"=",
"False",
",",
"colourful",
"=",
"True",
")",
":",
"if",
"analytes",
"is",
"None",
":",
"analytes",
"=",
"self",
"."... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_effect | Quantify the effects of the active filters.
Parameters
----------
analytes : str or list
Which analytes to consider.
stats : list
Which statistics to calculate.
file : valid filter string or bool
Which filter to consider. If True, appl... | latools/latools.py | def filter_effect(self, analytes=None, stats=['mean', 'std'], filt=True):
"""
Quantify the effects of the active filters.
Parameters
----------
analytes : str or list
Which analytes to consider.
stats : list
Which statistics to calculate.
... | def filter_effect(self, analytes=None, stats=['mean', 'std'], filt=True):
"""
Quantify the effects of the active filters.
Parameters
----------
analytes : str or list
Which analytes to consider.
stats : list
Which statistics to calculate.
... | [
"Quantify",
"the",
"effects",
"of",
"the",
"active",
"filters",
".",
"Parameters",
"----------",
"analytes",
":",
"str",
"or",
"list",
"Which",
"analytes",
"to",
"consider",
".",
"stats",
":",
"list",
"Which",
"statistics",
"to",
"calculate",
".",
"file",
":... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3114-L3175 | [
"def",
"filter_effect",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"stats",
"=",
"[",
"'mean'",
",",
"'std'",
"]",
",",
"filt",
"=",
"True",
")",
":",
"if",
"analytes",
"is",
"None",
":",
"analytes",
"=",
"self",
".",
"analytes",
"if",
"isinstan... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.trace_plots | Plot analytes as a function of time.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
samples: optional, array_like or str
The sample(s) to plot. Defaults to all samples.
ranges : bool
... | latools/latools.py | def trace_plots(self, analytes=None, samples=None, ranges=False,
focus=None, outdir=None, filt=None, scale='log',
figsize=[10, 4], stats=False, stat='nanmean',
err='nanstd', subset='All_Analyses'):
"""
Plot analytes as a function of time.
... | def trace_plots(self, analytes=None, samples=None, ranges=False,
focus=None, outdir=None, filt=None, scale='log',
figsize=[10, 4], stats=False, stat='nanmean',
err='nanstd', subset='All_Analyses'):
"""
Plot analytes as a function of time.
... | [
"Plot",
"analytes",
"as",
"a",
"function",
"of",
"time",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3290-L3367 | [
"def",
"trace_plots",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"ranges",
"=",
"False",
",",
"focus",
"=",
"None",
",",
"outdir",
"=",
"None",
",",
"filt",
"=",
"None",
",",
"scale",
"=",
"'log'",
",",
"figsize",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.gradient_plots | Plot analyte gradients as a function of time.
Parameters
----------
analytes : optional, array_like or str
The analyte(s) to plot. Defaults to all analytes.
samples: optional, array_like or str
The sample(s) to plot. Defaults to all samples.
ranges : bool... | latools/latools.py | def gradient_plots(self, analytes=None, win=15, samples=None, ranges=False,
focus=None, outdir=None,
figsize=[10, 4], subset='All_Analyses'):
"""
Plot analyte gradients as a function of time.
Parameters
----------
analytes : optional... | def gradient_plots(self, analytes=None, win=15, samples=None, ranges=False,
focus=None, outdir=None,
figsize=[10, 4], subset='All_Analyses'):
"""
Plot analyte gradients as a function of time.
Parameters
----------
analytes : optional... | [
"Plot",
"analyte",
"gradients",
"as",
"a",
"function",
"of",
"time",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3371-L3445 | [
"def",
"gradient_plots",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"win",
"=",
"15",
",",
"samples",
"=",
"None",
",",
"ranges",
"=",
"False",
",",
"focus",
"=",
"None",
",",
"outdir",
"=",
"None",
",",
"figsize",
"=",
"[",
"10",
",",
"4",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.filter_reports | Plot filter reports for all filters that contain ``filt_str``
in the name. | latools/latools.py | def filter_reports(self, analytes, filt_str='all', nbin=5, samples=None,
outdir=None, subset='All_Samples'):
"""
Plot filter reports for all filters that contain ``filt_str``
in the name.
"""
if outdir is None:
outdir = self.report_dir + '/filte... | def filter_reports(self, analytes, filt_str='all', nbin=5, samples=None,
outdir=None, subset='All_Samples'):
"""
Plot filter reports for all filters that contain ``filt_str``
in the name.
"""
if outdir is None:
outdir = self.report_dir + '/filte... | [
"Plot",
"filter",
"reports",
"for",
"all",
"filters",
"that",
"contain",
"filt_str",
"in",
"the",
"name",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3449-L3475 | [
"def",
"filter_reports",
"(",
"self",
",",
"analytes",
",",
"filt_str",
"=",
"'all'",
",",
"nbin",
"=",
"5",
",",
"samples",
"=",
"None",
",",
"outdir",
"=",
"None",
",",
"subset",
"=",
"'All_Samples'",
")",
":",
"if",
"outdir",
"is",
"None",
":",
"o... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.sample_stats | Calculate sample statistics.
Returns samples, analytes, and arrays of statistics
of shape (samples, analytes). Statistics are calculated
from the 'focus' data variable, so output depends on how
the data have been processed.
Included stat functions:
* :func:`~latools.st... | latools/latools.py | def sample_stats(self, analytes=None, filt=True,
stats=['mean', 'std'],
eachtrace=True, csf_dict={}):
"""
Calculate sample statistics.
Returns samples, analytes, and arrays of statistics
of shape (samples, analytes). Statistics are calculated
... | def sample_stats(self, analytes=None, filt=True,
stats=['mean', 'std'],
eachtrace=True, csf_dict={}):
"""
Calculate sample statistics.
Returns samples, analytes, and arrays of statistics
of shape (samples, analytes). Statistics are calculated
... | [
"Calculate",
"sample",
"statistics",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3506-L3594 | [
"def",
"sample_stats",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"filt",
"=",
"True",
",",
"stats",
"=",
"[",
"'mean'",
",",
"'std'",
"]",
",",
"eachtrace",
"=",
"True",
",",
"csf_dict",
"=",
"{",
"}",
")",
":",
"if",
"analytes",
"is",
"None"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.statplot | Function for visualising per-ablation and per-sample means.
Parameters
----------
analytes : str or iterable
Which analyte(s) to plot
samples : str or iterable
Which sample(s) to plot
figsize : tuple
Figure (width, height) in inches
st... | latools/latools.py | def statplot(self, analytes=None, samples=None, figsize=None,
stat='mean', err='std', subset=None):
"""
Function for visualising per-ablation and per-sample means.
Parameters
----------
analytes : str or iterable
Which analyte(s) to plot
samp... | def statplot(self, analytes=None, samples=None, figsize=None,
stat='mean', err='std', subset=None):
"""
Function for visualising per-ablation and per-sample means.
Parameters
----------
analytes : str or iterable
Which analyte(s) to plot
samp... | [
"Function",
"for",
"visualising",
"per",
"-",
"ablation",
"and",
"per",
"-",
"sample",
"means",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3621-L3714 | [
"def",
"statplot",
"(",
"self",
",",
"analytes",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"figsize",
"=",
"None",
",",
"stat",
"=",
"'mean'",
",",
"err",
"=",
"'std'",
",",
"subset",
"=",
"None",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.getstats | Return pandas dataframe of all sample statistics. | latools/latools.py | def getstats(self, save=True, filename=None, samples=None, subset=None, ablation_time=False):
"""
Return pandas dataframe of all sample statistics.
"""
slst = []
if samples is not None:
subset = self.make_subset(samples)
samples = self._get_samples(subset)
... | def getstats(self, save=True, filename=None, samples=None, subset=None, ablation_time=False):
"""
Return pandas dataframe of all sample statistics.
"""
slst = []
if samples is not None:
subset = self.make_subset(samples)
samples = self._get_samples(subset)
... | [
"Return",
"pandas",
"dataframe",
"of",
"all",
"sample",
"statistics",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3717-L3769 | [
"def",
"getstats",
"(",
"self",
",",
"save",
"=",
"True",
",",
"filename",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"ablation_time",
"=",
"False",
")",
":",
"slst",
"=",
"[",
"]",
"if",
"samples",
"is",
"not",
"Non... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse._minimal_export_traces | Used for exporting minimal dataset. DON'T USE. | latools/latools.py | def _minimal_export_traces(self, outdir=None, analytes=None,
samples=None, subset='All_Analyses'):
"""
Used for exporting minimal dataset. DON'T USE.
"""
if analytes is None:
analytes = self.analytes
elif isinstance(analytes, str):
... | def _minimal_export_traces(self, outdir=None, analytes=None,
samples=None, subset='All_Analyses'):
"""
Used for exporting minimal dataset. DON'T USE.
"""
if analytes is None:
analytes = self.analytes
elif isinstance(analytes, str):
... | [
"Used",
"for",
"exporting",
"minimal",
"dataset",
".",
"DON",
"T",
"USE",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3772-L3819 | [
"def",
"_minimal_export_traces",
"(",
"self",
",",
"outdir",
"=",
"None",
",",
"analytes",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"'All_Analyses'",
")",
":",
"if",
"analytes",
"is",
"None",
":",
"analytes",
"=",
"self",
".",
"analy... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.export_traces | Function to export raw data.
Parameters
----------
outdir : str
directory to save toe traces. Defaults to 'main-dir-name_export'.
focus_stage : str
The name of the analysis stage to export.
* 'rawdata': raw data, loaded from csv file.
* '... | latools/latools.py | def export_traces(self, outdir=None, focus_stage=None, analytes=None,
samples=None, subset='All_Analyses', filt=False, zip_archive=False):
"""
Function to export raw data.
Parameters
----------
outdir : str
directory to save toe traces. Defaults... | def export_traces(self, outdir=None, focus_stage=None, analytes=None,
samples=None, subset='All_Analyses', filt=False, zip_archive=False):
"""
Function to export raw data.
Parameters
----------
outdir : str
directory to save toe traces. Defaults... | [
"Function",
"to",
"export",
"raw",
"data",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3822-L3918 | [
"def",
"export_traces",
"(",
"self",
",",
"outdir",
"=",
"None",
",",
"focus_stage",
"=",
"None",
",",
"analytes",
"=",
"None",
",",
"samples",
"=",
"None",
",",
"subset",
"=",
"'All_Analyses'",
",",
"filt",
"=",
"False",
",",
"zip_archive",
"=",
"False"... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.save_log | Save analysis.lalog in specified location | latools/latools.py | def save_log(self, directory=None, logname=None, header=None):
"""
Save analysis.lalog in specified location
"""
if directory is None:
directory = self.export_dir
if not os.path.isdir(directory):
directory = os.path.dirname(directory)
if logname i... | def save_log(self, directory=None, logname=None, header=None):
"""
Save analysis.lalog in specified location
"""
if directory is None:
directory = self.export_dir
if not os.path.isdir(directory):
directory = os.path.dirname(directory)
if logname i... | [
"Save",
"analysis",
".",
"lalog",
"in",
"specified",
"location"
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3920-L3938 | [
"def",
"save_log",
"(",
"self",
",",
"directory",
"=",
"None",
",",
"logname",
"=",
"None",
",",
"header",
"=",
"None",
")",
":",
"if",
"directory",
"is",
"None",
":",
"directory",
"=",
"self",
".",
"export_dir",
"if",
"not",
"os",
".",
"path",
".",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | analyse.minimal_export | Exports a analysis parameters, standard info and a minimal dataset,
which can be imported by another user.
Parameters
----------
target_analytes : str or iterable
Which analytes to include in the export. If specified, the export
will contain these analytes, and a... | latools/latools.py | def minimal_export(self, target_analytes=None, path=None):
"""
Exports a analysis parameters, standard info and a minimal dataset,
which can be imported by another user.
Parameters
----------
target_analytes : str or iterable
Which analytes to include in the ... | def minimal_export(self, target_analytes=None, path=None):
"""
Exports a analysis parameters, standard info and a minimal dataset,
which can be imported by another user.
Parameters
----------
target_analytes : str or iterable
Which analytes to include in the ... | [
"Exports",
"a",
"analysis",
"parameters",
"standard",
"info",
"and",
"a",
"minimal",
"dataset",
"which",
"can",
"be",
"imported",
"by",
"another",
"user",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/latools.py#L3940-L4015 | [
"def",
"minimal_export",
"(",
"self",
",",
"target_analytes",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"if",
"target_analytes",
"is",
"None",
":",
"target_analytes",
"=",
"self",
".",
"analytes",
"if",
"isinstance",
"(",
"target_analytes",
",",
"str"... | cd25a650cfee318152f234d992708511f7047fbe |
test | by_regex | Split one long analysis file into multiple smaller ones.
Parameters
----------
file : str
The path to the file you want to split.
outdir : str
The directory to save the split files to.
If None, files are saved to a new directory
called 'split', which is created inside th... | latools/preprocessing/split.py | def by_regex(file, outdir=None, split_pattern=None, global_header_rows=0, fname_pattern=None, trim_tail_lines=0, trim_head_lines=0):
"""
Split one long analysis file into multiple smaller ones.
Parameters
----------
file : str
The path to the file you want to split.
outdir : str
... | def by_regex(file, outdir=None, split_pattern=None, global_header_rows=0, fname_pattern=None, trim_tail_lines=0, trim_head_lines=0):
"""
Split one long analysis file into multiple smaller ones.
Parameters
----------
file : str
The path to the file you want to split.
outdir : str
... | [
"Split",
"one",
"long",
"analysis",
"file",
"into",
"multiple",
"smaller",
"ones",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/preprocessing/split.py#L11-L90 | [
"def",
"by_regex",
"(",
"file",
",",
"outdir",
"=",
"None",
",",
"split_pattern",
"=",
"None",
",",
"global_header_rows",
"=",
"0",
",",
"fname_pattern",
"=",
"None",
",",
"trim_tail_lines",
"=",
"0",
",",
"trim_head_lines",
"=",
"0",
")",
":",
"# create o... | cd25a650cfee318152f234d992708511f7047fbe |
test | long_file | TODO: Check for existing files in savedir, don't overwrite? | latools/preprocessing/split.py | def long_file(data_file, dataformat, sample_list, savedir=None, srm_id=None, **autorange_args):
"""
TODO: Check for existing files in savedir, don't overwrite?
"""
if isinstance(sample_list, str):
if os.path.exists(sample_list):
sample_list = np.genfromtxt(sample_list, dtype=str)
... | def long_file(data_file, dataformat, sample_list, savedir=None, srm_id=None, **autorange_args):
"""
TODO: Check for existing files in savedir, don't overwrite?
"""
if isinstance(sample_list, str):
if os.path.exists(sample_list):
sample_list = np.genfromtxt(sample_list, dtype=str)
... | [
"TODO",
":",
"Check",
"for",
"existing",
"files",
"in",
"savedir",
"don",
"t",
"overwrite?"
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/preprocessing/split.py#L92-L200 | [
"def",
"long_file",
"(",
"data_file",
",",
"dataformat",
",",
"sample_list",
",",
"savedir",
"=",
"None",
",",
"srm_id",
"=",
"None",
",",
"*",
"*",
"autorange_args",
")",
":",
"if",
"isinstance",
"(",
"sample_list",
",",
"str",
")",
":",
"if",
"os",
"... | cd25a650cfee318152f234d992708511f7047fbe |
test | Foldable.fold_map | map `f` over the traversable, then fold over the result
using the supplied initial element `z` and operation `g`,
defaulting to addition for the latter. | amino/tc/foldable.py | def fold_map(self, fa: F[A], z: B, f: Callable[[A], B], g: Callable[[Z, B], Z]=operator.add) -> Z:
''' map `f` over the traversable, then fold over the result
using the supplied initial element `z` and operation `g`,
defaulting to addition for the latter.
'''
mapped = Functor.fat... | def fold_map(self, fa: F[A], z: B, f: Callable[[A], B], g: Callable[[Z, B], Z]=operator.add) -> Z:
''' map `f` over the traversable, then fold over the result
using the supplied initial element `z` and operation `g`,
defaulting to addition for the latter.
'''
mapped = Functor.fat... | [
"map",
"f",
"over",
"the",
"traversable",
"then",
"fold",
"over",
"the",
"result",
"using",
"the",
"supplied",
"initial",
"element",
"z",
"and",
"operation",
"g",
"defaulting",
"to",
"addition",
"for",
"the",
"latter",
"."
] | tek/amino | python | https://github.com/tek/amino/blob/51b314933e047a45587a24ecff02c836706d27ff/amino/tc/foldable.py#L64-L70 | [
"def",
"fold_map",
"(",
"self",
",",
"fa",
":",
"F",
"[",
"A",
"]",
",",
"z",
":",
"B",
",",
"f",
":",
"Callable",
"[",
"[",
"A",
"]",
",",
"B",
"]",
",",
"g",
":",
"Callable",
"[",
"[",
"Z",
",",
"B",
"]",
",",
"Z",
"]",
"=",
"operator... | 51b314933e047a45587a24ecff02c836706d27ff |
test | pca_calc | Calculates pca of d.
Parameters
----------
nc : int
Number of components
d : np.ndarray
An NxM array, containing M observations of N variables.
Data must be floats. Can contain NaN values.
Returns
-------
pca, dt : tuple
fitted PCA object, and transf... | latools/filtering/pca.py | def pca_calc(nc, d):
"""
Calculates pca of d.
Parameters
----------
nc : int
Number of components
d : np.ndarray
An NxM array, containing M observations of N variables.
Data must be floats. Can contain NaN values.
Returns
-------
pca, dt : tuple
... | def pca_calc(nc, d):
"""
Calculates pca of d.
Parameters
----------
nc : int
Number of components
d : np.ndarray
An NxM array, containing M observations of N variables.
Data must be floats. Can contain NaN values.
Returns
-------
pca, dt : tuple
... | [
"Calculates",
"pca",
"of",
"d",
".",
"Parameters",
"----------",
"nc",
":",
"int",
"Number",
"of",
"components",
"d",
":",
"np",
".",
"ndarray",
"An",
"NxM",
"array",
"containing",
"M",
"observations",
"of",
"N",
"variables",
".",
"Data",
"must",
"be",
"... | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/filtering/pca.py#L10-L42 | [
"def",
"pca_calc",
"(",
"nc",
",",
"d",
")",
":",
"# check for and remove nans",
"ind",
"=",
"~",
"np",
".",
"apply_along_axis",
"(",
"any",
",",
"1",
",",
"np",
".",
"isnan",
"(",
"d",
")",
")",
"if",
"any",
"(",
"~",
"ind",
")",
":",
"pcs",
"="... | cd25a650cfee318152f234d992708511f7047fbe |
test | pca_plot | Plot a fitted PCA, and all components. | latools/filtering/pca.py | def pca_plot(pca, dt, xlabs=None, mode='scatter', lognorm=True):
"""
Plot a fitted PCA, and all components.
"""
nc = pca.n_components
f = np.arange(pca.n_features_)
cs = list(itertools.combinations(range(nc), 2))
ind = ~np.apply_along_axis(any, 1, np.isnan(dt))
cylim = (pca.co... | def pca_plot(pca, dt, xlabs=None, mode='scatter', lognorm=True):
"""
Plot a fitted PCA, and all components.
"""
nc = pca.n_components
f = np.arange(pca.n_features_)
cs = list(itertools.combinations(range(nc), 2))
ind = ~np.apply_along_axis(any, 1, np.isnan(dt))
cylim = (pca.co... | [
"Plot",
"a",
"fitted",
"PCA",
"and",
"all",
"components",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/filtering/pca.py#L45-L103 | [
"def",
"pca_plot",
"(",
"pca",
",",
"dt",
",",
"xlabs",
"=",
"None",
",",
"mode",
"=",
"'scatter'",
",",
"lognorm",
"=",
"True",
")",
":",
"nc",
"=",
"pca",
".",
"n_components",
"f",
"=",
"np",
".",
"arange",
"(",
"pca",
".",
"n_features_",
")",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | calc_windows | Apply fn to all contiguous regions in s that have at least min_points. | latools/filtering/signal_optimiser.py | def calc_windows(fn, s, min_points):
"""
Apply fn to all contiguous regions in s that have at least min_points.
"""
max_points = np.sum(~np.isnan(s))
n_points = max_points - min_points
out = np.full((n_points, s.size), np.nan)
# skip nans, for speed
ind = ~np.isnan(s)
s = s[ind]
... | def calc_windows(fn, s, min_points):
"""
Apply fn to all contiguous regions in s that have at least min_points.
"""
max_points = np.sum(~np.isnan(s))
n_points = max_points - min_points
out = np.full((n_points, s.size), np.nan)
# skip nans, for speed
ind = ~np.isnan(s)
s = s[ind]
... | [
"Apply",
"fn",
"to",
"all",
"contiguous",
"regions",
"in",
"s",
"that",
"have",
"at",
"least",
"min_points",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/filtering/signal_optimiser.py#L14-L31 | [
"def",
"calc_windows",
"(",
"fn",
",",
"s",
",",
"min_points",
")",
":",
"max_points",
"=",
"np",
".",
"sum",
"(",
"~",
"np",
".",
"isnan",
"(",
"s",
")",
")",
"n_points",
"=",
"max_points",
"-",
"min_points",
"out",
"=",
"np",
".",
"full",
"(",
... | cd25a650cfee318152f234d992708511f7047fbe |
test | calc_window_mean_std | Apply fn to all contiguous regions in s that have at least min_points. | latools/filtering/signal_optimiser.py | def calc_window_mean_std(s, min_points, ind=None):
"""
Apply fn to all contiguous regions in s that have at least min_points.
"""
max_points = np.sum(~np.isnan(s))
n_points = max_points - min_points
mean = np.full((n_points, s.size), np.nan)
std = np.full((n_points, s.size), np.nan)
# ... | def calc_window_mean_std(s, min_points, ind=None):
"""
Apply fn to all contiguous regions in s that have at least min_points.
"""
max_points = np.sum(~np.isnan(s))
n_points = max_points - min_points
mean = np.full((n_points, s.size), np.nan)
std = np.full((n_points, s.size), np.nan)
# ... | [
"Apply",
"fn",
"to",
"all",
"contiguous",
"regions",
"in",
"s",
"that",
"have",
"at",
"least",
"min_points",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/filtering/signal_optimiser.py#L33-L57 | [
"def",
"calc_window_mean_std",
"(",
"s",
",",
"min_points",
",",
"ind",
"=",
"None",
")",
":",
"max_points",
"=",
"np",
".",
"sum",
"(",
"~",
"np",
".",
"isnan",
"(",
"s",
")",
")",
"n_points",
"=",
"max_points",
"-",
"min_points",
"mean",
"=",
"np",... | cd25a650cfee318152f234d992708511f7047fbe |
test | bayes_scale | Remove mean and divide by standard deviation, using bayes_kvm statistics. | latools/filtering/signal_optimiser.py | def bayes_scale(s):
"""
Remove mean and divide by standard deviation, using bayes_kvm statistics.
"""
if sum(~np.isnan(s)) > 1:
bm, bv, bs = bayes_mvs(s[~np.isnan(s)])
return (s - bm.statistic) / bs.statistic
else:
return np.full(s.shape, np.nan) | def bayes_scale(s):
"""
Remove mean and divide by standard deviation, using bayes_kvm statistics.
"""
if sum(~np.isnan(s)) > 1:
bm, bv, bs = bayes_mvs(s[~np.isnan(s)])
return (s - bm.statistic) / bs.statistic
else:
return np.full(s.shape, np.nan) | [
"Remove",
"mean",
"and",
"divide",
"by",
"standard",
"deviation",
"using",
"bayes_kvm",
"statistics",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/filtering/signal_optimiser.py#L65-L73 | [
"def",
"bayes_scale",
"(",
"s",
")",
":",
"if",
"sum",
"(",
"~",
"np",
".",
"isnan",
"(",
"s",
")",
")",
">",
"1",
":",
"bm",
",",
"bv",
",",
"bs",
"=",
"bayes_mvs",
"(",
"s",
"[",
"~",
"np",
".",
"isnan",
"(",
"s",
")",
"]",
")",
"return... | cd25a650cfee318152f234d992708511f7047fbe |
test | median_scaler | Remove median, divide by IQR. | latools/filtering/signal_optimiser.py | def median_scaler(s):
"""
Remove median, divide by IQR.
"""
if sum(~np.isnan(s)) > 2:
ss = s[~np.isnan(s)]
median = np.median(ss)
IQR = np.diff(np.percentile(ss, [25, 75]))
return (s - median) / IQR
else:
return np.full(s.shape, np.nan) | def median_scaler(s):
"""
Remove median, divide by IQR.
"""
if sum(~np.isnan(s)) > 2:
ss = s[~np.isnan(s)]
median = np.median(ss)
IQR = np.diff(np.percentile(ss, [25, 75]))
return (s - median) / IQR
else:
return np.full(s.shape, np.nan) | [
"Remove",
"median",
"divide",
"by",
"IQR",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/filtering/signal_optimiser.py#L75-L85 | [
"def",
"median_scaler",
"(",
"s",
")",
":",
"if",
"sum",
"(",
"~",
"np",
".",
"isnan",
"(",
"s",
")",
")",
">",
"2",
":",
"ss",
"=",
"s",
"[",
"~",
"np",
".",
"isnan",
"(",
"s",
")",
"]",
"median",
"=",
"np",
".",
"median",
"(",
"ss",
")"... | cd25a650cfee318152f234d992708511f7047fbe |
test | signal_optimiser | Optimise data selection based on specified analytes.
Identifies the longest possible contiguous data region in
the signal where the relative standard deviation (std) and
concentration of all analytes is minimised.
Optimisation is performed via a grid search of all possible
contiguous data regions... | latools/filtering/signal_optimiser.py | def signal_optimiser(d, analytes, min_points=5,
threshold_mode='kde_first_max',
threshold_mult=1., x_bias=0,
weights=None, ind=None, mode='minimise'):
"""
Optimise data selection based on specified analytes.
Identifies the longest possible cont... | def signal_optimiser(d, analytes, min_points=5,
threshold_mode='kde_first_max',
threshold_mult=1., x_bias=0,
weights=None, ind=None, mode='minimise'):
"""
Optimise data selection based on specified analytes.
Identifies the longest possible cont... | [
"Optimise",
"data",
"selection",
"based",
"on",
"specified",
"analytes",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/filtering/signal_optimiser.py#L132-L389 | [
"def",
"signal_optimiser",
"(",
"d",
",",
"analytes",
",",
"min_points",
"=",
"5",
",",
"threshold_mode",
"=",
"'kde_first_max'",
",",
"threshold_mult",
"=",
"1.",
",",
"x_bias",
"=",
"0",
",",
"weights",
"=",
"None",
",",
"ind",
"=",
"None",
",",
"mode"... | cd25a650cfee318152f234d992708511f7047fbe |
test | optimisation_plot | Plot the result of signal_optimise.
`signal_optimiser` must be run first, and the output
stored in the `opt` attribute of the latools.D object.
Parameters
----------
d : latools.D object
A latools data object.
overlay_alpha : float
The opacity of the threshold overlays. Between... | latools/filtering/signal_optimiser.py | def optimisation_plot(d, overlay_alpha=0.5, **kwargs):
"""
Plot the result of signal_optimise.
`signal_optimiser` must be run first, and the output
stored in the `opt` attribute of the latools.D object.
Parameters
----------
d : latools.D object
A latools data object.
overlay_a... | def optimisation_plot(d, overlay_alpha=0.5, **kwargs):
"""
Plot the result of signal_optimise.
`signal_optimiser` must be run first, and the output
stored in the `opt` attribute of the latools.D object.
Parameters
----------
d : latools.D object
A latools data object.
overlay_a... | [
"Plot",
"the",
"result",
"of",
"signal_optimise",
"."
] | oscarbranson/latools | python | https://github.com/oscarbranson/latools/blob/cd25a650cfee318152f234d992708511f7047fbe/latools/filtering/signal_optimiser.py#L392-L508 | [
"def",
"optimisation_plot",
"(",
"d",
",",
"overlay_alpha",
"=",
"0.5",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"hasattr",
"(",
"d",
",",
"'opt'",
")",
":",
"raise",
"ValueError",
"(",
"'Please run `signal_optimiser` before trying to plot its results.'",
... | cd25a650cfee318152f234d992708511f7047fbe |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.