def morgan_sim(mol1, mol2, radius=2, digit=3):
    """Calculate morgan fingerprint similarity by using RDKit
    radius=2 roughly equivalent to ECFP4
    """
    rdmol1 = to_rdmol(mol1)
    rdmol2 = to_rdmol(mol2)
    fp1 = AllChem.GetMorganFingerprint(rdmol1, radius)
    fp2 = AllChem.GetMorganFingerprint(rdmol2, radius)
    return round(DataStructs.DiceSimilarity(fp1, fp2), digit)
Calculate morgan fingerprint similarity by using RDKit
    radius=2 roughly equivalent to ECFP4