This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |