sb-ncbr / chargefw2 Goto Github PK
View Code? Open in Web Editor NEWThe core part of Atomic Charge Calculator II.
Home Page: https://acc2.ncbr.muni.cz
License: MIT License
The core part of Atomic Charge Calculator II.
Home Page: https://acc2.ncbr.muni.cz
License: MIT License
I am unable to run the code on any cif file.
I compiled the code and I make install
into a directory called chargefw2.
I created a script where I essentially just copied yall's calculate function from the flask backend.
Here is the script:
# run.py
import subprocess
import json
import os
from pathlib import Path
CHARGEFW2_DIR = Path('../chargefw2')
CHARGEFW2_BIN = CHARGEFW2_DIR / 'bin/chargefw2'
CHARGEFW2_PARAMS_DIR = CHARGEFW2_DIR / 'share/parameters'
INPUT_DIR = Path('./input')
OUTPUT_DIR = Path('./output')
def calculate(method_name, parameters_name, source, charge_out_dir):
logfile = OUTPUT_DIR / 'logs/computations'
method_file = CHARGEFW2_DIR / 'share/methods.json'
with method_file.open() as f:
method_data = json.load(f)
method_data = method_data["methods"]
args = [str(CHARGEFW2_BIN), '--mode', 'charges', '--method', method_name,
'--input-file', str(source), '--chg-out-dir', str(charge_out_dir), '--read-hetatm', '--log-file', str(logfile),
'--permissive-types']
if next(m for m in method_data if m['internal_name'] == method_name)['has_parameters']:
args.extend(['--par-file', str(CHARGEFW2_PARAMS_DIR / parameters_name)])
calculation = subprocess.run(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
print('args: ', ' '.join(calculation.args))
return calculation
if __name__=="__main__":
method = "eem"
parameter = 'EEM65_Ionescu2013_mpa_pcm.json'
source = INPUT_DIR / '2isk.cif'
print(calculate(method, parameter, source, OUTPUT_DIR))
Here is my output:
$ python run.py
args: ../chargefw2/bin/chargefw2 --mode charges --method eem --input-file input/2isk.cif --chg-out-dir output --read-hetatm --log-file output/logs/computations --permissive-types --par-file ../chargefw2/share/parameters/EEM65_Ionescu2013_mpa_pcm.json
CompletedProcess(args=['../chargefw2/bin/chargefw2', '--mode', 'charges', '--method', 'eem', '--input-file', 'input/2isk.cif', '--chg-out-dir', 'output', '--read-hetatm', '--log-file', 'output/logs/computations', '--permissive-types', '--par-file', '../chargefw2/share/parameters/EEM65_Ionescu2013_mpa_pcm.json'], returncode=3, stdout=b'', stderr=b'invalid handle passed to dlsym()\n')
I don't know what symbol is not being loaded. or failing to be found.
Here is my cmake build command:
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../chargefw2 .. -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++
-- The C compiler identification is AppleClang 12.0.5.12050022
-- The CXX compiler identification is Clang 12.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/local/lib/cmake/Boost-1.75.0/BoostConfig.cmake (found version "1.75.0") found components: program_options system filesystem
-- Found nlohmann_json: /usr/local/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.9.1")
-- Found PythonInterp: /Users/danny/miniconda3/envs/protein-ml/bin/python (found version "3.9.2")
-- Found PythonLibs: /Users/danny/miniconda3/envs/protein-ml/lib/libpython3.9.dylib
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Failed
-- Performing Test HAS_FLTO_THIN
-- Performing Test HAS_FLTO_THIN - Failed
-- Found pybind11: /usr/local/include (found version "2.6.2" )
-- Found OpenMP_C: -Xclang -fopenmp (found version "5.0")
-- Found OpenMP_CXX: -Xpreprocessor -fopenmp
-- Found OpenMP: TRUE (found version "5.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/danny/Codes/cpp/bioinformatics/ChargeFW2/build
I get the same error with and without OpenMP being linked. Any help would be much appreciated.
running cmake I get:
`CMake Error at CMakeLists.txt:24 (if):
if given arguments:
"STREQUAL" "Release"
Unknown arguments specified
-- Configuring incomplete, errors occurred!`
Hi, Tomas
thank you for your work. I have more a question on applicability of the methods to several relatively simple cases.
I am trying to assign charges of benzenethiol (and some other small sulfur-containing molecules).
In my understanding, this assignment should be possible with PEOE method: at least parameters for all atoms in the molecule are present in "PEOE_00_original.json" (also, the file contains parameters for S and all other atoms in correct hybridisation). However, neither method is shown in output of "suitable-methods" mode nor I can call charge-fw2 with "peoe" method directly.
Similar question about e.g. EEM: in the case of benzenethiol it appears inappropriate, however, at least some of EEM_* files do contain sulfur with formal bonding of the 1st order.
Is there something that I am missing in the logic of how "suitable-methods" generally works, and to which molecules I can apply charges, and to which I cannot?
Thank you,
Alex
I have a PR for this.
The output file will have the same name but with the following extension: .fw2.cif
The one feature missing is a "chargefw2" category with all the meta data needed to reproduce the calculation.
I have created a docker file that work with the master branch of the repo.
I will submit a PR.
Yo Tomas,
I need your library to write out the cif file (PR I am submitting).
I am creating a branch to do this, however, I think it would be good for us to collaborate and have python bindings to write out all files (pdb, mol2, cif).
Let me know how you want to go about this.
Danny
Hi,
I have a large dataset with thousands of mol2 files. I can get the partial charges when I upload them one-by-one, but if I upload the zipped folder on the website, I receive this error: "Invalid file provided. Supported types are common chemical formats: sdf, mol2, pdb, cif and zip or tar.gz of those." What should I do? Thanks
I am playing with your python bindings and have identified that the function call making the bindings much slower than the executable. https://github.com/krab1k/ChargeFW2/blob/bef336cfbc239c78acd7e47ad9bc476c99cca24e/src/python.cpp#L53
for pdb id 3vw0, the bindings take nearly 10 seconds to fulfill_requirements while in the executable it takes 1.3 milliseconds. This is nearly 4 orders of magnitudes slower.
I am creating a pipeline where I need to run thousands of proteins through chargefw2 and I am doing this in python so I need the bindings to be as fast as the executable.
Can you explain to me the reason why you put fulfill_requirements in the Molecule constructor and not in the charge calculation (where the method requirements are known)?
I want to refactor your bindings but first need to understand why you wrote them this way to begin with.
Thanks so much for creating this tool! I'd like to be able to integrate it into a broader pipeline that I've been working with in Google Colab. However, I've had some issues with the installation-- specifically, the cmake commands execute successfully but I'm unable to find a .../lib folder for setting the python pointer as described in the documentation. This is my first time using cmake, so any advice would be greatly appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.