Skip to main content

Protein structure prediction with the DMPfold2 method

Project description

DMPfold2

Build status

DMPfold2 is a fast and accurate method for protein structure prediction. It uses learned representations of multiple sequence alignments and end-to-end model generation to quickly generate models from alignments.

If you use DMPfold2, please cite the paper: Ultrafast end-to-end protein structure prediction enables high-throughput exploration of uncharacterised proteins, S M Kandathil, J G Greener, A M Lau, D T Jones, bioRxiv (2021) - link.

Protein structures predicted from the BFD and Pfam are available via the UCL Research Data Repository (doi: 10.5522/04/14979990) - link.

Installation

DMPfold2 is easier to install than DMPfold1, which had many more dependencies.

  1. Python 3.6 or later is required.

  2. Install PyTorch (version 1.8.0) as appropriate for your system. A GPU is not required but gives some speedup to longer runs.

  3. Run pip install dmpfold, which adds the dmpfold executable to the path. The first time you run a prediction the trained model files (~140 MB) will be downloaded to the package directory, which requires an internet connection.

Usage

Run dmpfold -h to see a help message. To run DMPfold2 you will need a sequence alignment in aln format: one sequence per line with the ungapped target sequence as the first line (example here). Lines starting with > are ignored. Sequence alignments can be obtained from a target sequence in a number of ways, for example by running hhblits on the Uniclust database. DMPfold2 prints a PDB format file to stdout, including the confidence as a remark.

Default mode (10 iteration cycles + 100 steps geometry minimization on cpu device):

dmpfold -i input.aln > fold.pdb

Default mode on cuda device 0:

dmpfold -i input.aln -d cuda:0 > fold.pdb

Fastest mode (no iteration or refinement):

dmpfold -i input.aln -n 0 -m 0 > fold.pdb

30 iteration cycles + 200 steps geometry minimization:

dmpfold -i input.aln -n 30 -m 200 > fold.pdb

If you already have a model (only CA atoms are used) e.g. from HHsearch/MODELLER (30 iteration cycles + 200 minimization steps + template seed structure):

dmpfold -i input.aln -n 30 -m 200 -t template.pdb > fold.pdb

Ridiculous long run taking hours (100000 iterations + 1000 minimization steps):

dmpfold -i input.aln -n 100000 -m 1000 > fold.pdb

Python module

DMPfold2 can also be used within Python, allowing you to use it as part of other Python scripts. For example:

from dmpfold import aln_to_coords

# Default options
coords, confs = aln_to_coords("input.aln")

# Change options
coords, confs = aln_to_coords("input.aln", device="cuda", template="template.pdb", iterations=30, minsteps=200)

coords is a PyTorch tensor with shape (nres, 5, 3) where the first axis is the residue index, the second is the atom (N, CA, C, O, CB) and the third is the coordinates in Angstrom. confs is a PyTorch tensor corresponding to the predicted confidence for each residue.

CASP14 version

If for some reason you need the CASP14 version of the developing DMPfold2, run git checkout casp14 on this repository and find instructions in the readme file. This version used three approaches to generate models from constraints - CNS, XPLOR-NIH and a PyTorch-based molecular dynamics approach - but is less accurate, slower and harder to install than the current end-to-end approach.

Training

We provide a script to train DMPfold2 here. You will need to clone the repository then download and extract the training data into the dmpfold directory (20 GB download, 55 GB extracted). The list of training/validation samples, clustered at 30% sequence identitity, is here. A custom set of weights can be used to make predictions with the dmpfold command by using the -w flag.

We welcome bug reports, comments or suggestions on the training script, and although we will try our best to help users trying to run it, we do not have the resources to offer more detailed support.

Training an end-to-end protein structure prediction network is not easy. If you do want to try it, then it's highly recommended to start from a pre-trained model rather than training from scratch. By default the training script starts from the trained model in the repository. Here are some other tips that might help:

  1. Try to use a large memory GPU. DMPfold2 was trained mostly using an RTX 8000 with 48 GB RAM, however a 32 GB RAM V100 can also be used if you don't backpropagate too many iterations. See comments.

  2. If you must start from scratch, then it's advisable to start with short crops (croplen=100) before increasing the crop size later.

  3. Restarting from a new set of random weights can also help if early training progresses poorly.

  4. Be patient. On a single GPU, starting from scratch, the model will take approx. one or two months to train - which is why there is a built-in checkpoint facility to allow warm restarts.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmpfold-2.0.tar.gz (199.2 kB view details)

Uploaded Source

Built Distribution

dmpfold-2.0-py3-none-any.whl (197.2 kB view details)

Uploaded Python 3

File details

Details for the file dmpfold-2.0.tar.gz.

File metadata

  • Download URL: dmpfold-2.0.tar.gz
  • Upload date:
  • Size: 199.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for dmpfold-2.0.tar.gz
Algorithm Hash digest
SHA256 83128abb5f82881948d4e8b86127ee12de8ee1466f56beb75e760555bc0b0fd7
MD5 164202b37ea306b54938927a9dbff20e
BLAKE2b-256 a0ba2fda18943511fbbbe514cc26b9b88e7569c70571b08dfbe016505314af40

See more details on using hashes here.

File details

Details for the file dmpfold-2.0-py3-none-any.whl.

File metadata

  • Download URL: dmpfold-2.0-py3-none-any.whl
  • Upload date:
  • Size: 197.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for dmpfold-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f16cc6fcd4dbf5d37064dfd3d0a5052bca45c268d07a952dac8d256c4c27cac
MD5 09f3d7cc58b36fe7b4611a1acccb86b1
BLAKE2b-256 9f4946440e1ddcd69b32140deb4be9da1b14bdd73f930f7ace735767045b40ba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page