预处理原始质谱数据
此示例显示了如何提高原始质谱数据的质量。特别是,此示例说明了飞行质谱(SELDI-TOF)的预处理蛋白表面增强激光解吸/电离时间的典型步骤。
加载数据
质谱数据可以以不同的格式存储。如果将数据存储在具有两个列(质量/电荷(M/z)比率和相应强度值的文本文件中),则可以使用以下MATLAB®I/O函数之一:importdata
,,,,dlmread
, 或者textscan
。另外,如果数据存储在JCAMP-DX格式化文件中,则可以使用该函数jcampread
。如果数据包含在Excel®工作簿的电子表格中,则可以使用该功能XLSREAD
如果数据存储在MZXML格式化文件中,则可以使用该函数mzxmlread
,,,,and finally, if the data is stored in SPC formatted files, you can useTGSPCREAD
。
该示例使用从低分辨率卵巢癌NCI/FDA数据集中获取的频谱图FDA-NCI临床蛋白质组学计划数据库。这se spectra were generated using the WCX2 protein-binding chip, two with manual sample handling and two with a robotic sample dispenser/processor.
示例= importdata('mspec01.csv')
sample = struct with fields: data: [15154x2 double] textdata: {'M/Z' 'Intensity'} colheaders: {'M/Z' 'Intensity'}
m/z比率在data
场和离子强度在第二个。
mz = sample.data(:,1);y = sample.data(:,2);
For better manipulation of the data, you can load multiple spectrograms and concatenate them into a single matrix. Use thedlmread
function to read comma separated value files. Note: This example assumes that the M/Z ratios are the same for the four files. For data sets with different M/Z ratios, usemsresample
创建一个均匀的m/z矢量。
文件= {'mspec01.csv',,,,'mspec02.csv',,,,'mspec03.csv',,,,'MSPEC04.CSV'};为了i = 1:4 Y(:,i) = dlmread(files{i},',',,,,1,1);% skips the first row (header)结尾
使用阴谋
command to inspect the loaded spectrograms.
阴谋(MZ,Y) axis([0 20000 -20 105]) xlabel('质量/电荷(m/z)')ylabel(“相对强度”)title(“四个低分辨率质谱示例”)
重新采样光谱
重采样质谱数据具有多个优点。它使质量/电荷(m/z)向量均匀,使您可以在相同的参考和相同分辨率下比较不同的光谱。在高分辨率数据集中,大尺寸的文件导致计算密集型算法。但是,高分辨率光谱可能是多余的。通过重新采样,您可以将信号缩短到更易于管理的m/z向量,从而保留光谱的信息内容。这msresample
函数允许您选择新的M/Z向量,并应用一个防止高频噪声折叠成较低频率的抗逆转录滤波器。
Load a high-resolution spectrum taken from the high-resolution ovarian cancer NCI/FDA data set. For convenience, the spectrum is included in a MAT-formatted file.
加载sample_hi_resnumel(mz_hi_res)
ans = 355760
将光谱下样本为10,000 m/z点在2,000至11,000之间。使用SHOWPLOT
属性创建一个自定义图,可让您遵循并评估预处理动作的质量。
[MZH,YH] = msresample(MZ_hi_res,Y_hi_res,10000,'范围',[2000 11000],“ Showplot”,真的);
Zooming into a reduced region reveals the detail of the down-sampling procedure.
轴([[3875 3895 0 90])
基线校正
Mass spectrometry data usually show a varying baseline caused by the chemical noise in the matrix or by ion overloading. Themsbackadj
function estimates a low-frequency baseline, which is hidden among high-frequency noise and signal peaks. It then subtracts the baseline from the spectrogram.
调整一组频谱图的基线,仅显示第二个及其估计的背景。
YB = msbackadj(MZ,Y,“ Windowsize”,500,“分数”,,,,0.20,“ Showplot”,2);
Spectral Alignment of Profiles
质谱仪的错误校准导致观察到的M/Z矢量与离子的真实飞行时间之间的关系变化。因此,在重复实验中可以出现系统的变化。当频谱图中预期已知的峰值时,您可以使用该函数MSALIGN
to standardize the M/Z values.
To align the spectrograms, provide a set of M/Z values where reference peaks are expected to appear. You can also define a vector with relative weights that is used by the aligning algorithm to emphasize peaks with small area.
p = [3991.4 4598 7964 9160];% M/Z location of reference peaksW = [60 100 60 100];参考峰的重量%
显示一个热图,以观察应用对齐算法之前和之后的光谱对齐。
msheatmap(MZ,YB,“标记”,p,'范围',[3000 10000])标题(“对齐前”)
将频谱图的集合与给定的参考峰。
YA = msalign(MZ,YB,P,'WEIGHTS',w);MSHEATMAP(MZ,YA,“标记”,p,'范围',[3000 10000])标题('After Alignment')
Normalization
In repeated experiments, it is common to find systematic differences in the total amount of desorbed and ionized proteins. Themsnorm
功能实现了典型归一化(或标准化)方法的几种变化。
例如,标准化频谱图值的众多方法之一是将每个信号的最大强度重新确定为特定值,例如100。也可以忽略有问题的区域。例如,在血清样品中,您可能需要忽略低质量区域(m/z <1000 da。)。
yn1 = msnorm(mz,ya,“分数”,,,,1,'LIMITS',[1000 inf],'最大限度',,,,100); figure plot(MZ,YN1) axis([0 10000 -20 150]) xlabel('质量/电荷(m/z)')ylabel(“相对强度”)title(“归一化为最大峰”)
这msnorm
功能还可以通过使用曲线(AUC)下的区域进行标准化,然后重新恢复频谱图以低于100的相对强度。
YN2 = msnorm(MZ,YA,'LIMITS',[1000 inf],'最大限度',,,,100); figure plot(MZ,YN2) axis([0 10000 -20 150]) xlabel('质量/电荷(m/z)')ylabel(“相对强度”)title(“使用曲线下的区域(AUC)归一化”)
峰值保持降噪
标准化光谱通常包含噪声和信号的混合物。一些应用需要降解光谱图,以提高光谱中观察到的质量/电荷值的有效性和精度。出于同样的原因,denosing还改善了进一步的峰值检测算法。但是,重要的是要尽可能保留峰的清晰度(或高频组件)。为此,您可以使用Lowess平滑(mslowess
)and polynomial filters (女士
)。
用二阶的多项式过滤器平滑频谱图。
ys = mssgolay(mz,yn2,'跨度',35,“ Showplot”,3);
放大到还原的区域揭示了平滑算法的细节。
轴([8000 9000 -1 8])
Peak Finding with Wavelets Denoising
找到假定峰的一种简单方法是查看平滑信号的第一个衍生物,然后归档其中的一些位置,以避免小离子强度峰。
P1 = mspeaks(MZ,YS,'denoising',,,,false,“高度窗”,,,,2,“ Showplot”,,,,1)
p1 = 4x1单元格数组{164x2 double} {171x2 double} {169x2 double} {147x2 double}
这mspeaks
功能还可以使用降级小波估算噪声。这种方法通常更健壮,因为可以直接在嘈杂的光谱上实现峰值检测。该算法将适应信号的不同噪声条件,即使存在低分辨率或过度分析,也可以解决峰值。
p2 = mspeaks(mz,yn2,'BASE',12,'乘数',10,“高度窗”,,,,1,“ Showplot”,,,,1)
p2 = 4x1单元格数组{322x2 double} {370x2 double} {324x2 double} {295x2 double}
Eliminate extra peaks in the low-mass region
p3 = cellfun( @(x)x(x(:,1)> 1500,:),p2,'制服',,,,false)
p3 = 4x1单元格数组{81x2 double} {93x2 double} {57x2 double} {53x2 double}
Binning: Peak Coalescing by Hierarchical Clustering
与相似化合物相对应的峰值仍可能有微小的质量/电荷差异或漂移。假设四个频谱图对应于可比的生物/化学样品,则比较来自不同光谱的峰可能很有用,这需要峰值嵌套(又称峰值合并)。数据包裹的关键任务是创建一个常见的质量/电荷参考矢量(或垃圾箱)。理想情况下,垃圾箱应从每个信号中收集一个峰,并应避免从同一信号收集多个相关峰到同一垃圾箱中。
本示例使用层次聚类来计算常见的质量/电荷参考矢量。当使用低分辨率光谱时,该方法就足够了。但是,对于高分辨率光谱或具有许多频谱图的数据集,该函数mspalign
提供其他可扩展的方法来估计常见的质量/电荷参考并执行数据嵌入。
将所有峰放入一个阵列中,并为每个峰的频谱索引构造矢量。
allPeaks = cell2mat(P3); numPeaks = cellfun(@(x) length(x),P3); Sidx = accumarray(cumsum(numPeaks),1); Sidx = cumsum(Sidx)-Sidx;
Create a custom distance function that penalizes clusters containing peaks from the same spectrogram, then perform hierarchical clustering.
distfun = @(x,y) (x(:,1)-y(:,1)).^2 + (x(:,2)==y(:,2))*10^6 tree = linkage(pdist([allPeaks(:,1),Sidx],distfun)); clusters = cluster(tree,'隔断',,,,75,'标准',,,,'Distance');
distFun = function_handle具有值: @(x,y)(x(:,1)-y(:,1))。^2+(x(x(:,2)== y(:,2))6
通过计算每个群集的质心来找到公共质量/电荷参考矢量(CMZ)。
cmz = accamaray(clusters,prod(allpeaks,2))./ accomarray(clusters,allpeaks(::,2));
同样,还计算每个群集的最大峰强度。
pr = accamaray(簇,allpeaks(::,2),[],@max);[cmz,h] = stort(cmz);pr = pr(h);图onboxon图([CMZ CMZ],[-10 100],'-k')图(MZ,YN2)轴([7200 8500 -10 100])Xlabel('质量/电荷(m/z)')ylabel(“相对强度”)title('Common Mass/Charge (M/Z) Locations found by Clustering')
动态编程箱
这采样
function allows you to use a dynamic programming algorithm to assign the observed peaks in each spectrogram to the common mass/charge reference vector (CMZ
)。
当使用较简单的binning方法时,例如舍入质量/电荷值或使用最近的邻居量化CMZ
矢量,由于仍然存在的小漂移,不同光谱的同一峰将我分配给不同的垃圾箱。为了解决这个问题,可以通过质谱峰值分辨率的牺牲来增加垃圾箱的大小。通过使用动态编程套件,您可以保留分辨率,同时最大程度地减少从不同频谱图到不同峰位置分配类似化合物的问题。
pa = nan(numel(cmz),4);为了i = 1:4 [j,k] = samplealign([cmz pr],p3 {i},'乐队',15,'WEIGHTS',[1 .1]);pa(j,i)= p3 {i}(k,2);结尾图onboxon图([CMZ CMZ],[-10 100],':k')阴谋(MZ,YN2) plot(CMZ,PA,'o')轴([7200 8500 -10 100])Xlabel('质量/电荷(m/z)')ylabel(“相对强度”)title(“与公共质量/电荷(M/z)参考的峰值”)
Usemsviewer
to inspect the preprocessed spectrograms on a given range (for example, between values 7600 and 8200).
R1 = 7600;R2 = 8200;范围= mz> r1&mzr1&cmz “标记”,,,,rangeMarkers,'团体',1:4)
也可以看看
女士
|msnorm
|MSALIGN
|msheatmap
|msbackadj
|msresample
|mspeaks
|msviewer