基于ADME的分子过滤和 lead-likeness标准

news2025/2/26 22:29:48

T002 · 基于ADME的分子过滤和 lead-likeness标准

项目来源于TeachOpenCADD

本文目标

在药物设计的背景下,重要的是通过例如它们的物理化学性质来过滤候选分子。

在这个教程中,从 ChEMBL ( Talktorial T001 )获得的化合物将按照 Lipinsik 的五法则进行过滤,以仅保留口服生物可利用的化合物。

理论内容

  • ADME - 吸收、分布、代谢和排泄
  • Lead-likeness 和 Lipinski 的五法则 (Ro5)
  • Lead-likeness背景下的雷达图

实践内容

  • 定义和可视化示例分子
  • 计算并绘制 Ro5 的分子特性
  • 调查是否符合 Ro5
  • 将 Ro5 应用于 EGFR 数据集
  • 可视化 Ro5 属性(雷达图)

理论

在虚拟筛选中,我们的目标是预测化合物是否可能与特定目标结合并相互作用。然而,如果我们想要鉴定一种新药,同样重要的是该化合物能够到达目标并最终以有利的方式从体内清除。因此,我们还应该考虑一种化合物是否真的被吸收到体内,以及它是否能够跨越某些障碍以达到其目标。它的代谢是否稳定?一旦不再作用于目标,它将如何排泄?这些过程在药代动力学领域进行了研究。与药效学( “药物对我们的身体有什么作用?” )相反,药代动力学处理的问题是“药物在我们体内发生了什么?” .

ADME - 吸收、分布、代谢和排泄

药代动力学主要分为四个步骤:吸收、分布、代谢和排泄。这些总结为 ADME。通常,ADME 还包括毒理学,因此被称为 ADMET 或 ADMETox。下面更详细地讨论了 ADME 步骤。

  • 吸收:药物吸收到体内的量和时间取决于多种因素,这些因素可能因人而异,他们的条件以及物质的特性。化合物溶解度(差)、胃排空时间、肠道转运时间、胃内的化学(不)稳定性和(不)渗透肠壁的能力等因素都会影响药物在给药后的吸收程度例如口服、吸入或接触皮肤。
  • 分布:吸收物质的分布,即在体内、血液和不同组织之间,以及穿过血脑屏障,受区域血流速率、化合物的分子大小和极性以及与血清蛋白和转运体结合的影响酵素。毒理学中的关键影响可能是脂肪组织中高度非极性物质的积累,或穿过血脑屏障。
  • 代谢:化合物进入体内后会被代谢。这意味着该化合物中只有一部分会真正达到其目标。主要是肝脏和肾脏酶负责分解异生素(身体外在的物质)。
  • 排泄:化合物及其代谢物需要通过排泄从体内清除,通常是通过肾脏(尿液)或粪便。不完全排泄会导致外来物质的积累或对正常代谢的不利干扰。

ADME processes in the human body

Figure 1: ADME processes in the human body (figure taken from Openclipart and adapted).

Lead-likeness 和 Lipinski 的五法则 (Ro5)

先导化合物是具有前景的开发候选药物。它们被用作起始结构并进行修饰以开发有效的药物。除了生物活性(化合物与感兴趣的靶标结合)之外,有利的 ADME 特性也是设计高效药物的重要标准。

化合物的生物利用度是一个重要的 ADME 特性。Lipinski 的五规则 (Ro5, Adv. Drug Deliv. Rev. (1997), 23, 3-25 ) 被引入以仅基于化合物的化学结构来估计化合物的生物利用度。Ro5 指出,如果化学结构违反以下规则中的一项以上,则化合物吸收或渗透不良的可能性更大:

  • 分子量 (MWT) <= 500 Da
  • 氢键受体 (HBA) 的数量 <= 10
  • 氢键供体 (HBD) 的数量 <= 5
  • 计算的 LogP(辛醇-水系数)<= 5

注:Ro5中所有数字均为五的倍数;这就是规则名称的由来。

补充说明:

  • LogP也称为分配系数或辛醇-水系数。它测量化合物的分布,通常在疏水相(例如 1-辛醇)和亲水相(例如水)之间。

  • 疏水性分子在水中的溶解度可能会降低,而亲水性更强的分子(例如大量的氢键受体和供体)或大分子(高分子量)可能更难通过磷脂膜。

lead-likeness背景下的雷达图

分子特性,例如 Ro5 特性,可以通过多种方式可视化(例如克雷格图、花图或金三角)以支持药物化学家的解释(Drug. Discov. Today (2011), 16(1-2 ) , 65-72).

由于它们的外观,雷达图有时也被称为“蜘蛛”或“蜘蛛网”图。它们以 360 度环状排列,每个条件都有一个轴,从中心开始。每个参数的值绘制在轴上并用一条线连接。阴影区域可以表示参数满足条件的区域。

Radar plot for physicochemical properties

Figure 2: Radar plot displaying physico-chemical properties of a compound dataset

实践

from pathlib import Path
import math

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import matplotlib.patches as mpatches
from rdkit import Chem
from rdkit.Chem import Descriptors, Draw, PandasTools
# Set path to this notebook
HERE = Path(_dh[-1])
DATA = HERE / "data"

定义和可视化示例分子

在处理从 ChEMBL 检索到的整个数据集之前,我们选择了四种示例化合物来研究它们的化学性质。

我们从他们的 SMILES 中抽取了四个示例分子。

smiles = [
    "CCC1C(=O)N(CC(=O)N(C(C(=O)NC(C(=O)N(C(C(=O)NC(C(=O)NC(C(=O)N(C(C(=O)N(C(C(=O)N(C(C(=O)N(C(C(=O)N1)C(C(C)CC=CC)O)C)C(C)C)C)CC(C)C)C)CC(C)C)C)C)C)CC(C)C)C)C(C)C)CC(C)C)C)C",
    "CN1CCN(CC1)C2=C3C=CC=CC3=NC4=C(N2)C=C(C=C4)C",
    "CC1=C(C(CCC1)(C)C)C=CC(=CC=CC(=CC=CC=C(C)C=CC=C(C)C=CC2=C(CCCC2(C)C)C)C)C",
    "CCCCCC1=CC(=C(C(=C1)O)C2C=C(CCC2C(=C)C)C)O",
]
names = ["cyclosporine", "clozapine", "beta-carotene", "cannabidiol"]

首先,我们将分子的名称和 SMILES 及其结构组合在一个 DataFrame 中。

molecules = pd.DataFrame({"name": names, "smiles": smiles})
PandasTools.AddMoleculeColumnToFrame(molecules, "smiles")
molecules
namesmilesROMol
0cyclosporineCCC1C(=O)N(CC(=O)N(C(C(=O)NC(C(=O)N(C(C(=O)NC(...
Mol
1clozapineCN1CCN(CC1)C2=C3C=CC=CC3=NC4=C(N2)C=C(C=C4)C
Mol
2beta-caroteneCC1=C(C(CCC1)(C)C)C=CC(=CC=CC(=CC=CC=C(C)C=CC=...
Mol
3cannabidiolCCCCCC1=CC(=C(C(=C1)O)C2C=C(CCC2C(=C)C)C)O
Mol

计算并绘制 Ro5 的分子特性¶

  1. 使用rdkit描述符descriptors计算分子量、氢键受体和供体的数量以及 logP 。
molecules["molecular_weight"] = molecules["ROMol"].apply(Descriptors.ExactMolWt)
molecules["n_hba"] = molecules["ROMol"].apply(Descriptors.NumHAcceptors)
molecules["n_hbd"] = molecules["ROMol"].apply(Descriptors.NumHDonors)
molecules["logp"] = molecules["ROMol"].apply(Descriptors.MolLogP)

# Colors are used for plotting the molecules later
molecules["color"] = ["red", "green", "blue", "cyan"]
# NBVAL_CHECK_OUTPUT
molecules[["molecular_weight", "n_hba", "n_hbd", "logp"]]
molecular_weightn_hban_hbdlogp
01201.8413681253.26900
1306.184447411.68492
2536.4382020012.60580
3314.224580225.84650
# Full preview
molecules
namesmilesROMolmolecular_weightn_hban_hbdlogpcolor
0cyclosporineCCC1C(=O)N(CC(=O)N(C(C(=O)NC(C(=O)N(C(C(=O)NC(...
Mol
1201.8413681253.26900red
1clozapineCN1CCN(CC1)C2=C3C=CC=CC3=NC4=C(N2)C=C(C=C4)C
Mol
306.184447411.68492green
2beta-caroteneCC1=C(C(CCC1)(C)C)C=CC(=CC=CC(=CC=CC=C(C)C=CC=...
Mol
536.4382020012.60580blue
3cannabidiolCCCCCC1=CC(=C(C(=C1)O)C2C=C(CCC2C(=C)C)C)O
Mol
314.224580225.84650cyan
  1. 将分子特性绘制为条形图。
ro5_properties = {
    "molecular_weight": (500, "molecular weight (Da)"),
    "n_hba": (10, "# HBA"),
    "n_hbd": (5, "# HBD"),
    "logp": (5, "logP"),
}
# Start 1x4 plot frame
fig, axes = plt.subplots(figsize=(10, 2.5), nrows=1, ncols=4)
x = np.arange(1, len(molecules) + 1)
colors = ["red", "green", "blue", "cyan"]

# Create subplots
for index, (key, (threshold, title)) in enumerate(ro5_properties.items()):
    axes[index].bar([1, 2, 3, 4], molecules[key], color=colors)
    axes[index].axhline(y=threshold, color="black", linestyle="dashed")
    axes[index].set_title(title)
    axes[index].set_xticks([])

# Add legend
legend_elements = [
    mpatches.Patch(color=row["color"], label=row["name"]) for index, row in molecules.iterrows()
]
legend_elements.append(Line2D([0], [0], color="black", ls="dashed", label="Threshold"))
fig.legend(handles=legend_elements, bbox_to_anchor=(1.2, 0.8))

# Fit subplots and legend into figure
plt.tight_layout()
plt.show()

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-EJnxiOra-1686104448503)(null)]

在条形图中,我们比较了四个具有不同属性的示例分子的 Ro5 属性。在接下来的步骤中,我们将调查每种化合物是否违反 Ro5。

调查是否符合Ro5

def calculate_ro5_properties(smiles):
    """
    Test if input molecule (SMILES) fulfills Lipinski's rule of five.

    Parameters
    ----------
    smiles : str
        SMILES for a molecule.

    Returns
    -------
    pandas.Series
        Molecular weight, number of hydrogen bond acceptors/donor and logP value
        and Lipinski's rule of five compliance for input molecule.
    """
    # RDKit molecule from SMILES
    molecule = Chem.MolFromSmiles(smiles)
    # Calculate Ro5-relevant chemical properties
    molecular_weight = Descriptors.ExactMolWt(molecule)
    n_hba = Descriptors.NumHAcceptors(molecule)
    n_hbd = Descriptors.NumHDonors(molecule)
    logp = Descriptors.MolLogP(molecule)
    # Check if Ro5 conditions fulfilled
    conditions = [molecular_weight <= 500, n_hba <= 10, n_hbd <= 5, logp <= 5]
    ro5_fulfilled = sum(conditions) >= 3
    # Return True if no more than one out of four conditions is violated
    return pd.Series(
        [molecular_weight, n_hba, n_hbd, logp, ro5_fulfilled],
        index=["molecular_weight", "n_hba", "n_hbd", "logp", "ro5_fulfilled"],
    )
# NBVAL_CHECK_OUTPUT
for name, smiles in zip(molecules["name"], molecules["smiles"]):
    print(f"Ro5 fulfilled for {name}: {calculate_ro5_properties(smiles)['ro5_fulfilled']}")
Ro5 fulfilled for cyclosporine: False
Ro5 fulfilled for clozapine: True
Ro5 fulfilled for beta-carotene: False
Ro5 fulfilled for cannabidiol: True

根据 Ro5,估计环孢菌素cyclosporin和β-胡萝卜素beta-carotene的生物利用度较差。
然而,由于它们都是批准的药物,它们是 Ro5 如何用作警报但不一定用作过滤器的好例子。

将 Ro5 应用于 EGFR 数据集

该calculate_ro5_properties函数可应用于符合 Ro5 标准的化合物的 EGFR 数据集。

molecules = pd.read_csv(HERE / "../T001_query_chembl/data/EGFR_compounds.csv", index_col=0)
print(molecules.shape)
molecules.head()
(5568, 5)
molecule_chembl_idIC50unitssmilespIC50
0CHEMBL637860.003nMBrc1cccc(Nc2ncnc3cc4ccccc4cc23)c111.522879
1CHEMBL358200.006nMCCOc1cc2ncnc(Nc3cccc(Br)c3)c2cc1OCC11.221849
2CHEMBL537110.006nMCN(C)c1cc2c(Nc3cccc(Br)c3)ncnc2cn111.221849
3CHEMBL660310.008nMBrc1cccc(Nc2ncnc3cc4[nH]cnc4cc23)c111.096910
4CHEMBL537530.008nMCNc1cc2c(Nc3cccc(Br)c3)ncnc2cn111.096910

Apply the Ro5 to all molecules.

# This takes a couple of seconds
ro5_properties = molecules["smiles"].apply(calculate_ro5_properties)
ro5_properties.head()
molecular_weightn_hban_hbdlogpro5_fulfilled
0349.021459315.2891True
1387.058239514.9333True
2343.043258513.5969True
3339.011957424.0122True
4329.027607523.5726True

Concatenate molecules with Ro5 data.

molecules = pd.concat([molecules, ro5_properties], axis=1)
molecules.head()
molecule_chembl_idIC50unitssmilespIC50molecular_weightn_hban_hbdlogpro5_fulfilled
0CHEMBL637860.003nMBrc1cccc(Nc2ncnc3cc4ccccc4cc23)c111.522879349.021459315.2891True
1CHEMBL358200.006nMCCOc1cc2ncnc(Nc3cccc(Br)c3)c2cc1OCC11.221849387.058239514.9333True
2CHEMBL537110.006nMCN(C)c1cc2c(Nc3cccc(Br)c3)ncnc2cn111.221849343.043258513.5969True
3CHEMBL660310.008nMBrc1cccc(Nc2ncnc3cc4[nH]cnc4cc23)c111.096910339.011957424.0122True
4CHEMBL537530.008nMCNc1cc2c(Nc3cccc(Br)c3)ncnc2cn111.096910329.027607523.5726True
# Note that the column "ro5_fulfilled" contains boolean values.
# Thus, we can use the column values directly to subset data.
# Note that ~ negates boolean values.
molecules_ro5_fulfilled = molecules[molecules["ro5_fulfilled"]]
molecules_ro5_violated = molecules[~molecules["ro5_fulfilled"]]

print(f"# compounds in unfiltered data set: {molecules.shape[0]}")
print(f"# compounds in filtered data set: {molecules_ro5_fulfilled.shape[0]}")
print(f"# compounds not compliant with the Ro5: {molecules_ro5_violated.shape[0]}")
# NBVAL_CHECK_OUTPUT
# compounds in unfiltered data set: 5568
# compounds in filtered data set: 4635
# compounds not compliant with the Ro5: 933
# Save filtered data
molecules_ro5_fulfilled.to_csv(DATA / "EGFR_compounds_lipinski.csv")
molecules_ro5_fulfilled.head()
molecule_chembl_idIC50unitssmilespIC50molecular_weightn_hban_hbdlogpro5_fulfilled
0CHEMBL637860.003nMBrc1cccc(Nc2ncnc3cc4ccccc4cc23)c111.522879349.021459315.2891True
1CHEMBL358200.006nMCCOc1cc2ncnc(Nc3cccc(Br)c3)c2cc1OCC11.221849387.058239514.9333True
2CHEMBL537110.006nMCN(C)c1cc2c(Nc3cccc(Br)c3)ncnc2cn111.221849343.043258513.5969True
3CHEMBL660310.008nMBrc1cccc(Nc2ncnc3cc4[nH]cnc4cc23)c111.096910339.011957424.0122True
4CHEMBL537530.008nMCNc1cc2c(Nc3cccc(Br)c3)ncnc2cn111.096910329.027607523.5726True

可视化 Ro5 属性(雷达图)

计算 Ro5 属性的统计数据

定义一个辅助函数来计算输入 DataFrame 的均值和标准差。

def calculate_mean_std(dataframe):
    """
    Calculate the mean and standard deviation of a dataset.

    Parameters
    ----------
    dataframe : pd.DataFrame
        Properties (columns) for a set of items (rows).

    Returns
    -------
    pd.DataFrame
        Mean and standard deviation (columns) for different properties (rows).
    """
    # Generate descriptive statistics for property columns
    stats = dataframe.describe()
    # Transpose DataFrame (statistical measures = columns)
    stats = stats.T
    # Select mean and standard deviation
    stats = stats[["mean", "std"]]
    return stats

计算满足 Ro5的化合物数据集的统计数据。

molecules_ro5_fulfilled_stats = calculate_mean_std(
    molecules_ro5_fulfilled[["molecular_weight", "n_hba", "n_hbd", "logp"]]
)
molecules_ro5_fulfilled_stats
# NBVAL_CHECK_OUTPUT
meanstd
molecular_weight414.43901187.985100
n_hba5.9965481.875491
n_hbd1.8899681.008368
logp4.0705681.193034

计算了 违反 Ro5 的化合物数据集的统计数据

molecules_ro5_violated_stats = calculate_mean_std(
    molecules_ro5_violated[["molecular_weight", "n_hba", "n_hbd", "logp"]]
)
molecules_ro5_violated_stats
meanstd
molecular_weight587.961963101.999229
n_hba7.9635582.373576
n_hbd2.3011791.719732
logp5.9734611.430636

定义辅助函数为雷达绘图准备数据

下面,我们将定义一些仅用于雷达绘图的辅助函数。

准备 y 值:用于 Ro5 标准的属性具有不同的大小。MWT 的阈值为 500,而 HBA 和 HBD 的数量以及 LogP 的阈值分别仅为 10、5 和 5。为了最简单地可视化这些不同的尺度,我们将把所有属性值缩放到5 的缩放阈值:

scaled property value = property value / property threshold * scaled property threshold

  • scaled MWT = MWT / 500 * 5 = MWT / 100
  • scaled HBA = HBA / 10 * 5 = HBA / 2
  • scaled HBD = HBD / 5 * 5 = HBD
  • scaled LogP = LogP / 5 * 5 = LogP

这导致 MWT 缩小 100,HBA 缩小 2,而 HBD 和 LogP 保持不变。

以下辅助函数执行此类缩放,稍后将在雷达绘图期间使用。

def _scale_by_thresholds(stats, thresholds, scaled_threshold):
    """
    Scale values for different properties that have each an individually defined threshold.

    Parameters
    ----------
    stats : pd.DataFrame
        Dataframe with "mean" and "std" (columns) for each physicochemical property (rows).
    thresholds : dict of str: int
        Thresholds defined for each property.
    scaled_threshold : int or float
        Scaled thresholds across all properties.

    Returns
    -------
    pd.DataFrame
        DataFrame with scaled means and standard deviations for each physiochemical property.
    """
    # Raise error if scaling keys and data_stats indicies are not matching
    for property_name in stats.index:
        if property_name not in thresholds.keys():
            raise KeyError(f"Add property '{property_name}' to scaling variable.")
    # Scale property data
    stats_scaled = stats.apply(lambda x: x / thresholds[x.name] * scaled_threshold, axis=1)
    return stats_scaled

Prepare x values:

以下辅助函数返回 雷达图的物理化学属性轴的角度。例如,如果我们想为 4 个属性生成雷达图,我们想将轴设置为 0°、90°、180° 和 270°。辅助函数返回弧度等角度。

def _define_radial_axes_angles(n_axes):
    """Define angles (radians) for radial (x-)axes depending on the number of axes."""
    x_angles = [i / float(n_axes) * 2 * math.pi for i in range(n_axes)]
    x_angles += x_angles[:1]
    return x_angles

Both functions will be used as helper functions in the radar plotting function, which is defined next.

生成雷达图!

现在,我们定义了一个函数,以雷达图的形式可视化化合物的化学性质。我们遵循了stackoverflow 上的这些说明。

def plot_radar(
    y,
    thresholds,
    scaled_threshold,
    properties_labels,
    y_max=None,
    output_path=None,
):
    """
    Plot a radar chart based on the mean and standard deviation of a data set's properties.

    Parameters
    ----------
    y : pd.DataFrame
        Dataframe with "mean" and "std" (columns) for each physicochemical property (rows).
    thresholds : dict of str: int
        Thresholds defined for each property.
    scaled_threshold : int or float
        Scaled thresholds across all properties.
    properties_labels : list of str
        List of property names to be used as labels in the plot.
    y_max : None or int or float
        Set maximum y value. If None, let matplotlib decide.
    output_path : None or pathlib.Path
        If not None, save plot to file.
    """

    # Define radial x-axes angles -- uses our helper function!
    x = _define_radial_axes_angles(len(y))
    # Scale y-axis values with respect to a defined threshold -- uses our helper function!
    y = _scale_by_thresholds(y, thresholds, scaled_threshold)
    # Since our chart will be circular we append the first value of each property to the end
    y = y.append(y.iloc[0])

    # Set figure and subplot axis
    plt.figure(figsize=(6, 6))
    ax = plt.subplot(111, polar=True)

    # Plot data
    ax.fill(x, [scaled_threshold] * 5, "cornflowerblue", alpha=0.2)
    ax.plot(x, y["mean"], "b", lw=3, ls="-")
    ax.plot(x, y["mean"] + y["std"], "orange", lw=2, ls="--")
    ax.plot(x, y["mean"] - y["std"], "orange", lw=2, ls="-.")

    # From here on, we only do plot cosmetics
    # Set 0° to 12 o'clock
    ax.set_theta_offset(math.pi / 2)
    # Set clockwise rotation
    ax.set_theta_direction(-1)

    # Set y-labels next to 180° radius axis
    ax.set_rlabel_position(180)
    # Set number of radial axes' ticks and remove labels
    plt.xticks(x, [])
    # Get maximal y-ticks value
    if not y_max:
        y_max = int(ax.get_yticks()[-1])
    # Set axes limits
    plt.ylim(0, y_max)
    # Set number and labels of y axis ticks
    plt.yticks(
        range(1, y_max),
        ["5" if i == scaled_threshold else "" for i in range(1, y_max)],
        fontsize=16,
    )

    # Draw ytick labels to make sure they fit properly
    # Note that we use [:1] to exclude the last element which equals the first element (not needed here)
    for i, (angle, label) in enumerate(zip(x[:-1], properties_labels)):
        if angle == 0:
            ha = "center"
        elif 0 < angle < math.pi:
            ha = "left"
        elif angle == math.pi:
            ha = "center"
        else:
            ha = "right"
        ax.text(
            x=angle,
            y=y_max + 1,
            s=label,
            size=16,
            horizontalalignment=ha,
            verticalalignment="center",
        )

    # Add legend relative to top-left plot
    labels = ("mean", "mean + std", "mean - std", "rule of five area")
    ax.legend(labels, loc=(1.1, 0.7), labelspacing=0.3, fontsize=16)

    # Save plot - use bbox_inches to include text boxes
    if output_path:
        plt.savefig(output_path, dpi=300, bbox_inches="tight", transparent=True)

    plt.show()

在下文中,我们要绘制两个数据集的雷达图:

  1. 满足 Ro5 的化合物
  2. 违反 Ro5 的化合物

定义两个雷达图应保持相同的输入参数

thresholds = {"molecular_weight": 500, "n_hba": 10, "n_hbd": 5, "logp": 5}
scaled_threshold = 5
properties_labels = [
    "Molecular weight (Da) / 100",
    "# HBA / 2",
    "# HBD",
    "LogP",
]
y_max = 8
  1. 绘制了满足 Ro5 的化合物数据集的雷达图。
plot_radar(
    molecules_ro5_fulfilled_stats,
    thresholds,
    scaled_threshold,
    properties_labels,
    y_max,
)

在这里插入图片描述

蓝色方块表示分子理化性质符合 Ro5 的区域。

蓝线突出显示平均值,而橙色虚线显示标准偏差。

我们可以看到,平均值从不违反任何 Lipinski 规则。但是,根据标准偏差,某些属性的值大于 Ro5 阈值。这是可以接受的,因为根据 Ro5,可以违反四项规则中的一项。

  1. 绘制了违反 Ro5 的化合物数据集的雷达图。 violate the Ro5.
plot_radar(
    molecules_ro5_violated_stats,
    thresholds,
    scaled_threshold,
    properties_labels,
    y_max,
)

我们看到化合物大多违反 Ro5,因为它们的 logP 值和分子量。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/618734.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Android AIDL Callback的使用(配源码)

零、示例说明 本示例&#xff0c;完成的功能是&#xff1a;客户端向服务端注册一个回调&#xff0c;服务端是一个商店shop&#xff0c;当商店里的产品 Product 有变化时&#xff0c;调用回调向通知客户端&#xff0c;什么商品更新了。 一、完整源代码 完整源码链接: https:/…

电脑丢失dll文件怎么一键修复?哪种dll修复方法靠谱?

在使用电脑时&#xff0c;我们经常会遇到一些问题&#xff0c;例如电脑丢失了某些dll文件。这些文件是电脑运行所必需的&#xff0c;如果缺少了这些文件&#xff0c;电脑就无法正常运行。在这种情况下&#xff0c;我们需要使用使用一些方法去进行相关的修复&#xff01;下面我们…

微信小程序原生开发功能合集十九:大屏适配、分栏代码可视化编辑、骨架屏生成及WebView使用介绍

本章实现小程序大屏适配实现、pc端分栏展示实现、代码可视化编辑、骨架屏生成及WebView组件使用介绍。   另外还提供小程序开发基础知识讲解课程,包括小程序开发基础知识、组件封装、常用接口组件使用及常用功能实现等内容,具体如下:    1. CSDN课程: https://edu.csd…

高精度气象模拟软件WRF:天气预报、观测气温、分析降水、模拟尺度气象、模拟水汽湿度、土地利用变化影响、土壤水分通量、分析风场、分析土壤水体植被等气象变量

查看原文>>>高精度气象模拟软件WRF(Weather Research Forecasting)技术及案例应用 气候是多个领域&#xff08;生态、水资源、风资源及碳中和等问题&#xff09;的主要驱动因素&#xff0c;合理认知气候变化有利于解释生态环境变化机理及过程&#xff0c;而了解现在、…

立刻杀掉Oracle中的会话(session)

一、需求描述 我们开发项目的过程中,涉及到连接oracle数据库的操作,正常来说我们执行完对应的sql语句后且关闭了连接,数据库的连接就会释放了;但是现实的情况是我们在查询数据库建立的会话时,发现存在大量的InAactive会话(我们需要找到原因,且将当前的会话立刻手动删除掉…

从零手写操作系统之RVOS任务同步和锁实现-07

从零手写操作系统之RVOS任务同步和锁实现-07 并发与同步临界区、锁、死锁自旋锁1.0 版本2.0 版本原子指令思路测试 3.0 版本测试 小结其他同步技术 本系列参考: 学习开发一个RISC-V上的操作系统 - 汪辰 - 2021春 整理而来&#xff0c;主要作为xv6操作系统学习的一个前置基础。 …

练习:程序切片

练习&#xff1a;程序切片 1 简介 注&#xff1a;问题3提到了conditioned slicing。 我们没有给出计算条件切片的算法&#xff0c;但你不应该要求这样的算法。 2 问题 1 对于以下每个代码片段&#xff0c;绘制程序依赖图&#xff08;没有定义顺序边&#xff09;。 基于这些&am…

什么是 Vue.js 中的 v-if 和 v-show 指令?

什么是 Vue.js 中的 v-if 和 v-show 指令&#xff1f; Vue.js 是一种用于构建交互式用户界面的渐进式框架。它采用了响应式的数据绑定机制和组件化的开发模式&#xff0c;让开发者能够更加高效地构建复杂的 Web 应用。在 Vue.js 中&#xff0c;v-if 和 v-show 是两个常用的指令…

STM32开发——电动车报警装置

1.项目简介 1.1项目需求 点击遥控器 A 按键&#xff0c;系统进入警戒模式&#xff0c;一旦检测到震动&#xff08;小偷偷车&#xff09;&#xff0c;则喇叭发出声响报警&#xff0c; 吓退小偷。 点击遥控器 B 按键&#xff0c;系统退出警戒模式&#xff0c;再怎么摇晃系统都不…

通过项目驱动的学习方法快速掌握Java编程

摘要 Java作为一种广泛应用于软件开发领域的编程语言&#xff0c;对于零基础的学习者来说&#xff0c;学习Java编程可能存在一定的难度。本文将介绍如何通过项目驱动的学习方法&#xff0c;帮助零起点的学习者快速掌握Java编程。通过以项目为核心的学习路径、结合实践和理论的…

【Pytorch】自定义模型、自定义损失函数及模型删除修改层的常用操作

目录 问题一&#xff1a;更改模型最后一层&#xff0c;删除最后一层问题二&#xff1a;自定义模型及参数冻结问题三&#xff1a;自定义损失函数及广播机制 问题1&#xff1a;更改模型最后一层&#xff0c;删除最后一层&#xff0c;添加层。 改变模型最后一层 # Load the mo…

Jmter自动化

一、接口测试流程 1、拿到api接口文档&#xff0c;熟悉接口业务。 2、编写测试用例。 正例&#xff1a;正常参数&#xff0c;是否接口正常 反例&#xff1a;鉴权异常情况、参数异常、兼容性、黑名单、调用次数异常 3、使用接口测试用具&#xff08;Jmeter&#xff09; 4、…

chatgpt赋能python:Python安装gym:入门指南

Python安装gym: 入门指南 如果您是一位正在学习强化学习的学生&#xff0c;或者是一位研究者、开发人员&#xff0c;那么您一定会对OpenAI出品的gym库感兴趣。该库为编写和比较强化学习算法提供了一组标准环境。但是&#xff0c;在使用gym之前&#xff0c;您需要将其安装到您的…

ThinkPad无法进系统的解决方案(实测)

ThinkPad无法进系统如何解决&#xff1f; 不一样的笔记本进到BIOS的方法是不太一样的&#xff0c;下面就和大伙儿具体解读电脑上进到thinkpad的bios设置启动项的方法吧。 在开机或重启的Lenovo画面自检处&#xff0c;快速、连续多次按键盘的“F1”按键&#xff0c;即可进入BI…

基于html+css的图展示112

准备项目 项目开发工具 Visual Studio Code 1.44.2 版本: 1.44.2 提交: ff915844119ce9485abfe8aa9076ec76b5300ddd 日期: 2020-04-16T16:36:23.138Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.19044 项目…

PHP实现文件上传

上传文件的必备三个条件&#xff1a; 1、上传到后台的文件 2、method "post";&#xff08;不可以为get方法&#xff09; 3、enctype "multipart/form-data";&#xff08;注意哦&#xff0c;是data&#xff0c;不是date&#xff09; 三者缺一不可 后台…

抛弃传统网络?SDN协议、标准、接口对比分析!

概要&#xff1a; 随着网络规模的不断扩大和复杂性的增加&#xff0c;传统的网络架构已经难以满足日益增长的网络需求。SDN&#xff08;Software Defined Networking&#xff09;技术的出现&#xff0c;为网络的管理和控制带来了革命性的变化。SDN的核心思想是将网络的控制和管…

chatgpt赋能python:Python如何访问文件

Python如何访问文件 Python是一种优秀的编程语言&#xff0c;被广泛应用于各种领域&#xff0c;包括文件处理。在Python中&#xff0c;我们可以使用内置的文件处理功能访问文件。 什么是文件&#xff1f; 文件是计算机系统中的一种数据存储形式。它们可以包含任何类型的信息…

u盘视频丢失怎么找回?居然还得靠它

u盘视频丢失怎么找回&#xff1f;U盘作为一款常用的存储数据的工具&#xff0c;因为其自身的小巧便携&#xff0c;方便我们随身携带&#xff0c;深受广大用户的喜爱。在使用U盘的过程中&#xff0c;我们也会遇到一些文件丢失的麻烦&#xff0c;比如误删除里面的视频文件。当遇到…

浅谈 Tarjan 算法

在了解 Tarjan 算法之前&#xff0c;我们先来了解 dfs 搜索树。 1 dfs 生成树 定义&#xff1a; dfs 遍历整张图&#xff0c;按照 dfs 序构成一棵树。 1.1 有向图的 dfs 生成树 有向图的 dfs 生成树包括四种边&#xff1a; 树边&#xff08;tree edge&#xff09;&#xff…