Giter Site home page Giter Site logo

sergio-santos-group / protosyn.jl Goto Github PK

View Code? Open in Web Editor NEW
58.0 7.0 7.0 182.32 MB

A Julia-based framework for molecular modelling

Home Page: https://sergio-santos-group.github.io/ProtoSyn.jl/stable/

License: GNU Affero General Public License v3.0

Julia 90.54% Python 0.35% TeX 8.96% Ruby 0.15% Perl 0.01%

protosyn.jl's Introduction

Logo

José M. Pereira & Sérgio M. Santos

CICECO & Departamento de Química - Universidade de Aveiro

📜 Description

ProtoSyn.jl is a platform for molecular manipulation and simulation, with an emphasis on peptide design.

The main goal of ProtoSyn.jl is to be a basis on top of which new tools and protocols can be experimented and prototyped. Taking advantage of Julia’s environment, ProtoSyn has been built with emergent technologies in mind, such as distributed computing, GPU/SIMD acceleration and machine learning models usage. ProtoSyn.jl intends to be a playground for trying out new emergent models and algorithms in a plug-and-play environment, completly open-source and with curated & up-do-date documentation, examples and tutorials.

📍 Features

  • Edit a peptide structure by removing, adding and mutating any number of residues
  • Create peptides from scratch by providing the desired sequence
  • Copy parts of other molecules and graft them together to create something new
  • Explore Ramachandran maps to introduce secondary structure variations
  • Run Monte Carlo simulations to optimize a structure or a sequence
  • Calculate energies and forces using native potentials (such as SASA/GB, Coulomb or simple harmonics) or commonly used tools now integrated in Julia (such as TorchANI or REF15 from PyRosetta).
  • Perform Steepest Descent optimizations
  • Explore rotamer libraries to optimize sidechain packaging
  • Select residues based on name, index, distance and other parameters, with a rich combinatory selection syntax
  • Perform rigid body docking of ligands
  • Include ramified carbohydrates and glycoproteins in your simulations, with support for sugar residues
  • Include non-canonical aminoacids (NCAAs) and post-translational modifications, such as methylation or phosporylation
  • Generate functionalized carbon models, including multi-layer & pore generation support

📋 Installation

After setting up your Julia installation, open a new REPL and add ProtoSyn.jl using the package manager:

julia> ] add https://github.com/sergio-santos-group/ProtoSyn.jl.git

All Julia-based dependencies should be automatically installed/updated. Some functionalities of ProtoSyn.jl interact with external packages or tools (such as Python packages. For example, in order to use TorchANI's energy function, you'll also need to install Python with both Torch and TorchANI libraries). In either case, upon using ProtoSyn.jl for the first time, users should be prompted to install any additional tool, if they so choose. These warning can be supressed at any time by adding export JULIA_PROTOSYN_WARN_NON_AVALIABLE_EFC=false in the user's .bashrc file.

For trying out new features, consider using the development branch of ProtoSyn.jl instead. Be aware that some bugs and missing documentation are to be expected when using the latest versions.

julia> ] add https://github.com/sergio-santos-group/ProtoSyn.jl.git#dev

📖 Documentation

  • STABLE — documentation of the most recently tagged version.

📧 Contacts

For any question or curiosity, please contact [email protected].

Check for the most recent developments in ProtoSyn's blog.

🏆 Acknowledgments

Logo

protosyn.jl's People

Contributors

josepereiraua avatar sergiomsantos avatar zznidar avatar

Stargazers

Debarshi Banerjee avatar Hiroyuki Nakamura avatar Sridhar avatar  avatar Vivek Kiran Ballakur avatar Markus Rauhalahti avatar PingYen avatar Jonathan Chen avatar Shu Li avatar  avatar  avatar  avatar Michael Green avatar Junpei Nagata avatar Hiroki Ban avatar  avatar Mason Ross Hayes avatar  avatar  avatar  avatar Soumen avatar  avatar  avatar Manuel Carrer avatar Tor Erlend Fjelde avatar Jeroen Van Goey avatar  avatar Phil Leung avatar CASEA avatar John George Francis avatar Suavesito avatar Viral B. Shah avatar Simone Carlo Surace avatar Leandro Martínez avatar Letícia Maria Pequeno Madureira avatar Peter Clarke avatar Orestis Ousoultzoglou avatar src/sf avatar Balen avatar Francisco Lobos avatar Songtao Gui avatar Kevin Bonham avatar Diego Javier Zea avatar anand jain avatar Yen avatar Elias Carvalho avatar  avatar  avatar kangsgo avatar  avatar Marco Matthies avatar Dan Kool avatar Pranay Venkatesh avatar Siddhant Sharma avatar  avatar Sean Aubin avatar Josh Fass avatar Joe Greener avatar

Watchers

James Cloos avatar Vivek Kiran Ballakur avatar  avatar  avatar Dan Kool avatar  avatar  avatar

protosyn.jl's Issues

Inexact Error: trunc(Int64, NaN) when running example 6 steepest descent

I am getting an error at the example 6 (steepest descent) step:

steepest_descent = ProtoSyn.Drivers.SteepestDescent(energy_function, callback, 500, 0.001, 0.1)
steepest_descent(pose)

It gives me what looks like one round. energy_function(pose) gives me a value, then I run steepest_descent(pose) and it shows an updated number. 0 1134.041 is what the output looks like before it errors. I check energy_function(pose) again and it is 1134.041. So I think one round is happening. Also, I remove the all-atom clash with really high energy and get the same error.

I am pretty sure I have the dependencies like torch and torchani installed correctly, and I get no warning about anything except SeqDes.

Anyways, the stacktrace looks like:

ERROR: InexactError: trunc(Int64, NaN)
Stacktrace:
 [1] trunc
   @ ./float.jl:781 [inlined]
 [2] ceil(#unused#::Type{Int64}, x::Float64)
   @ Base ./float.jl:358
 [3] hist_by_distance_by_elem(pose::Pose{Topology}, selection::PromoteSelection{ProtoSyn.Stateless}; cutoff::Float64, bin::Float64, elems::Vector{String}, dm::Matrix{Float64})
   @ ProtoSyn ~/.julia/packages/ProtoSyn/Yx5Xy/src/Core/Methods/histogram.jl:76
 [4] predict_igbr_nn_born_radii(pose::Pose{Topology}, selection::PromoteSelection{ProtoSyn.Stateless}; dm::Matrix{Float64}, models::ProtoSyn.Calculators.GB.GBModels)
   @ ProtoSyn.Calculators.GB ~/.julia/packages/ProtoSyn/Yx5Xy/src/Core/Calculators/gb.jl:78
 [5] calc_gb(A::Type{ProtoSyn.CUDA_2}, pose::Pose{Topology}, selection::TrueSelection{ProtoSyn.Stateless, ProtoSyn.Atom}, update_forces::Bool; born_radii::typeof(ProtoSyn.Calculators.GB.predict_igbr_nn_born_radii), ϵ_protein::Float64, ϵ_solvent::Float64, models::ProtoSyn.Calculators.GB.GBModels, cut_off::Float64)
   @ ProtoSyn.Calculators.GB ~/.julia/packages/ProtoSyn/Yx5Xy/src/Core/Calculators/gb.jl:161
 [6] (::ProtoSyn.Calculators.EnergyFunction)(pose::Pose{Topology}; update_forces_overwrite::Bool)
   @ ProtoSyn.Calculators ~/.julia/packages/ProtoSyn/Yx5Xy/src/Core/Calculators/energy_function.jl:223
 [7] (::ProtoSyn.Drivers.SteepestDescent)(pose::Pose{Topology})
   @ ProtoSyn.Drivers ~/.julia/packages/ProtoSyn/Yx5Xy/src/Core/Drivers/steepest_descent.jl:174
 [8] top-level scope
   @ ~/Documents/Prots2.jl/src/prototesting.jl:32

State.energy.comp as a dictionary or structure parameters

State.energy.comp can be:

mutable struct Energy <: AbstractEnergy
    total::Float64
    comp::Dict{String, Float64}
end

or

mutable struct Energy <: AbstractEnergy
    total::Float64
    bonds::Float64
    angles::Float64
    dihedrals::Float64
    coulomb::Float64
    (...)
end

Dihedral FBR forces only allow for one sided rotation

FBR only allows one-sided restriction on angles ~180.0: ca2c552

Currently, Dihedral Angle restrictions are a Flat-Bottomed Restriction Potential (FBR). This allows for the definition of a center zone where no forces are applied (in a sense trapping the dihedral angle in the desired range of angles), sided by 2 zones on each side where restriction energy is given to the system, causing forces to push the dihedral back to the desired zone. However, when blocking the dihedral to angles on the outside (like -180 or 180) it is impossible to define both sides of the FBR, since the PHI range is from -180.0 to 180.0.

Old

Suggestion:
The Dihedral Restriction function could be based on Sin(x), so that it is repetitive. This would probably cause issues on maximums, where the force would be 0.

New

Issue applying a new Rotamer to the sidechains

FYI in example 3 molecular manipulations, I was having problems with the ProtoSyn.Peptides.phi part of this line phi = ProtoSyn.getdihedral(pose.state, ProtoSyn.Peptides.phi(pose.graph[1][4]))

Version : 1.01

Initial structure is possibly wrong at Prolines

Two issues have been identified when building Prolines using old ProtoSyn:

  1. The atoms 2 and 3 are not in the residue.movables, and should be.
  2. The omega angle (Cα-C-N-Cα) should be 0º instead of 180º.

A temporary function (Common.fix_prolines @ /Common/conf_gen.jl) is employed for now, solving the two issues.

What python version is recommended?

Sorry if this is in the docs. I have trouble installing the python dependencies with the newest python versions (3.9-3.11). I think at least 1 of the dependencies requires an older version, 3.7 I think.

Error loading PDB with insertion codes

Sometimes, residues in PDB files are not numbered using numbers only, but contain a letter suffix (100A, 100B, 100C ... 100H, for example). These are called insertion codes and can often be seen some antibodies, such as PDB 1HZH.

However, when trying to load the mentioned PDB-file using pose = ProtoSyn.Peptides.load("1hzh.pdb"), an error is thrown:

ERROR: MethodError: no method matching getindex(::Nothing, ::String)
Stacktrace:
 [1] load(::Type{Float64}, io::IOStream, ::Type{Val{1}}; alternative_location::String, ignore_residues::Vector{String}, ignore_chains::Vector{String})
   @ ProtoSyn C:\Users\user\.julia\packages\ProtoSyn\Xt3a1\src\Core\Methods\io-read.jl:85
 [2] load(::Type{Float64}, filename::String, ::Type{Val{1}}; bonds_by_distance::Bool, alternative_location::String, infer_parenthood::Bool, ignore_residues::Vector{String}, ignore_chains::Vector{String})
   @ ProtoSyn C:\Users\user\.julia\packages\ProtoSyn\Xt3a1\src\Core\Methods\io.jl:222
 [3] load(::Type{Float64}, filename::String; bonds_by_distance::Bool, alternative_location::String, ignore_residues::Vector{String}, ignore_chains::Vector{String})
   @ ProtoSyn C:\Users\user\.julia\packages\ProtoSyn\Xt3a1\src\Core\Methods\io.jl:55
 [4] load(::Type{Float64}, filename::String; bonds_by_distance::Bool, alternative_location::String, include_residues::Vector{String}, ignore_residues::Vector{String}, ignore_chains::Vector{String}, sort_atoms_by_graph::Bool)
   @ ProtoSyn.Peptides C:\Users\user\.julia\packages\ProtoSyn\Xt3a1\src\Peptides\Methods\io.jl:49
 [5] #load#21
   @ C:\Users\user\.julia\packages\ProtoSyn\Xt3a1\src\Peptides\Methods\io.jl:169 [inlined]
 [6] load(filename::String)
   @ ProtoSyn.Peptides C:\Users\user\.julia\packages\ProtoSyn\Xt3a1\src\Peptides\Methods\io.jl:168
 [7] top-level scope
   @ c:\Users\user\Documents\user\myFile.jl:4

If I delete the residues with insertion codes, the file loads fine (but the deleted residues are missing then).

Some problems with Getting Started example

I get this error when I use pose = ProtoSyn.Peptides.load("data/2a3d.pdb")

ERROR: LoadError: No atom "C" found in atom Atom{/2a3d:40409/A:1/GLY:2/N:20} bonds list (ProtoSyn.Atom[]).
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] load(::Type{Float64}, filename::String; bonds_by_distance::Bool)
   @ ProtoSyn.Peptides C:\Users\kool7\.julia\packages\ProtoSyn\PZ0MY\src\Peptides\Methods\io.jl:42
 [3] #load#8
   @ C:\Users\kool7\.julia\packages\ProtoSyn\PZ0MY\src\Peptides\Methods\io.jl:52 [inlined]
 [4] load(filename::String)
   @ ProtoSyn.Peptides C:\Users\kool7\.julia\packages\ProtoSyn\PZ0MY\src\Peptides\Methods\io.jl:52

Other inconsistencies between the example are:

pose.graph[1,1,"CA"].parent # Atom{/ROOT:37831/OO:0} instead of Atom{/2a3d:11551/A:1/MET:1/N:1}

pose.graph[1, 1, "CA"].bonds # ProtoSyn.Atom[] instead of 4-element Array{Atom,1}: Atom{/2a3d:11551/A:1/MET:1/N:1} Atom{/2a3d:11551/A:1/MET:1/C:3} Atom{/2a3d:11551/A:1/MET:1/CB:5} Atom{/2a3d:11551/A:1/MET:1/HA:9}

Everything else appears to work properly. So it looks like the bonding might be the issue?

Failure to import ProtoSyn

With using ProtoSyn I get:

 | Loading TorchANI

┌ Warning: 📍 ProtoSyn was not able to identify `torchani` in this system.
│ PyCall is currently configured to use the Python version at /home/jgreener/soft/miniconda3/bin/python3.
│ In order to use the TorchANI energy function component, make sure to:
│     - Set ENV["PYTHON"] to the path of python executable you wish to use, run Pkg.build("PyCall") and re-launch Julia and ProtoSyn.
│     - Make sure `torchani` is installed in the machine trying to load ProtoSyn.
│ 
│ In order to install `torchani`, follow the following instructions:
│ (1) Install TorchANI: pip install torchani
│ (2) Re-launch Julia and ProtoSyn
│ 
│ ProtoSyn will continue loading, but the `Calculators.TorchANI` module will be unavailable.
│ To surpress further warnings for unavailable energy function components, set the JULIA_PROTOSYN_WARN_NON_AVALIABLE_EFC environment flag and re-launch Julia and ProtoSyn. 
│ $ export JULIA_PROTOSYN_WARN_NON_AVALIABLE_EFC=false
│ Optionally, add the above line to ~/.bashrc to persistently supress warnings in further sessions.
│ 
└ @ ProtoSyn.Calculators.TorchANI ~/.julia/packages/ProtoSyn/2L4hi/src/Core/Calculators/torchani.jl:57
 | Loading ONNX models
ERROR: InitError: MethodError: Cannot `convert` an object of type 
  Umlaut.Tape{ONNX.ONNXCtx} to an object of type 
  Ghost.Tape
Closest candidates are:
  convert(::Type{T}, ::T) where T at Base.jl:61
  Ghost.Tape(::C) where C at ~/.julia/packages/Ghost/WYs14/src/tape.jl:220
Stacktrace:
  [1] convert(#unused#::Type{Union{Nothing, Ghost.Tape}}, x::Umlaut.Tape{ONNX.ONNXCtx})
    @ Base ./some.jl:36
  [2] ProtoSyn.Calculators.GB.GBModels(C::Umlaut.Tape{ONNX.ONNXCtx}, N::Umlaut.Tape{ONNX.ONNXCtx}, H::Umlaut.Tape{ONNX.ONNXCtx}, O::Umlaut.Tape{ONNX.ONNXCtx}, S::Umlaut.Tape{ONNX.ONNXCtx})
    @ ProtoSyn.Calculators.GB ~/.julia/packages/ProtoSyn/2L4hi/src/Core/Calculators/gb.jl:9
  [3] top-level scope
    @ none:1
  [4] eval
    @ ./boot.jl:368 [inlined]
  [5] __init__()
    @ ProtoSyn.Calculators.GB ~/.julia/packages/ProtoSyn/2L4hi/src/Core/Calculators/gb.jl:21
  [6] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
    @ Base ./loading.jl:831
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
    @ Base ./loading.jl:1039
  [8] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1315
  [9] _require_prelocked(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1200
 [10] macro expansion
    @ ./loading.jl:1180 [inlined]
 [11] macro expansion
    @ ./lock.jl:223 [inlined]
 [12] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1144
during initialization of module GB

This also seems to affect the Travis build: https://app.travis-ci.com/github/sergio-santos-group/ProtoSyn.jl

I am on Julia 1.8.5 and my packages are:

⌃ [21141c5a] AMDGPU v0.4.5
  [4c88cf16] Aqua v0.6.0
  [a9b6321e] Atomix v0.1.0
  [a963bdd2] AtomsBase v0.2.5 `~/.julia/dev/AtomsBase`
  [fbb218c0] BSON v0.3.6
  [6e4b80f9] BenchmarkTools v1.3.2
  [99c8bb3a] Bio3DView v0.1.4 `~/.julia/dev/Bio3DView`
  [00701ae9] BioAlignments v3.1.0
  [37cfa864] BioCore v2.0.5
  [7e6ae17a] BioSequences v3.1.3
  [de9282ab] BioStructures v2.0.0 `~/.julia/dev/BioStructures`
  [052768ef] CUDA v4.0.0 `~/.julia/dev/CUDA`
  [13f3f980] CairoMakie v0.10.2
  [69e1c6dd] CellListMap v0.8.14
  [082447d4] ChainRules v1.48.0 `~/.julia/dev/ChainRules`
  [d360d2e6] ChainRulesCore v1.15.7
⌃ [46823bd8] Chemfiles v0.10.3
  [944b1d66] CodecZlib v0.7.1
  [5ae59095] Colors v0.12.10
⌃ [f68482b8] Cthulhu v2.8.5
  [a93c6f00] DataFrames v1.5.0
  [31c24e10] Distributions v0.25.86
  [35a29f4d] DocumenterTools v0.1.16
  [7da242da] Enzyme v0.11.0-dev `~/.julia/dev/Enzyme`
  [f151be2c] EnzymeCore v0.2.1 `~/.julia/dev/Enzyme/lib/EnzymeCore`
  [8f5d6c58] EzXML v1.1.0
  [5789e2e9] FileIO v1.16.0
  [26cc04aa] FiniteDifferences v0.12.26
  [587475ba] Flux v0.13.14
  [1fa38f19] Format v1.3.2
  [f6369f11] ForwardDiff v0.10.35
  [e9467ef8] GLMakie v0.8.2
  [86223c79] Graphs v1.8.0
  [f67ccb44] HDF5 v0.16.14
  [7073ff75] IJulia v1.24.0
⌃ [c3a54625] JET v0.7.8
  [682c06a0] JSON v0.21.3
  [63c18a36] KernelAbstractions v0.9.0
  [259c3a9c] MMTF v1.0.0 `~/.julia/dev/MMTF`
  [ee78f7c6] Makie v0.19.2
  [626554b9] MetaGraphs v0.7.2
  [6c89ec66] MolecularGraph v0.13.0
  [aa0f7f06] Molly v0.14.3 `~/.julia/dev/Molly`
⌃ [5fb14364] OhMyREPL v0.5.17
  [29c4880b] OpenSMILES v0.1.0
  [3bd65402] Optimisers v0.2.15
  [32113eaa] PkgBenchmark v0.2.12
⌃ [91a5bcdd] Plots v1.38.7
  [c46f51b8] ProfileView v1.7.0
  [186d2b2d] ProteinEnsembles v0.3.1 `~/.julia/dev/ProteinEnsembles`
  [c9758760] ProtoSyn v0.4.0 `https://github.com/sergio-santos-group/ProtoSyn.jl.git#master`
  [44044271] RDKitMinimalLib v1.2.0
  [3cdcf5f2] RecipesBase v1.3.3
  [295af30f] Revise v3.5.1
  [de6bee2f] SimpleChains v0.4.3
⌅ [90137ffa] StaticArrays v1.5.17
  [f3b207a7] StatsPlots v0.15.4
  [1986cc42] Unitful v1.12.4
  [f31437dd] UnitfulChainRules v0.1.2
  [013be700] UnsafeAtomics v0.2.1
  [d80eeb9a] UnsafeAtomicsLLVM v0.1.0
  [e88e6eb3] Zygote v0.6.57 `~/.julia/dev/Zygote`
  [7cc45869] Enzyme_jll v0.0.51+0 `~/.julia/dev/Enzyme_jll`

Error loading PDB with negative residue numbers

When I try to load a .pdb with negataive residue numbers (for example 3GFT), it has some residues negatively numbered (e. g. in line 2430, the chain B starts with -2). This causes ProtoSyn to fail importing the pose.

Apparently, this is a valid way of numbering residues:

Any number (negative, 0, positive) can be used
(https://pdb101.rcsb.org/learn/guide-to-understanding-pdb-data/primary-sequences-and-the-pdb-format)

I'm using ProtoSyn v1.1.1 https://github.com/sergio-santos-group/ProtoSyn.jl.git#master

pose = ProtoSyn.load("C:/Users/user/Downloads/3gft.pdb")
ERROR: MethodError: no method matching getindex(::Nothing, ::String)
Stacktrace:
 [1] load(::Type{Float64}, io::IOStream, ::Type{Val{1}}; alternative_location::String, ignore_residues::Vector{String}, ignore_chains::Vector{String})
   @ ProtoSyn C:\Users\user\.julia\packages\ProtoSyn\OBnhk\src\Core\Methods\io-read.jl:85
 [2] load(::Type{Float64}, filename::String, ::Type{Val{1}}; bonds_by_distance::Bool, alternative_location::String, infer_parenthood::Bool, ignore_residues::Vector{String}, ignore_chains::Vector{String})
   @ ProtoSyn C:\Users\user\.julia\packages\ProtoSyn\OBnhk\src\Core\Methods\io.jl:222
 [3] load(::Type{Float64}, filename::String; bonds_by_distance::Bool, alternative_location::String, ignore_residues::Vector{String}, ignore_chains::Vector{String})
   @ ProtoSyn C:\Users\user\.julia\packages\ProtoSyn\OBnhk\src\Core\Methods\io.jl:55
 [4] load(filename::String; bonds_by_distance::Bool, alternative_location::String, ignore_residues::Vector{String}, ignore_chains::Vector{String})
   @ ProtoSyn C:\Users\user\.julia\packages\ProtoSyn\OBnhk\src\Core\Methods\io.jl:74
 [5] load(filename::String)
   @ ProtoSyn C:\Users\user\.julia\packages\ProtoSyn\OBnhk\src\Core\Methods\io.jl:72
 [6] top-level scope
   @ REPL[3]:1
 [7] top-level scope
   @ C:\Users\user\.julia\packages\CUDA\DfvRa\src\initialization.jl:52

I suppose this is related to #54 (complex regex parser for .pdb)

Mutators.Crankshaft and Forcefield.Other.calc_eSol! both assume the given Vector{Dihedral} only contains PHI dihedrals

The reason behind this behavior is that both Mutators.Crankshaft and Forcefield.Other.calc_eSol! deal with the residues alpha-carbons, and use the PHI dihedrals to identify it (as dihedral.a3)

This raises three issues:

  • Unexpected behavior happens when giving the function non-phi dihedrals.
  • Filtering the existing dihedrals gives all PHI dihedrals easily, but the first residue does not contain, by default, a PHI dihedral. Currently, this means this first residue is not accounted for in either crankshaft movements or eSol calculations.
  • Verifying if the given Vector{Dihedral} only contains, indeed, PHI dihedrals can be expensive.

A proposed solution is to add the alpha-carbon index as a parameter to residues, and establish it when loading the residues.

Git/Windows issues with the "aux.md" file

I am having a lot of problems with this particular file:

docs/src/protosyn-api/core/methods/aux.md

Git and/or Windows hate it for some reason (I think the phrase 'aux' is reserved or something? IDK). A workaround I found is renaming it to _aux.md and trying to disconnect the git history, but it is an ugly process.

GitKraken won't clone it, with the same error that the file is invalid.

Error when calculating forces

Looking at the Example 4, I came across an error when calculating forces. It is thrown when running energy_function(pose, true) (actually, it seems the name of the keyworded argument has changed since the Example had been written, so I actually tried to run energy_function(pose, update_forces_overwrite=true)).

Although it seems to change the pose.state.f matrix, it throws ERROR: TypeError: in keyword argument v, expected Union{Nothing, Tuple{Float64, Float64, Float64}}, got a value of type SIMD.Vec{4, Float64}. This in turn prevents the steepest_descent from Example 6 from running.

Stack Trace
ERROR: TypeError: in keyword argument v, expected Union{Nothing, Tuple{Float64, Float64, Float64}}, got a value of type SIMD.Vec{4, Float64}
Stacktrace:
  [1] macro expansion
    @ C:\Users\Username\.julia\packages\ProtoSyn\Yx5Xy\src\Core\Calculators\Potentials\calculation_stage_simd.jl:67 [inlined]
  [2] macro expansion
    @ .\simdloop.jl:77 [inlined]
  [3] macro expansion
    @ C:\Users\Username\.julia\packages\ProtoSyn\Yx5Xy\src\Core\Calculators\Potentials\calculation_stage_simd.jl:57 [inlined]
  [4] macro expansion
    @ .\simdloop.jl:77 [inlined]
  [5] macro expansion
    @ C:\Users\Username\.julia\packages\ProtoSyn\Yx5Xy\src\Core\Calculators\Potentials\calculation_stage_simd.jl:53 [inlined]
  [6] resolve_calculation(#unused#::Type{ProtoSyn.SIMD_1}, pose::Pose{Topology}, potential::ProtoSyn.Calculators.var"#bump_potential_charges#29"{ProtoSyn.Calculators.var"#bump_potential_charges#28#30"{Float64, Float64}}, update_forces::Bool, verlet_list::Nothing, coords::Vector{Float64}, mask::Mask{Atom}, indexes::Vector{Int64})
    @ ProtoSyn.Calculators C:\Users\Username\.julia\packages\ProtoSyn\Yx5Xy\src\Core\Calculators\Potentials\calculation_stage_simd.jl:32
  [7] resolve_selection(A::Type{ProtoSyn.SIMD_1}, pose::Pose{Topology}, potential::Function, update_forces::Bool, verlet_list::Nothing, selection::TrueSelection{ProtoSyn.Stateless, Atom}, mask::typeof(ProtoSyn.Calculators.get_intra_residue_mask))
    @ ProtoSyn.Calculators C:\Users\Username\.julia\packages\ProtoSyn\Yx5Xy\src\Core\Calculators\Potentials\selection_stage.jl:58
  [8] apply_potential
    @ C:\Users\Username\.julia\packages\ProtoSyn\Yx5Xy\src\Core\Calculators\Potentials\potentials.jl:17 [inlined]
  [9] calc_coulomb(::Type{ProtoSyn.SIMD_1}, pose::Pose{Topology}, selection::TrueSelection{ProtoSyn.Stateless, Atom}, update_forces::Bool; mask::typeof(ProtoSyn.Calculators.get_intra_residue_mask), vlist::Nothing, potential::ProtoSyn.Calculators.var"#bump_potential_charges#29"{ProtoSyn.Calculators.var"#bump_potential_charges#28#30"{Float64, Float64}})   
    @ ProtoSyn.Calculators.Electrostatics C:\Users\Username\.julia\packages\ProtoSyn\Yx5Xy\src\Core\Calculators\electrostatics.jl:199
 [10] (::ProtoSyn.Calculators.EnergyFunction)(pose::Pose{Topology}; update_forces_overwrite::Bool)
    @ ProtoSyn.Calculators C:\Users\Username\.julia\packages\ProtoSyn\Yx5Xy\src\Core\Calculators\energy_function.jl:223
 [11] top-level scope
    @ c:\Users\Username\example4.jl:12

I have tried Pkg adding SIMD, then also downgrading SIMD to 3.4.1 and later to 3.3.1, but none of this helped.

Docker container?

Hi guys, I really like this project and it looks a good excuses to learn a bit of julia. As set up is half the battle and I was wondering if you had got a good container recipes?

This is my "work in progress" but it's not got cuda working and the pycall isn't linking between python and julia....

FROM mambaorg/micromamba:0.24.0

RUN micromamba install -y --name base -c conda-forge numpy pytorch pip
RUN micromamba install -y --name base -c nvidia -c pytorch cudatoolkit=11.3
RUN micromamba install -y --name base -c conda-forge torchani libgcc

USER root
RUN apt-get update && apt-get install -y
apache2
curl
git
python3-pip
vim
libstdc++6
RUN pip install julia jill
RUN jill install 1.6.2 --confirm

Use Cases

  • Adição de um resíduo no final da cadeia proteica
  • Adição de múltiplos resíduos no final da cadeia proteica
  • Remoção de um resíduo no final da cadeia proteica
  • Adição de um resíduo no início da cadeia proteica
  • Adição de um múltiplos resíduos no início da cadeia proteica
  • Remoção de um resíduo no início da cadeia proteica
  • Remoção de um resíduo no centro da cadeia proteica
  • Substituição de 1 resíduo por outro
  • Substituição de 2 resíduos consecutivos por outros 2 (2 operações singulares seguidas?)
  • Construção de um peptídeo a partir da sequência
  • Alteração de um único diedro
  • Unbond de dois átomos inter-resíduos
  • Unbond de dois átomos intra-resíduo (Não é atualmente permitido)
  • Alteração de um único diedro após unbond de dois átomos inter-resíduos
  • Alteração de todos os diedros de modo a aplicar determinada estrutura secundária
  • Alteração de todos os diedros de modo a aplicar determinada estrutura secundária após alteração de um único diedro
  • Alteração de todos os diedros de modo a aplicar determinada estrutura secundária após unbond de dois átomos inter-resíduos
  • Alteração de todos os diedros de modo a aplicar determinada estrutura secundária após alteração de um único diedro e unbond de dois átomos inter-resíduos
  • Adicionar caps dos terminais de proteínas
  • Remover caps dos terminais de proteínas
  • Adicionar hidrogênios em falta à proteína completa
  • Remover hidrogênios das cadeias laterais
  • Adicionar resíduos em falta intra-proteína, fechando a cadeia com CCD ou Steepest Descent
  • Ler PDB com informação dos CONECTS em falta
  • Simulações com 2 moléculas: translação e rotação de rigid body de um ligando em relação a uma proteína

infer_parenthood! too strict?

Hi,
I wanted to try protosyn with a very short peptide, but I can't load it.

ERROR: AssertionError: No atom "C" found in atom Atom{/b:14053/B:1/ALA:2/N:6} bonds list (ProtoSyn.Atom[]).

For some reason the backbone N atom from the 2nd residue doesn't show up as bonded to the backbone C atom of the previous residue. They're at a 1.5A distance, and I know the structure is good, so I can't tell what's going on.

Thanks!

Extend to support non-canonical amino acids

Rosetta is really hard to use with non-canonical amino acids (NCAA). Would adding non-canonical amino acid support to this project be an acceptable extension? I realize it's quite ambitious, but it might be easier to do now at this early stage of the project.

From what I understand, this ambitious goal would require:

  • Changing the grammar in resources/Peptides/grammars.jl and related code to support NCAA character representation if they are used
  • Adding backbone rotamers for the NCAA in a similar format to resources/Peptides/dunbrack_rotamers.lib
  • Adding YAML files for non-natural amino acids

load function is saying "no method matching getindex(::Nothing, ::String)"

I am getting an error when I try:
ProtoSyn.load("data/2vb1.pdb")

but not with the example pdb:
ProtoSyn.load("data/2a3d.pdb")

Stacktrace:
 [1] load(#unused#::Type{Float64}, io::IOStream, #unused#::Type{Val{1}})
   @ ProtoSyn C:\Users\kool7\.julia\packages\ProtoSyn\PZ0MY\src\Core\Methods\io.jl:189
 [2] load(::Type{Float64}, filename::String, ::Type{Val{1}}; bonds_by_distance::Bool)
   @ ProtoSyn C:\Users\kool7\.julia\packages\ProtoSyn\PZ0MY\src\Core\Methods\io.jl:55
 [3] load(::Type{Float64}, filename::String; bonds_by_distance::Bool)
   @ ProtoSyn C:\Users\kool7\.julia\packages\ProtoSyn\PZ0MY\src\Core\Methods\io.jl:36
 [4] load(filename::String; bonds_by_distance::Bool)
   @ ProtoSyn C:\Users\kool7\.julia\packages\ProtoSyn\PZ0MY\src\Core\Methods\io.jl:49
 [5] load(filename::String)
   @ ProtoSyn C:\Users\kool7\.julia\packages\ProtoSyn\PZ0MY\src\Core\Methods\io.jl:46```

Do the PDB files have to be preprocessed, or are ligands or waters a problem?

LoadError when loading/using package

I get this error when I do using ProtoSyn, it appears to be an error with a peptide calculator method:

[ Info: Precompiling ProtoSyn [c9758760-7c0d-11e9-0ffc-fb9355b7d293]
[ Info: Skipping precompilation since __precompile__(false). Importing ProtoSyn [c9758760-7c0d-11e9-0ffc-fb9355b7d293].
[ Info: Loading required packages
[ Info:  | Loading SIMD
[ Info:  | Loading CUDA
[ Info: Setting up variables
[ Info: Current acceleration set to ProtoSyn.Acceleration(ProtoSyn.CUDA_2)
[ Info: Loading Core
[ Info: Loading Calculators
[ Info:  | Loading TorchANI
[ Info:  | Loading Hydrogen Bonds
[ Info:  | Loading SASA
[ Info:  | Loading Restraint Models
[ Info:  | Loading Energy Function
[ Info: Loading Mutators
[ Info: Loading Drivers
[ Info: Loading Peptides
ERROR: LoadError: TypeError: in Type{...} expression, expected UnionAll, got Type{Polynomials.Polynomial{Float64}}
Stacktrace:
  [1] deserialize_datatype(s::Serialization.Serializer{IOStream}, full::Bool)
    @ Serialization C:\Users\kool7\AppData\Local\Programs\Julia-1.7.0\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:1356
  [2] handle_deserialize(s::Serialization.Serializer{IOStream}, b::Int32)
    @ Serialization C:\Users\kool7\AppData\Local\Programs\Julia-1.7.0\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:854
  [3] deserialize(s::Serialization.Serializer{IOStream})
    @ Serialization C:\Users\kool7\AppData\Local\Programs\Julia-1.7.0\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:801
  [4] handle_deserialize(s::Serialization.Serializer{IOStream}, b::Int32)
    @ Serialization C:\Users\kool7\AppData\Local\Programs\Julia-1.7.0\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:861
  [5] deserialize(s::Serialization.Serializer{IOStream})
    @ Serialization C:\Users\kool7\AppData\Local\Programs\Julia-1.7.0\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:801
  [6] handle_deserialize(s::Serialization.Serializer{IOStream}, b::Int32)
    @ Serialization C:\Users\kool7\AppData\Local\Programs\Julia-1.7.0\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:907
  [7] deserialize
    @ C:\Users\kool7\AppData\Local\Programs\Julia-1.7.0\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:801 [inlined]
  [8] deserialize(s::IOStream)
    @ Serialization C:\Users\kool7\AppData\Local\Programs\Julia-1.7.0\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:788
  [9] open(f::typeof(Serialization.deserialize), args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base .\io.jl:330
 [10] open(f::Function, args::String)
    @ Base .\io.jl:328
 [11] top-level scope
    @ C:\Users\kool7\.julia\packages\ProtoSyn\oMTj9\src\Peptides\Calculators\Calculators.jl:9
in expression starting at C:\Users\kool7\.julia\packages\ProtoSyn\oMTj9\src\Peptides\Calculators\Calculators.jl:1
in expression starting at C:\Users\kool7\.julia\packages\ProtoSyn\oMTj9\src\Peptides\Peptides.jl:1
in expression starting at C:\Users\kool7\.julia\packages\ProtoSyn\oMTj9\src\ProtoSyn.jl:2

Here is where the error is pointing:

module Calculators

    using ProtoSyn.Peptides
    using Serialization
    using Polynomials

    phi_file = joinpath(Peptides.resource_dir, "ramachandran/phi-potential.jls")
    psi_file = joinpath(Peptides.resource_dir, "ramachandran/psi-potential.jls")
    phi_potential = open(deserialize, phi_file)  <---------------------------------------------
    psi_potential = open(deserialize, psi_file)

    include("Caterpillar/Caterpillar.jl")
    include("restraints.jl")
    include("hydrogen_bonds.jl")
end

Error compiling BioMakie.jl using ProtoSyn

Trying to compile BioMakie.jl with this included, and can't get it to compile :(
Unfortunate because I wanted to show visualizations for ProtoSyn at JuliaCon.

| Loading ONNX models
ERROR: LoadError: InitError: Evaluation into the closed module `GB` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `GB` with `eval` during precompilation - don't do this.
Stacktrace:
  [1] eval
    @ .\boot.jl:370 [inlined]
  [2] __init__()
    @ ProtoSyn.Calculators.GB C:\Users\kool7\.julia\packages\ProtoSyn\eECH1\src\Core\Calculators\gb.jl:21
  [3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1115
  [4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1061
  [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1506
  [6] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1783
  [7] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
  [8] macro expansion
    @ .\loading.jl:1648 [inlined]
  [9] macro expansion
    @ .\lock.jl:267 [inlined]
 [10] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
 [11] include
    @ .\Base.jl:457 [inlined]
 [12] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base .\loading.jl:2049
 [13] top-level scope
    @ stdin:3
during initialization of module GB

ERROR: InitError: MethodError: Cannot `convert` an object of type Umlaut.Tape{ONNX.ONNXCtx} to an object of type Ghost.Tape

When I run using ProtoSyn, I get the following error:

ERROR: InitError: MethodError: Cannot `convert` an object of type 
  Umlaut.Tape{ONNX.ONNXCtx} to an object of type 
  Ghost.Tape

I have just freshly installed Julia 1.8.3, added https://github.com/sergio-santos-group/ProtoSyn.jl.git with Pkg, then in the .julia/conda directory pip-installed torch and torchani as per the warning ProtoSyn prints on the first run.

Stacktrace
 | Loading TorchANI
 | Loading ONNX models
ERROR: InitError: MethodError: Cannot `convert` an object of type 
  Umlaut.Tape{ONNX.ONNXCtx} to an object of type 
  Ghost.Tape
Closest candidates are:
  convert(::Type{T}, ::T) where T at Base.jl:61
  Ghost.Tape(::C) where C at C:\Users\username\.julia\packages\Ghost\WYs14\src\tape.jl:220
Stacktrace:
 [1] convert(#unused#::Type{Union{Nothing, Ghost.Tape}}, x::Umlaut.Tape{ONNX.ONNXCtx})
   @ Base .\some.jl:36
 [2] ProtoSyn.Calculators.GB.GBModels(C::Umlaut.Tape{ONNX.ONNXCtx}, N::Umlaut.Tape{ONNX.ONNXCtx}, H::Umlaut.Tape{ONNX.ONNXCtx}, O::Umlaut.Tape{ONNX.ONNXCtx}, S::Umlaut.Tape{ONNX.ONNXCtx})
   @ ProtoSyn.Calculators.GB C:\Users\username\.julia\packages\ProtoSyn\21g26\src\Core\Calculators\gb.jl:9
 [3] top-level scope
   @ none:1
during initialization of module GB

If I run using ProtoSyn again, it doesn't throw an error, however, the energy_function(pose) (from the Example 4) then throws an error TypeError: in keyword argument models, expected ProtoSyn.Calculators.GB.GBModels, got a value of type Nothing, which I suppose has to do something with not having been able to initialise the module GB in the first try.

Sidechains organization

Should sidechain information be part of a pre-existing structure, such as metadata?
As an example, block information for Blockrot movements (in BlockrotMutator) are loaded and stored as part of Metada, in metadata.blocks.
Should sidechains exist in a similar fashion (metadata.sc or metadata.sidechains)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.