Combine function error

86 views
Skip to first unread message

Bailey Polimer

unread,
Jun 14, 2022, 9:34:15 PM6/14/22
to Cardinal MSI Help
Hi, 

I have imported two seperate hdr files and would like to combine them to do PCA on 2 samples however keep getting an error for the following code: 

mse_binned <- mzBin(mse, from=300, to=700,resolution = NA, units ="mz", fun=sum)
process(mse_binned)
mse2_binned <- mzBin(mse2, from=300, to=700, resolution = NA, units ="mz", fun=sum)
process(mse2_binned)

cbind(mse_binned,mse2_binned)

The error is as follows: 
Error in cbind(...) : 'mz' must match

I have matched mz so I'm confused as to why it is not working. Also, is there any way I can conduct PCA on 2 samples at the same time using the PCA() function? 

Thanks, 
Bailey

Melanie Föll

unread,
Jul 6, 2022, 11:38:55 PM7/6/22
to Cardinal MSI Help
Hi Bailey,

the problem might be that you did not specify the resolution, which means that the optimal resolution will be calculated for each dataset and this probably resulted in (slightly) different values, thus leading to a differently binned m/z axis.
I assume just specifying a value for resolution should fix the problem. You can double check if the mz match after binning by using: all.equal(mz(mse_binned), mz(mse2_binned)). Please let us know in case the result is TRUE and cbind does still not work.

Best,
Melanie
Reply all
Reply to author
Forward
0 new messages