當前位置: 首頁>>代碼示例>>Python>>正文


Python Descriptors.NumHDonors方法代碼示例

本文整理匯總了Python中rdkit.Chem.Descriptors.NumHDonors方法的典型用法代碼示例。如果您正苦於以下問題:Python Descriptors.NumHDonors方法的具體用法?Python Descriptors.NumHDonors怎麽用?Python Descriptors.NumHDonors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rdkit.Chem.Descriptors的用法示例。


在下文中一共展示了Descriptors.NumHDonors方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: evaluate

# 需要導入模塊: from rdkit.Chem import Descriptors [as 別名]
# 或者: from rdkit.Chem.Descriptors import NumHDonors [as 別名]
def evaluate(self, lst_in):
        """
        Evaluate structure alerts on a list of SMILES
        :param lst_in: input list of [SMILES, Name]
        :return: list of alerts matched or "OK"
        """
        smiles, name = lst_in
        mol = Chem.MolFromSmiles(smiles)
        if mol is None:
            return [smiles, name, 'INVALID', -999, -999, -999, -999, -999]
        desc_list = [MolWt(mol), MolLogP(mol), NumHDonors(mol), NumHAcceptors(mol), TPSA(mol),
                     CalcNumRotatableBonds(mol)]
        for row in self.rule_list:
            patt, max_val, desc = row
            if len(mol.GetSubstructMatches(patt)) > max_val:
                return [smiles, name] + [desc + " > %d" % (max_val)] + desc_list
        return [smiles, name] + ["OK"] + desc_list 
開發者ID:PatWalters,項目名稱:rd_filters,代碼行數:19,代碼來源:rd_filters.py

示例2: get_descriptors

# 需要導入模塊: from rdkit.Chem import Descriptors [as 別名]
# 或者: from rdkit.Chem.Descriptors import NumHDonors [as 別名]
def get_descriptors(sml):
    try:
        m = Chem.MolFromSmiles(sml)
        descriptor_list = []
        descriptor_list.append(Descriptors.MolLogP(m))
        descriptor_list.append(Descriptors.MolMR(m)) #ok
        descriptor_list.append(Descriptors.BalabanJ(m))
        descriptor_list.append(Descriptors.NumHAcceptors(m)) #ok
        descriptor_list.append(Descriptors.NumHDonors(m)) #ok
        descriptor_list.append(Descriptors.NumValenceElectrons(m))
        descriptor_list.append(Descriptors.TPSA(m)) # nice
        return descriptor_list
    except:
        return [np.float("nan")] * 7 
開發者ID:jrwnter,項目名稱:cddd,代碼行數:16,代碼來源:preprocessing.py

示例3: create_feature_df

# 需要導入模塊: from rdkit.Chem import Descriptors [as 別名]
# 或者: from rdkit.Chem.Descriptors import NumHDonors [as 別名]
def create_feature_df(smiles_df):
    temp = list(zip(*smiles_df['canonical_smiles'].map(get_descriptors)))
    columns = ["MolLogP", "MolMR", "BalabanJ", "NumHAcceptors", "NumHDonors", "NumValenceElectrons", "TPSA"]
    df = pd.DataFrame(columns=columns)
    for i, c in enumerate(columns):
        df.loc[:, c] = temp[i]
    df = (df - df.mean(axis=0, numeric_only=True)) / df.std(axis=0, numeric_only=True)
    df = smiles_df.join(df)
    return df 
開發者ID:jrwnter,項目名稱:cddd,代碼行數:11,代碼來源:preprocessing.py

示例4: num_H_donors

# 需要導入模塊: from rdkit.Chem import Descriptors [as 別名]
# 或者: from rdkit.Chem.Descriptors import NumHDonors [as 別名]
def num_H_donors(mol: Mol) -> int:
    return Descriptors.NumHDonors(mol) 
開發者ID:BenevolentAI,項目名稱:guacamol,代碼行數:4,代碼來源:descriptors.py

示例5: properties

# 需要導入模塊: from rdkit.Chem import Descriptors [as 別名]
# 或者: from rdkit.Chem.Descriptors import NumHDonors [as 別名]
def properties(mol):
    """
    Calculates the properties that are required to calculate the QED descriptor.
    """
    matches = []
    if mol is None:
        raise WrongArgument("properties(mol)", "mol argument is \'None\'")
    x = [0] * 9
    # MW
    x[0] = Descriptors.MolWt(mol)
    # ALOGP
    x[1] = Descriptors.MolLogP(mol)
    for hba in Acceptors:                                                        # HBA
        if mol.HasSubstructMatch(hba):
            matches = mol.GetSubstructMatches(hba)
            x[2] += len(matches)
    x[3] = Descriptors.NumHDonors(
        mol)                                            # HBD
    # PSA
    x[4] = Descriptors.TPSA(mol)
    x[5] = Descriptors.NumRotatableBonds(
        mol)                                    # ROTB
    x[6] = Chem.GetSSSR(Chem.DeleteSubstructs(
        deepcopy(mol), AliphaticRings))    # AROM
    for alert in StructuralAlerts:                                                # ALERTS
        if (mol.HasSubstructMatch(alert)):
            x[7] += 1
    ro5_failed = 0
    if x[3] > 5:
        ro5_failed += 1  # HBD
    if x[2] > 10:
        ro5_failed += 1  # HBA
    if x[0] >= 500:
        ro5_failed += 1
    if x[1] > 5:
        ro5_failed += 1
    x[8] = ro5_failed
    return x 
開發者ID:gablg1,項目名稱:ORGAN,代碼行數:40,代碼來源:mol_metrics.py


注:本文中的rdkit.Chem.Descriptors.NumHDonors方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。