spike.Interactive package

Submodules

spike.Interactive.FTICR_INTER copy module

spike.Interactive.FTICR_INTER module

A tool to display 2D FT-ICR data-sets

to be embedded in jupyter notebook

First version MAD jan 2019 preliminary and not fully tested !

class spike.Interactive.FTICR_INTER.Calib(data)[source]

Bases: object

a simple tool to show and modify calibration cste

back(event)[source]
update(event)[source]
class spike.Interactive.FTICR_INTER.MR(name, report=True, Debug=False)[source]

Bases: object

this class handles multiresolution datasets

col(i)[source]

return a column with coordinate in index

colmz(i)[source]

return a column with coordinate in m/z

compute_absmax()[source]

computes largest point from smaller resolution, and propagates

load()[source]

load from file

report()[source]

report object content

row(i)[source]

return a row with coordinate in index

rowmz(i)[source]

return a row with coordinate in m/z

to_display(zoom=((0, 10000000.0), (0, 10000000.0)), verbose=False)[source]

computes and return which dataset to display at a given zoom and scale level” in: zoom = ((F1low, F1up), (F2low,F2up)) - in m/z

out: a tuple (data, zoomwindow), where data is a NPKData and zoomwindow an eventually recalibrated zoom window

so, if DATA is an MR() object and Zoom a defined window in m/z ((F1low, F1up), (F2low,F2up)) the sequence:

datasel, zz = DATA.to_display(Zoom) datasel.display(zoom=zz, scale=…)

will display the selected zone with the best possible resolution

class spike.Interactive.FTICR_INTER.MR2(name, figsize=None, report=True, show=True, Debug=False)[source]

Bases: spike.Interactive.FTICR_INTER.MR_interact

back(*arg)[source]
forw(*arg)[source]
class spike.Interactive.FTICR_INTER.MR_interact(name, figsize=None, report=True, show=True, Debug=False)[source]

Bases: spike.Interactive.FTICR_INTER.MR

I1D()[source]
back(*arg)[source]
bb(name, desc, action, layout=None, tooltip='')[source]

build button

check_fig()[source]
check_fig1D()[source]
display(zoom=None, scale=None, redraw=None)[source]
display1D()[source]
down(b, factor=1.44)[source]
ext_box()[source]
forw(*arg)[source]
fullzoom()[source]
left(b, factor=1.44)[source]
reset(b)[source]
reset_track()[source]
right(b, factor=1.44)[source]
scale1(b)[source]
scaledown(b)[source]
scaleup(b)[source]
show()[source]

actually show the graphical tool and the interactive spectrum

up(b, factor=1.44)[source]
update()[source]
zoom
zoom_box()[source]
zoom_in(b, factor=1.44)[source]
z_in: waft = wbef/factor => waft*factor = wbef
dw = wbef/factor-wbef = wbef*(1-factor) dw = waft*factor*(1-factor)
zoom_out(b, factor=1.44)[source]

z_in: dw = waft*factor*(1-factor) z_out:dw = wbef*(factor*(1-factor))

zoomwidth()[source]
class spike.Interactive.FTICR_INTER.MSPeaker(npkd, pkname)[source]

Bases: object

a peak-picker for MS experiments

display(event={'name': 'value'})[source]

display spectrum and peaks

done(event)[source]

exit GUI

pickpeak(event)[source]

interactive wrapper to peakpick

pkexport(event)[source]

exports the peaklist to file

pklist()[source]

creates peaklist

pkprint(event)[source]
pp()[source]

do the peak-picking calling pp().centroid()

class spike.Interactive.FTICR_INTER.SpforSuper(i, name)[source]

Bases: object

a holder for SuperImpose

display()[source]
class spike.Interactive.FTICR_INTER.SuperImpose(base=None, filetype='*.msh5', N=None)[source]

Bases: object

a tool to superimpose spectra

Show()[source]
copy(event)[source]
display(event)[source]

spike.Interactive.INTER copy module

spike.Interactive.INTER module

A set of utilities to use spike in NMR or FTMS within jupyter

First version MAD june 2017 preliminary and not fully tested !

class spike.Interactive.INTER.AvProc1D(filename='')[source]

Bases: object

Detailed 1D NMR Processing

apmin_select(e)[source]
apod()[source]
apod_select(e)[source]
display()[source]
load()[source]
process(e)[source]
show()[source]
show_apod(e)[source]
class spike.Interactive.INTER.FileChooser(base=None, filetype=['fid', 'ser'], mode='r', show=True)[source]

Bases: object

a simple file chooser for Jupyter - obsolete - not used

basename

the basename of the chosen file

dirlist()[source]
dirname

the final dirname containing the chosen file

file

the chosen complete filename

filelist()[source]
nmrname

the final dirname containing the chosen file for TopSpin files

setdir(e)[source]
show()[source]
updir(e)[source]
wob(e)[source]
class spike.Interactive.INTER.NMRIntegrate(npkd)[source]

Bases: object

an integrator for NMR experiments

display()[source]

refresh display from event

int()[source]

do the integration

integrate(event)[source]

integrate from event

ob(event)[source]
on_Apply(b)[source]
on_cancel(b)[source]
print(event)[source]
set_value(b)[source]
class spike.Interactive.INTER.NMRPeaker1D(data, figsize=None)[source]

Bases: spike.Interactive.INTER.Show1D

a peak-picker for NMR experiments

display()[source]

interactive wrapper to peakpick

ob(event)[source]
on_cancel(b)[source]
on_done(b)[source]
pickpeak(event)[source]

interactive wrapper to peakpick

pklist()[source]

creates peaklist for printing or exporting

pkprint(event)[source]
pp()[source]

do the peak-picking calling pp().centroid()

class spike.Interactive.INTER.Phaser1D(data)[source]

Bases: object

An interactive phaser in 1D NMR

Phaser1D(spectrum)

best when in %matplotlib inline

close_all()[source]
ob(event)[source]

observe changes and start phasing

on_Apply(b)[source]
on_cancel(b)[source]
phase()[source]

apply phase and display

ppivot()[source]

converts from pivot values to centered ones

class spike.Interactive.INTER.Phaser2D(data)[source]

Bases: object

An interactive phaser in 2D NMR

Phaser2D(spec)

best when in %matplotlib inline

close()[source]
display(todisplay=None)[source]

display either the current data or the one provided - red and blue

ob(event)[source]

observe changes and start phasing

on_Apply(b)[source]
on_cancel(b)[source]
phase()[source]

compute phase and display

class spike.Interactive.INTER.Show1D(data, title=None, figsize=None)[source]

Bases: object

An interactive display, 1D NMR
Show1D(spectrum)

to be developped for peaks and integrals

close()[source]
disp()[source]
ob(event)[source]

observe events and display

on_done(b)[source]
class spike.Interactive.INTER.Show1Dplus(data, figsize=None, title=None)[source]

Bases: spike.Interactive.INTER.Show1D

disp()[source]
on_done(e)[source]
class spike.Interactive.INTER.Show2D(data, title=None, figsize=None)[source]

Bases: object

A display for 2D NMR with a scale cursor Show2D(spectrum) where spectrum is a NPKData object - special display for DOSY.

disp(new=False)[source]
ob(event)[source]

observe events and display

on_done(b)[source]
class spike.Interactive.INTER.baseline1D(data, figsize=None)[source]

Bases: spike.Interactive.INTER.Show1D

close()[source]
corrected()[source]
correction()[source]

returns the correction to apply as a numpy array

disp()[source]
on_auto(e)[source]

automatically set baseline points

on_cancel(e)[source]
on_done(e)[source]
on_set(e)[source]

add baseline points at selector

on_unset(e)[source]

remove baseline points closest from selector

selpos()[source]

returns selector pos in ppm

class spike.Interactive.INTER.baseline2D_F2(data, figsize=None)[source]

Bases: spike.Interactive.INTER.baseline1D

on_done(e)[source]
spike.Interactive.INTER.hidecode(initial='show', message=True)[source]

this func adds a button to hide/show the code on a jupyter page initial is either ‘show’ or ‘hide’ see: https://stackoverflow.com/questions/27934885/how-to-hide-code-from-cells-in-ipython-notebook-visualized-with-nbviewer/28073228#28073228

spike.Interactive.INTER.jsalert(msg)[source]

send a javascript alert

spike.Interactive.ipyfilechooser module

class spike.Interactive.ipyfilechooser.FileChooser(path='/Users/mad/spike/spike_make_sphinx', filename='', show_hidden=False, **kwargs)[source]

Bases: ipywidgets.widgets.widget_box.VBox

default

Get the default value

default_filename

Get the default_filename value

default_path

Get the default_path value

nmrname
refresh()[source]

Re-render the form

reset(path=None, filename=None)[source]

Reset the form to the default path and filename

rows

Get current number of rows

selected

Get selected value

selected_filename

Get the selected_filename

selected_path

Get selected_path value

show_hidden

Get current number of rows

spike.Interactive.ipyfilechooser.get_dir_contents(path, hidden=False)[source]

Get directory contents

spike.Interactive.ipyfilechooser.get_subpaths(path)[source]

Walk a path and return a list of subpaths

spike.Interactive.ipyfilechooser.has_parent(path)[source]

Check if a path has a parent folder

spike.Interactive.ipyfilechooser.update_path(path, item)[source]

Update path with new item

Module contents