nn4dms开源程序是用于深度突变扫描数据的神经网络
一、软件介绍
文末提供程序和源码下载
nn4dms开源程序是用于深度突变扫描数据的神经网络
我们在五个深度突变扫描数据集上训练和评估了多种类型的神经网络的性能。此存储库包含允许您执行以下作的代码和示例:
- Retrain the models from our publication
重新训练我们出版物中的模型 - Train new models using our datasets or your own datasets
使用我们的数据集或您自己的数据集训练新模型 - Use trained models to make predictions for new variants
使用经过训练的模型对新变体进行预测
二、Setup 设置
This code is based on Python 3.6 and TensorFlow 1.14. Use the provided environment.yml file to set up a suitable environment with Anaconda.
此代码基于 Python 3.6 和 TensorFlow 1.14。使用提供的 environment.yml 文件为 Anaconda 设置合适的环境。
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>conda env create -f environment.yml
conda activate nn4dms
</code></span></span></span></span>
Installation typically takes approximatley 5 minutes. Note these software versions differ slightly from the ones we used to train the models in our publication.
安装通常需要大约 5 分钟。请注意,这些软件版本与我们在本出版物中用于训练模型的版本略有不同。
GPU support (optional) GPU 支持(可选)
By default, the environment uses CPU-only TensorFlow. If you have an NVIDIA GPU and want GPU support, use the environment_gpu.yml file instead. It will install tensorflow-gpu
instead of tensorflow
. You will need to make sure you have the appropriate CUDA drivers and software installed for TensorFlow 1.14: cudnn 7.4 and cudatoolkit 10.0. Certain versions of this NVIDIA software may also be available for your operating system via Anaconda. The GPU environment is not compatible with NVIDIA Ampere or newer microarchitectures.
默认情况下,该环境使用仅限 CPU 的 TensorFlow。如果您有 NVIDIA GPU 并希望获得 GPU 支持,请改用 environment_gpu.yml 文件。它将安装 tensorflow-gpu
,而不是 tensorflow
。您需要确保为 TensorFlow 1.14 安装了合适的 CUDA 驱动程序和软件: cudnn 7.4 和 cudatoolkit 10.0。此 NVIDIA 软件的某些版本也可能通过 Anaconda 可用于您的作系统。GPU 环境与 NVIDIA Ampere 或更新的微架构不兼容。
Enrich2 (optional) Enrich2(可选)
We used Enrich2 to compute functional scores for the GB1 and Bgl3 datsets. If you want to re-run that part of our pipeline, you must install Enrich2 according to the instructions on the Enrich2 GitHub page. Make sure the conda environment for Enrich2 is named "enrich2". This is optional; we provide pre-computed datasets in the data directory.
我们使用 Enrich2 来计算 GB1 和 Bgl3 数据集的功能分数。如果您想重新运行我们管道的该部分,则必须按照 Enrich2 GitHub 页面上的说明安装 Enrich2。确保 Enrich2 的 conda 环境命名为“enrich2”。这是可选的;我们在 data 目录中提供了预计算的数据集。
三、Training a model 训练模型
您可以通过调用 code/regression.py 来训练模型,并使用指定数据集、网络架构、训练-测试拆分等的所需参数。为方便起见,除了命令行参数之外,regression.py 还接受 arguments 文本文件。我们提供了一个示例参数文件,您可以将其用作模板。
Call the following from the root directory to train a sample linear regression model on the avGFP dataset:
从根目录调用以下内容,以在 avGFP 数据集上训练示例线性回归模型:
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>python code/regression.py @regression_args/example.txt
</code></span></span></span></span>
The output, which includes the trained model, evaluation metrics, and predictions on each of the train/tune/tests sets, will automatically be placed in the training_logs directory. The linear regression example above trains in less than 5 minutes. Training time will be longer for larger datasets and more complex models.
输出(包括经过训练的模型、评估指标和对每个 train/tune/tests 集的预测)将自动放置在 training_logs 目录中。上面的线性回归示例在不到 5 分钟的时间内完成训练。对于较大的数据集和更复杂的模型,训练时间会更长。
For a full list of parameters, call python code/regression.py -h
.
有关参数的完整列表,请调用 python code/regression.py -h
。
Additional customization:
其他自定义:
- To define your own custom network architecture, see the readme in the network_specs directory.
要定义您自己的自定义网络架构,请参阅 network_specs 目录中的自述文件。 - For more control over the train-test split, see the train_test_split.ipynb notebook.
有关对 train-test 拆分的更多控制,请参阅 train_test_split.ipynb 笔记本。 - To compute your own protein structure graph for the graph convolutional network, see the structure_graph.ipynb notebook.
要为图形卷积网络计算您自己的蛋白质结构图,请参阅 structure_graph.ipynb 笔记本。 - To use your own dataset, see the readme in the data directory.
要使用您自己的数据集,请参阅 data 目录中的自述文件。
四、Evaluating a model and making new predictions
评估模型并进行新的预测
在训练期间,regression.py 会将各种有用的信息保存到日志目录中,包括对所有 train、tune 和测试集变体以及训练模型本身的预测。
五、软件下载
迅雷云盘
本文信息来源于GitHub作者地址:https://github.com/gitter-lab/nn4dms