Skip to content

Instantly share code, notes, and snippets.

View TADuncombe's full-sized avatar

Todd Duncombe TADuncombe

View GitHub Profile
clear;
%File Directory (SET)
base_folder='D:\Herr Lab\Data\Data analysis\20150915-BT474-HER2 isoform study\slide 4\';
%USER DEFINED SETTINGS (SET)
fileNumber=1; %first file to analyze
loop='y';%'y' to loop through all files
curveFit='y';%'y' to perform curve fitting
overlayArray='y';%'y' to overlay array
@TADuncombe
TADuncombe / peakdetect.py
Created October 6, 2015 22:52 — forked from sixtenbe/analytic_wfm.py
Peak detection in Python
import numpy as np
from math import pi, log
import pylab
from scipy import fft, ifft
from scipy.optimize import curve_fit
i = 10000
x = np.linspace(0, 3.5 * pi, i)
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 *
np.random.randn(i))
@TADuncombe
TADuncombe / als.py
Created October 6, 2015 22:50 — forked from perimosocordiae/als.py
Asymmetric Least Squares
import numpy as np
from scipy.linalg import solveh_banded
def als_baseline(intensities, asymmetry_param=0.05, smoothness_param=1e6,
max_iters=10, conv_thresh=1e-5, verbose=False):
'''Computes the asymmetric least squares baseline.
* http://www.science.uva.nl/~hboelens/publications/draftpub/Eilers_2005.pdf
smoothness_param: Relative importance of smoothness of the predicted response.
from als import als_baseline
from peakdetect import peakdetect
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
def msProcess(mz, raw_intensity,
asymmetry_param=0.05, smoothness_param=1e6, #background subract params
max_iters=10, conv_thresh=1e-5, verbose=False, #background subract params