@@ -0,0 +1,1935 @@
+/*%0A * Copyright 2006-2021 The MZmine Development Team%0A *%0A * This file is part of MZmine.%0A *%0A * MZmine is free software; you can redistribute it and/or modify it under the terms of the GNU%0A * General Public License as published by the Free Software Foundation; either version 2 of the%0A * License, or (at your option) any later version.%0A *%0A * MZmine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even%0A * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU%0A * General Public License for more details.%0A *%0A * You should have received a copy of the GNU General Public License along with MZmine; if not,%0A * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.%0A *%0A */%0A%0Apackage io.github.mzmine.modules.tools.molecular_similarity.tanimoto;%0A%0Aimport java.util.BitSet;%0Aimport org.openscience.cdk.DefaultChemObjectBuilder;%0Aimport org.openscience.cdk.exception.CDKException;%0Aimport org.openscience.cdk.fingerprint.Fingerprinter;%0Aimport org.openscience.cdk.interfaces.IAtomContainer;%0Aimport org.openscience.cdk.similarity.Tanimoto;%0Aimport org.openscience.cdk.smiles.SmilesParser;%0A%0A/**%0A * @author Robin Schmid (https://github.com/robinschmid)%0A */%0Apublic class TanimotoSimilarity %7B%0A%0A  private final SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());%0A  private final Fingerprinter fingerprinter = new Fingerprinter();%0A%0A  public double forSmiles(String a, String b) throws CDKException %7B%0A    // maybe need to add explicit hydrogens etc?%0A    IAtomContainer mola = sp.parseSmiles(a);%0A    IAtomContainer molb = sp.parseSmiles(b);%0A    return forMol(mola, molb);%0A  %7D%0A%0A  private double forMol(IAtomContainer a, IAtomContainer b) throws CDKException %7B%0A    final BitSet fpa = fingerprinter.getFingerprint(a);%0A    final BitSet fpb = fingerprinter.getFingerprint(b);%0A    return Tanimoto.calculate(fpa, fpb);%0A  %7D%0A%0A%7D%0A

Add tanimoto starter