Пример #1
0
    def get_fingerprint(self, mol):
        """
        Gets the fingerprint according to the chosen fingerprint type
        """
        if self.fp_type == 'rdkit':
            fp = RDKFingerprint(mol)
        elif self.fp_type == 'morgan':
            fp = GetMorganFingerprintAsBitVect(mol, 2)

        return np.array(list(map(int, fp.ToBitString())))
Пример #2
0
def convert_to_rdkit(SMILES):
    mol = MS(SMILES)
    desc_val = RDKFingerprint(mol)
    desc_val_float_list = list(
        np.asarray(list(desc_val.ToBitString()), dtype=float))
    return desc_val_float_list