Package: sidechainnet
SidechainNetNEW: SidechainNet v1.0 introduces new features (e.g., OpenMM interaction, hydrogen support) and several breaking changes.Please see ourrelease notesfor more information. An updated walkthrough is available below.Colab Walkthrough v1.0,SidechainNet Paper,OpenMM-Loss PaperSidechainNet is a protein structure prediction dataset that directly extendsProteinNet2by Mohammed AlQuraishi.Specifically, SidechainNet adds measurements for protein angles and coordinates that describe the complete, all-atom protein structure (backboneandsidechain, excluding hydrogens) instead of the proteinbackbonealone.This repository provides the following:SidechainNet datasets stored as pickled Python dictionaries.Methods for loading and batching SidechainNet data efficiently in PyTorch.Methods for generating protein structure visualizations (.pdb,3Dmol,.gltf) from model predictions.Methods for augmenting SidechainNet to include new proteins and specify dataset organization.Interfacing with OpenMM to compute protein energy and atomic forces.Installationconda install -c conda-forge openmm
pip install sidechainnetSummary of SidechainNet dataThese attributes can be accessed viaSCNProteinorProteinBatchobjects.EntryDimensionality*Attribute nameProteinNetSidechainNetPrimary sequence§LseqXXDSSPSecondary structure**,§Lsecondary_structureXXPSSM+ Information contentL x 21evolutionaryXXMissing residue mask§LmaskXXBackbone coordinatesL x 4***x 3coords, subset[0:5]XXBackbone torsion anglesL x 3angles, subset[0:3]XBackbone bond anglesL x 3angles, subset[3:6]XSidechain torsion anglesL x 6angles, subset[6:12]XSidechain coordinatesL x 10 x 3coords, subset[5:15]XExperimental resolution1resolutionXUnmodified (non-standardized) sequenceLunmodified_seqX*Lreperesents the length of any given protein in the dataset.**Secondary structure is acquired from ProteinNet for training sets only. Blank characters are added by SidechainNet to refer to unmatched amino acids after alignment.(Added January 2021)***SidechainNet explicitly includes oxygen atoms as part of the backbone coordinate data in contrast to ProteinNet, which only includes the primaryN, C_alpha, Catoms.§Stored as string values in the underlying SidechainNet data dictionary.Quick-start ExamplesFor hands on learning to use SidechainNet, see our walkthrough above. Here are the basics:Loading SidechainNet as a SCNDatasetThe easiest way to interact with SidechainNet is most likely by using theSCNDatasetandSCNProteinobjects.>>>data=scn.load("debug",scn_dataset=True)>>>dataSCNDataset(n=461)>>>data["1HD1_1_A"]SCNProtein(1HD1_1_A,len=75,missing=0,split='train')>>>data[0]SCNProtein(2CMY_d2cmyb1,len=23,missing=2,split='train')Available features:SCNDatasetis iterable,proteins (SCNProteins) can selected from the dataset by name or index,proteins can be visualized with.to_3Dmol()and writable to PDBs with.to_pdb().non-terminal hydrogens can be added withSCNProtein.add_hydrogens(),Additionally, all of the attributes below are available directly from theSCNProteinobject:coords, angles, seq, unmodified_seq, mask, evolutionary, secondary_structure, resolution, is_modified, id, splitLoading SidechainNet with PyTorch DataLoadersTheloadfunction can also be used to load SidechainNet data as a dictionary oftorch.utils.data.DataLoaderobjects. PyTorchDataLoadersmake it simple to iterate over dataset items for training machine learning models. This method is recommended for using SidechainNet data with PyTorch.Iterating over our Dataloaders in this manner yieldsProteinBatchobjects that facilitate
training and data collation/padding.>>>dataloaders=scn.load(casp_version=12,casp_thinning=30,with_pytorch="dataloaders")>>>dataloaders.keys()['train','train_eval','valid-10',...,'valid-90','test']>>>forprotein_batchindataloaders['train']:....pred_protein=model(protein_batch.seqs)....loss=compute_loss(protein_batch.angles,protein_batch.coords,# True values....pred_protein.angles,pred_protein.coords)# Predicted values.......Quickly build all-atom protein coordinates from torsional anglesAn important component of this work is the inclusion of both angular and 3D coordinate representations of each protein. Researchers who develop methods that rely on angular representations may be interested in converting this information into 3D coordinates. For this reason, SidechainNet provides a method to convert the angles it provides into Cartesian coordinates.>>>d=scn.load(casp_version=12,casp_thinning=30)>>>p=d[100]>>>p.fastbuild(inplace=True)Add hydrogens to structuresGradient-friendly methods for adding hydrogens to protein structures.>>>p.add_hydrogens()>>># OR>>>p.fastbuild(add_hydrogens=True,inplace=True)# builds atoms (including Hs) from anglesVisualizationSidechainNet also makes it easy to visualize both existing and predicted all-atom protein structures. These visualizations are available asPDBfiles,py3Dmol.viewobjects, and Graphics Library Transmission Format (gLTF) files.>>>sb.to_pdb("example.pdb")>>>sb.to_gltf("example.gltf")Compute protein energy (if all-atom coordinates are available)>>>p.get_energy()>>># OR>>>p.fastbuild(add_hydrogens=True,inplace=True)# builds atoms (including Hs) from anglesQuantity(value=-3830.165405454086,unit=kilojoule/mole)Reproducing or Extending SidechainNetIf you would like to reproduce our work or make modifications/additions to the dataset, please see
the example we provide in our walkthrough (above). In simple terms, you will need to callscn.createwith the desired CASP/ProteinNet information or provide a list of ProteinNet-formatted IDs toscn.create_custom. Please note that since some data is acquired from ProteinNet directly (e.g., Position Specific Scoring Matrices), protein entries will exclude this data if it was not previously available in ProteinNet.# Reproduce SidechainNetscn.create(casp_version=12,training_set=30)# Create a custom version of SidechainNetcustom_ids=scn.get_proteinnet_ids(casp_version=12,split="train",thinning=30)# Include a protein released in April 2021 (not included in SidechainNet)custom_ids+=['7C3K_1_A']scn.create_custom(pnids=custom_ids,output_filename="custom.pkl",short_description="Custom SidechainNet.")Package RequirementsPython 3ProDy (pip install ProDy)BiopythonnumpyscipyOpenMM v8 or greater (conda install -c conda-forge openmm)PyTorchtqdmpy3Dmol (pip install py3Dmol)pymol (optional, forgltfsupport,repo,linux installrequireslibxml2)pytorch_lightning (optional, for model training examples)AcknowledgementsThanks to Mohammed AlQuraishi for building ProteinNet, upon which our work is built. Thanks, also, toJeppe Hallgrenfor his development of a ProteinNet text recordparser, which I have used in part here.This work is supported by R01GM108340 from the National Institute of General Medical Sciences, is supported in part by the University of Pittsburgh Center for Research Computing through the resources provided, and by NIH T32 training grant T32 EB009403 as part of the HHMI-NIBIB Interfaces Initiative.Project structure (continuous integration, docs, testing) based on theComputational Molecular Science Python Cookiecutterversion 1.1.ReferencesSidechainNet: An All-Atom Protein Structure Dataset for Machine Learning. J.E. King, D. Koes. Proteins: Structure, Function, and Bioinformatics (Vol. 89, Issue 11, pp. 1489–1496). Wiley. (2021).ProteinNet: a standardized data set for machine learning of protein structure.. M. AlQuraishi. BMC Bioinformatics 20, 311 (2019).3dmol.js: molecular visualization with WebGL.N. Rego and D. Koes. Bioinformatics, 31(8):1322–1324, (2014).Other ResourcesComputational Biology Skills Seminar, U.C. Berkeley, May 13, 2021SlidesNotebookRecordingCitationPlease cite our paper(s) if you find SidechainNet useful in your work.@article{https://doi.org/10.1002/prot.26169,author={King, Jonathan Edward and Koes, David Ryan},title={SidechainNet: An all-atom protein structure dataset for machine learning},journal={Proteins: Structure, Function, and Bioinformatics},volume={89},number={11},pages={1489-1496},keywords={dataset, deep learning, machine learning, protein structure, proteins, software},doi={https://doi.org/10.1002/prot.26169},url={https://onlinelibrary.wiley.com/doi/abs/10.1002/prot.26169},eprint={https://onlinelibrary.wiley.com/doi/pdf/10.1002/prot.26169},abstract={Abstract Despite recent advancements in deep learning methods for protein structure prediction and representation, little focus has been directed at the simultaneous inclusion and prediction of protein backbone and sidechain structure information. We present SidechainNet, a new dataset that directly extends the ProteinNet dataset. SidechainNet includes angle and atomic coordinate information capable of describing all heavy atoms of each protein structure and can be extended by users to include new protein structures as they are released. In this article, we provide background information on the availability of protein structure data and the significance of ProteinNet. Thereafter, we argue for the potentially beneficial inclusion of sidechain information through SidechainNet, describe the process by which we organize SidechainNet, and provide a software package (https://github.com/jonathanking/sidechainnet) for data manipulation and training with machine learning models.},year={2021}}@article{King2023.10.03.560775,author={Jonathan Edward King and David Ryan Koes},title={Interpreting Molecular Dynamics Forces as Deep Learning Gradients Improves Quality Of Predicted Protein Structures},elocation-id={2023.10.03.560775},year={2023},doi={10.1101/2023.10.03.560775},publisher={Cold Spring Harbor Laboratory},URL={https://www.biorxiv.org/content/early/2023/10/05/2023.10.03.560775},eprint={https://www.biorxiv.org/content/early/2023/10/05/2023.10.03.560775.full.pdf},journal={bioRxiv}}CopyrightCopyright (c) 2023 Jonathan King and the University of Pittsburgh