Skip to main content
. Author manuscript; available in PMC: 2015 Apr 1.
Published in final edited form as: Netw Model Anal Health Inform Bioinform. 2014 Feb 3;3:54. doi: 10.1007/s13721-014-0054-1

Algorithm 2.

comparekmerset (string first-string, string second-string)

Require: Pair of F-set strings generated from m/z of spectra using GenerateFsets function
Ensure: Returns the number of F-set that are common between the two spectra
  /* splitfunction(string X) takes a string X and changes it into vector where each entry in vector corresponds to a single F-set */
  vector firstv=splitfunction(first-string)
  vector secondv=splitfunction(second-string)
  int count=0
  for (i = 0; i < firstv.size(); i + +) in parallel do
    for (j = 0; j < secondv.size(); j + +) do
      if (firstv[i].compare(secondv[j]) == 0) then
        count++;
      end if
    end for
  end for
  return count;