Package: falcon-ms
falconFor more information:Official code websiteThefalconspectrum clustering tool uses advanced algorithmic techniques for
highly efficient processing of millions of MS/MS spectra. First,
high-resolution spectra are binned and converted to low-dimensional vectors
using feature hashing. Next, the spectrum vectors are used to construct nearest
neighbor indexes for fast similarity searching. The nearest neighbor indexes
are used to efficiently compute a sparse pairwise distance matrix without
having to exhaustively compare all spectra to each other. Finally,
density-based clustering is performed to group similar spectra into clusters.The software is available as open-source under the BSD license.If you usefalconin your work, please cite the following publication:Wout Bittremieux, Kris Laukens, William Stafford Noble, Pieter C. Dorrestein.Large-scale tandem mass spectrum clustering using fast nearest neighbor
searching.publication pending(2021).Installationfalconrequires Python 3.8+ and is available on the Linux and OSX platforms.You can easily installfalconwith pip:pip install falcon-msRunningfalconfalconcan be run from the command line, with settings specified as
command-line arguments or set in an INI config file.falcontakes peak files
(in the mzML, mzXML, or MGF format) as input and exports the clustering result
as a comma-separated file with each MS/MS spectrum and its cluster label on a
single line. Representative spectra for each cluster can optionally be exported
to an MGF file.Examplefalconrun with some relevant command-line arguments:falcon peak/*.mzml falcon --export_representatives --precursor_tol 20 ppm --fragment_tol 0.05 --eps 0.10This will cluster all MS/MS spectra in mzML files in thepeakdirectory with
the specified settings and write (i) the cluster assignments to thefalcon.csvfile, and (ii) the cluster representatives to thefalcon.mgffile.For detailed information on all available settings, runfalcon -horfalcon --help.Important settingsHere we provide information on the most important settings that influence thefalconclustering performance. All settings have sensible default values
which should give good results for a wide variety of datasets.Spectrum comparisonprecursor_tol: The precursor mass tolerance and unit (in ppm or Dalton) to
compare spectra to each other.fragment_tol: The fragment mass tolerance (in Dalton) used during spectrum
comparison.Clusteringeps: The maximum cosine distance between two spectra for them to be
considered as neighbors of each other. This parameter crucially governs cluster
purity (i.e. clusters contain spectra corresponding to only a single peptide).
The ideal value of this parameter depends on the spectral characteristics of
your data and optional spectrum preprocessing configured infalcon. Values
between 0.05 and 0.15 will typically generate a pure clustering result. For
more aggressive clustering values up to 0.30 can be used.Nearest neighbor indexing(see below)n_probe: The maximum number of lists in the inverted index to inspect
during querying. Inspecting fewer lists will run faster but will give slightly
less accurate clustering results.n_neighborsandn_neighbors_ann: The final number of neighbors to
consider for each spectrum and during nearest neighbor searching. Querying less
neighbors will run faster but will give slightly less accurate clustering
results.n_neighbors_annshould be equal or greater thann_neighbors.hash_len: The length of the hashed vectors used for nearest neighbor
searching. Larger vectors will minimize the number of hash collisions and more
accurately approximate the true cosine distance, at the expense of longer
nearest neighbor searching and memory requirements.Spectrum preprocessingThere are several options to configure spectrum preprocessing prior to the
clustering. See the command-line documentation for more information.How does it work?High-resolution MS/MS spectra are converted to low-dimensional vectors using
feature hashing. First, spectra are converted to sparse vectors using small
mass bins to tightly capture their fragment masses. Next, the sparse,
high-dimensional, vectors are hashed to lower-dimensional vectors by using a
hash function (the non-cryptographic MurmurHash3 algorithm) to map the mass
bins separately to a small number of hash bins. This feature hashing conserves
the cosine similarity between hashed vectors and can be used to approximate the
similarity between the original spectra.Vectors are split into buckets based on the precursorm/zof the
corresponding spectra to construct nearest neighbor indexes for highly
efficient spectrum comparison. The spectrum vectors in each bucket are
partitioned into data subspaces to create a Voronoi diagram, and all vectors
are assigned to their nearest representative vector in an inverted index.A sparse pairwise distance matrix is computed by retrieving similarities to
neighboring spectra using the nearest neighbor indexes. The accuracy and speed
of similarity searching is governed by the number of neighboring cells to
explore during searching: exploring more cells during searching decreases the
chance of missing a nearest neighbor in the high-dimensional space, at the
expense of a longer searching time.Density-based clustering using the pairwise distance matrix is performed to
find spectrum clusters. The DBSCAN algorithm is used to find spectra that are
close to each other and that form a dense data subspace, and group them into
clusters.ContactFor more information you can visit theofficial code websiteor send an email
towbittremieux@health.ucsd.edu.