Description Usage Arguments Value Examples
View source: R/computeSimilarity.R
Compute Spectral Similarity
1 2 3 4 5 6 7 8 9 | computeSimilarity(
mzDt,
ppmTol,
isCentroid,
intensityMin = 0,
normalize = TRUE,
normalization_method = "sqrt",
similarity_method
)
|
mzDt |
a data.table imported by mzML2dataTable() with columns 'seqNum', 'mz', 'intensity' |
ppmTol |
the mass accuracy of the instrument |
isCentroid |
Logical. Is the data centered? |
intensityMin |
Optional parameter. Ions with intensity < intensityMin will be removed. Default = 0 allowing all ions into algorighm. |
normalize |
Optional parameter. Should the intensity be normalized before any processing is done? Default = TRUE. |
normalization_method |
Optional parameter. Select normalization method: "maxPeak", "sqrt", "sum". See '.normalizeEachSpectrum_dt' for details. |
similarity_method |
Select similarity metric to be used. "dotProd", "specContrast", "specCor", "brayCurtis", "euclidean". |
a 3 column matrix containing the similarity score and seqNum of each compared spectrum
1 2 3 4 5 6 7 8 9 10 11 | dt <- mzML2dataTable(path = msdata::proteomics(full.names = TRUE)[3])
simMat <- computeSimilarity(mzDt = dt[msLevel == 2 & seqNum %between% c(1, 10)],
ppmTol = 100,
isCentroid = TRUE,
intensityMin = 0.01,
normalize = TRUE,
normalization_method = "sqrt",
similarity_method = "specContrast")
squareMat <- similarity2SquareMatrix(simMat)
image(squareMat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.