/images/avatar.png

Xiaopeng Xu, Ph.D.

Research Scientist @ KAUST · Agentic AI for scientific discovery, protein design & synthetic biology

Recent News

Recent Notes

药物设计笔记

导论

概述

创新药物发现—从基因到药物

https://xux-zotero-img.oss-cn-beijing.aliyuncs.com/img/20260613031127380.png

药物 R&D

https://xux-zotero-img.oss-cn-beijing.aliyuncs.com/img/20260613031130004.png

药物设计 3W

  • Why?

    • Unmet medical needs

    • Time-scale

    • Success rate

  • What?

    • Disease mechanism-Target identification & validation

    • Lead generation

    • Lead optimization

  • How?

    • Drug Design –The application of CADD in drug design

    • Bioinformatics, proteomics, Combi Chem/HTS

    • Target-drug interaction mode

    • Early ADME/T evaluation

药物设计内涵:药物研究模式的转变

https://xux-zotero-img.oss-cn-beijing.aliyuncs.com/img/20260613031132901.png Lee JA, Berg EL. J Biomol Screen. 2013 Dec;18(10):1143-55

SMILES 化学表示

参考:

简介

SMILES,全称是 Simplified Molecular Input Line Entry System,是一种用于输入和表示分子反应的线性符号。

示例

下面看一些例子:

Metrics 评估指标

https://xux-zotero-img.oss-cn-beijing.aliyuncs.com/img/20260612235711658.png

准确性 Accuracy

Acc. = (TP + TN)/(TP + FP + TN + FN)

精确性 Precision or Positive Predictive Value (PPV)

PPV = TP / (TP + FP)

召回率/敏感性 Sensitivity, Recall, or True Positive Rate (TPR)

TPR = TP / (TP + FN)

特异性/选择性 Specificity, Selectivity, or True Negative Rate (TNR)

TNR = TN / (TN + FP)

Negative Predictive Value (NPV)

NPV = TN / (TN + FN)

Python 常用命令

Pandas 列过滤

用某列对 dataframe 做过滤

papers_dates[(papers_dates.preprint_test == True) & ~ papers_dates.acptDate.isna()]
# 两列做 or 运算
df_all_norm[(df_all_norm["CO2"] > 0.8) | (df_all_norm["CO"] > 0.8)]

用日期列对 dataframe 做过滤

papers_age[papers_age.pubDate >= "2028-03-01"]

用日期间隔列对 dataframe 做过滤

papers_dates[papers_dates.preprint_age > pd.Timedelta(30,'D')]

去除空列

df.dropna(subset=['name', 'toy'])

Pandas Dataframe 合并

同长 dataframe 合并

pd.concat([papers, CSCoV_scores], axis=1)

两个 dataframe 做 left outer join

papers_redup.merge(all_rxiv_redup[['subDate', 'title']], left_on='title', right_on='title',how='left')

Pandas 数据替换

值替换

df.replace([0, 1, 2, 3], [4, 3, 2, 1])

Pandas 数据查看/分析

展示长 string

pd.set_option('display.max_colwidth', None)

查看 string 是否在某个 string list 中

X_lxd[X_lxd.title.isin(selected)][['title', 'pub_prob']]

查看日期列数据分布

papers_dates[['subDate', 'acptDate', 'pubDate']].describe(datetime_is_numeric=True)

按某列倒序排列

X_lxd.sort_values(by='pub_prob', ascending=False)

Numpy 向量计算

标量和向量的加减乘除

x = np.random.rand(3,1)
1 + x # element-wise operation
1 - x
1 * x
1 / x

初始化向量或者矩阵 np.zeros, np.ones

x = np.zeros((10, 1))
x = np.ones((10, 1))

Mean, std,max,min,median

x = np.random.rand(3,1)
x.mean()
x.std()
x.max()
x.min()
np.median(x)

两个向量各对应元素求最大值

x = np.random.rand(3,1)
y = np.random.rand(3,1)
np.maximum(x, y) # also np.maximum(x, 0) broadcast by default
# Out: array([[0.88240057], [0.38776741], [0.72610557]])

向量和向量的运算 *, /, dot

x = np.random.rand(3,1)
y = np.random.rand(3,1)
x * y # element-wise multiplication, return vector (3,1), or np.multiply()
np.transpose(x).dot(y) # return scalar
x / y # element-wise division, return vector (3,1)

向量绝对值 absolute

np.absolute(np.random.rand(3, 22)-10)

Numpy 矩阵计算

矩阵重新设置大小 reshape

x = np.random.rand(3, 22)
x.shape   # (3, 2,2)
x.reshape(-1, 1) # a column vector, 1 f

# reshape a np.array of images
train_set_x_flatten = train_set_x_orig.reshape(train_set_x_orig.shape[0], -1).T

scipy 相关命令

truncnorm 分布区间矫准

将标准正态分布校准到区间 [a, b] 上