The program that I wrote to calculate the dot products between the spectra in two library (.blib or .midas) files can be downloaded here:
https://github.com/nickshulman/SkylineSideProjects/releases/tag/LibraryDotProduct_0.0.1
I think the reason that this program produces slightly different dot products from Skyline comes from the fact that it has a different way of deciding which intensities to put into the vectors in the dot product calculation.
When computing the dot product of two spectra, you usually want to only include the signal that came from the target peptide. If there is extraneous signal in the spectrum that came from something else, you do not want that included in the dot product.
Skyline figures out the m/z's of all of the predicted fragment ions of the peptide, and, for each of those m/z values, figures out how much signal is in the two spectra, and each of those intensities is in the vector for calculating the dot product.
This other program cannot do that because it does not know anything about amino acid masses or fragmentation, so, what it does, instead, is just look at the spectrum in the first library that was specified on the commandline, and, every nonzero intensity becomes a value in the first vector, and the corresponding signal from the spectrum from the second value becomes a value in the second vector.
I think this works well when the first spectrum is a predicted spectrum from Prosit, because those spectra do not have much extraneous noise from things that are not associated with the peptide of interest. But, the numbers are going to be a little different because Prosit and Skyline have different ways of deciding what the predicted fragments of a peptide are.
-- Nick