| elastic_net.options: ElasticNetPerturbationOptions | 基于弹性网络线性调控网络的虚拟扰动参数。 |
| linear_grn: GeneRegulatoryNetwork | 基于线性拟合的基因表达调控网络推断 对于表达矩阵之中的每一个基因
其中 |
| log2cpm | 把原始 counts 矩阵变换成 逐样本按总计数归一化到 scale(默认 1e6,即 CPM), 再取 |
| top_variable_genes | 按 MAD(中位数绝对偏差)降序挑选变异最大的若干个基因。 用于扩充候选调控因子池: 使用 MAD 而不是标准差,是因为 MAD 对离群样本(双细胞、线粒体爆表)不敏感, 不会像 SD 那样把少数极端样本的基因顶到榜首。 |
| normalize_log_matrix | 去掉样本级的全局表达程序(每个样本减去跨基因均值)。 对样本 s: 横截面共表达数据里,所有基因都被同一个"全局程序"绑定(细胞状态、线粒体含量、 测序质量等),导致任意两个基因的相关系数都被抬高、且几乎全为正。把这个样本级 常数移除之后,剩下的相关更接近"特异性共表达",负相关才会出现: 这一步直接改善敲降之后"全部基因一起下调、极少上调"的现象。 把一个已经在对数空间的表达矩阵重新标定到指定的文库规模(默认 CPM,1e6)。 输入矩阵假定是
这一步不改变基因之间的相对丰度,只改变数值尺度。它解决的问题是: 低深度数据(例如每细胞只有几千个 UMI)上 |
| remove_global_factor | |
| remove_principal_components | 去掉表达矩阵的前若干个主成分(比"减去跨基因均值"更强的去全局因子)。 做法:在基因抽样的子矩阵上用块幂迭代求出前 components 个 右奇异向量(样本空间的全局方向),然后把每个基因的表达向量投影到这些方向上 并减掉。等于把"细胞组成 / 测序质量 / 全局调控程序"这类共同因子从数据里移除。 与只减跨基因均值相比,这一步能真正削弱残留的全局共表达, 从而让网络里出现更多负相关(抑制型)的边。 |
| elastic_net | Fit a linear (elastic net) gene regulatory network from the expression matrix. |
| coef | Export the coefficient matrix of the fitted network. |
| elastic_formulas | |
| elastic_model | Build the in silico perturbation engine from a fitted linear GRN model. |
| gene_names | Get the gene ids of the fitted network, in the row order of the expression matrix. |
| wildtype_means | Get the currently effective wildtype (baseline) expression vector of the model. |
| set_log_offset | 设置模型空间的整体对数偏移量(去全局因子之后的 context 需要)。 拟合矩阵做过"逐样本减去跨基因均值"之后,模型空间是 |
| library_sizes | Get the implied library size of every training sample of the fitted network. |
| set_baseline | Set the wildtype baseline (the cell context) of the perturbation engine. |
| intervene | Run one in silico perturbation experiment and return the raw result object. |
| profiles_matrix | Run the perturbation experiment for a set of genes and collect the profiles into a matrix. |
| export_profiles | Run the perturbation experiment for a set of genes and save the profiles as a csv file. |