Giter Site home page Giter Site logo

luna's People

Contributors

alexandrefassio avatar ehfassio avatar laurashub avatar luponzo86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

luna's Issues

create documentation

I'd like to create a ReadTheDocs documentation. I have done it in the past (see here) and it should be relatively straightforward.

@alexandrefassio please let me know if this works for you, or if you had other ideas/plans

advantage of LUNA?

hello authors,

I chanced across LUNA and thought it could be quite useful. the code seems quite well written too. however, I am aware of several other repos that can be used for analysing interactions within protein-ligand complexes, e.g. ProLIF or PLIP. So, I'm not sure what's the advantage of using LUNA over those alternatives, since all can be used to filter residue-ligand interactions or visualise them. Or perhaps is there a pre-print or paper that outlines LUNA's unique features?

Thanks,
Min Htoo

No module named 'Bio.__py3k' error

Hello,
Unable to install luna. I tried installing via pip and also from source. Every time I get an error that says No module named 'Bio.__py3k'. I tried installing biopython from both pip and conda. It would be greate if you could help me figure out how to get luna installed. Looking forward to hear from you.

Tutorial #1 - "Run project" failed

Hi,
Running the tutorial #1 in Jupyter notebook failed with the following message:

proj_obj = luna.projects.LocalProject(**opts)
proj_obj.run()
[2022-10-05 10:12:45]    ERROR               jobs.py:99         Required structure doesn't exist
Traceback (most recent call last):
  File "/Users/pierre/anaconda3/envs/luna-env/lib/python3.7/urllib/request.py", line 1566, in ftp_open
    fw = self.connect_ftp(user, passwd, host, port, dirs, req.timeout)
  File "/Users/pierre/anaconda3/envs/luna-env/lib/python3.7/urllib/request.py", line 1588, in connect_ftp
    persistent=False)
  File "/Users/pierre/anaconda3/envs/luna-env/lib/python3.7/urllib/request.py", line 2408, in __init__
    self.init()
  File "/Users/pierre/anaconda3/envs/luna-env/lib/python3.7/urllib/request.py", line 2420, in init
    self.ftp.cwd(_target)
  File "/Users/pierre/anaconda3/envs/luna-env/lib/python3.7/ftplib.py", line 638, in cwd
    return self.voidcmd(cmd)
  File "/Users/pierre/anaconda3/envs/luna-env/lib/python3.7/ftplib.py", line 280, in voidcmd
    return self.voidresp()
  File "/Users/pierre/anaconda3/envs/luna-env/lib/python3.7/ftplib.py", line 253, in voidresp
    resp = self.getresp()
  File "/Users/pierre/anaconda3/envs/luna-env/lib/python3.7/ftplib.py", line 248, in getresp
    raise error_perm(resp)
ftplib.error_perm: 550 Can't change directory to pub/pdb/data/structures/divided/pdb/4: No such file or directory

No module named 'luna.config'

Hi,
I get a 'ModuleNotFoundError' when running the most basic command line Intel-based MacBook Pro / MacOS X 12.4

Traceback (most recent call last):
File "luna/run.py", line 13, in
from luna.config.params import ProjectParams
ModuleNotFoundError: No module named 'luna.config'

Thanks

Import luna error

Hi!
I was trying luna package, but faced with a problem. I wanted to run this code:
`import matplotlib.pyplot as plt
import luna
import os
import time

from luna.mol.entry import MolEntry, MolFileEntry, ChainEntry

entry = MolFileEntry.from_mol_file(pdb_id="7JOZ", mol_id="CHEMBL113196", mol_file="CHEMBL113196_dock001.mol2",
mol_obj_type='openbabel', is_multimol_file=False)

input_file = "./outputs/entries.txt"
entries = list(MolFileEntry.from_file(input_file, pdb_id="7JOZ", mol_file="CHEMBL113196_dock001.mol2", mol_obj_type="openbabel"))

for e in entries:
print(e)
print()

entries[0].mol_obj.as_rdkit()`

And I got OSError: File 'C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna\interaction\config.cfg' does not exist.

The full messege looks like this:

C:\Users\User\miniconda3\envs\luna-env\python.exe C:\Users\User\Desktop\Study_projects\DDE\Luna\Luna-test.py
C:\Users\User\miniconda3\envs\luna-env\lib\openbabel_init_.py:14: UserWarning: "import openbabel" is deprecated, instead use "from openbabel import openbabel"
warnings.warn('"import openbabel" is deprecated, instead use "from openbabel import openbabel"')
Traceback (most recent call last):
File "C:\Users\User\Desktop\Study_projects\DDE\Luna\Luna-test.py", line 2, in
import luna
File "C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna_init_.py", line 2, in
from luna.projects import Project, LocalProject
File "C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna\projects.py", line 16, in
from luna.config.params import ProjectParams
File "C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna\config\params.py", line 7, in
from luna.mol.entry import *
File "C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna\mol\entry.py", line 17, in
from luna.util.default_values import (ACCEPTED_MOL_OBJ_TYPES, ENTRY_SEPARATOR,
File "C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna\util\default_values.py", line 20, in
INTERACTION_CONFIG = DefaultInteractionConfig()
File "C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna\interaction\config.py", line 98, in init
config = InteractionConfig.from_config_file(default_config_file)
File "C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna\interaction\config.py", line 54, in from_config_file
raise OSError("File '%s' does not exist." % config_file)
OSError: File 'C:\Users\User\miniconda3\envs\luna-env\lib\site-packages\luna-0.13.1-py3.7.egg\luna\interaction\config.cfg' does not exist.

Process finished with exit code 1

Maybe you know what the problem is?

Tutorial #3 little bug

Hi, I noticed a little bug in the cell #9 of tutorial #3 in which opt should be replaced by opts as below.

if not os.path.exists("%s/project_v%s.pkl.gz" % (opts["working_path"], __version__)):
    proj_obj = luna.projects.LocalProject(**opts)
    proj_obj.run()
else:
    print("Reloading project...")
    print()
    proj_obj = LocalProject.load(opts["working_path"], verbosity=3, logging_enabled=True)

Update tutorials

The current tutorials are intended for an older LUNA project. Please update with examples of how to use both EIFP and FIFP. Preferably this will also include how to include/exclude protein-ligand, protein-protein, and ligand-ligand interactions.

@mjke

Installation issue on Linux

I have followed the instructions on your readme (create conda env), activate, but when I run pip install luna, I get:

Collecting luna
Downloading luna-0.13.0.tar.gz (1.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 5.3 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
Traceback (most recent call last):
File "", line 36, in
File "", line 34, in
File "/scratch/swankowicz/pip-install-3ci9n7li/luna_04662606934745139f71d50467b3f1c4/setup.py", line 28, in
from luna.version import version
File "/scratch/swankowicz/pip-install-3ci9n7li/luna_04662606934745139f71d50467b3f1c4/luna/init.py", line 2, in
from luna.projects import Project, LocalProject
File "/scratch/swankowicz/pip-install-3ci9n7li/luna_04662606934745139f71d50467b3f1c4/luna/projects.py", line 9, in
from scipy.special import comb
ModuleNotFoundError: No module named 'scipy'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I am also getting this error with pdbecif. After installing that, pip install Luna worked.

Optimization of code: read PDB files only once if multiple entries use the same PDB file

Usually, in Docking projects, one sets N entries, where each ligand points out to a different MOL file, but to the same PDB file (all molecules were docked against the same structure, right!?). So, it'd be better if LUNA creates a cache system for PDB structures to make the PDB parsing happen only once.

The same cache system could be applied for Interactions involving residue-residue interactions. It would be much better if we save these interactions instead of recalculating the same things over and over again.

Type error in luna.projects.LocalPorject

Dear all,

Thanks for this amazing package ! I am trying to reproduce the tutorial but running this line :

luna.projects.LocalProject(**opts)

ypeError                                 Traceback (most recent call last)
/tmp/ipykernel_738485/328268586.py in 
----> 1 luna.projects.LocalProject(**opts)

[~/mambaforge/envs/luna-env/lib/python3.7/site-packages/luna/projects.py](https://vscode-remote+ssh-002dremote-002b10-002e245-002e85-002e25.vscode-resource.vscode-cdn.net/home/dafigueroa%40iit.local/Polymerases/B2_Descriptor_Polymerases/04_TempWork/tutorial/~/mambaforge/envs/luna-env/lib/python3.7/site-packages/luna/projects.py) in __init__(self, entries, working_path, **kwargs)
   1122 
   1123     def __init__(self, entries, working_path, **kwargs):
-> 1124         super().__init__(entries=entries, working_path=working_path, **kwargs)
   1125 
   1126     def _process_entry(self, entry):

TypeError: __init__() got an unexpected keyword argument 'mol_obj_type'

I just execute all the cells as they are in the original file.
I was wondering if maybe is a new change from the version0.12 to 0.13.

Best
David

No module named 'Bio._py3k'

Hi,
Installation of luna fails on MacBook Pro running macOS Monterey 12.4 (21F79) with the following message, although biopython was installed with pip previously.
No module named 'Bio._py3k'
I used pip to install luna:
pip install -U luna
Thanks
Pierre

Title of outputs containing ":"

Hello,
In the interactions outputs all the csv are named the following : protein:ligand.csv. The ":" leads to a file that i am unable to read. I don't know where exactly i can modify the output name. Thank you

Optimization of code: processing gets slow when a huge amount of entries is provided

It seems this problem happens due to I/O bottlenecks. When a small number of entries is provided, there is no problem. But as soon as the number of entries gets big, LUNA starts getting really slow according to @laurashub and @jmcki003. As a general thought, we believe it has something to do with the I/O, but we need to track the problem better to see what we can do to improve the system.

ifps with large number of protein/lig pairs

Hi --

I use a docking approach that results in the minimization of a large number of ligands (800k-1M) in a single protein and the protein is also minimized. The result is that I end up with a large list of PDBs with protein/lig pairs. I can split all of these fine and end up with PDBs of the protein and mol2 files for each ligand.

The primary question I have relates to the fact that I have a large number of distinct protein conformations along with a respective ligand. It seems that LUNA is best set up to generate IFPs for a single rigid protein and a large number of ligands.

I am happy to write my own code based on your libraries and contribute (I feel that your approach is the best I have seen so far), but I am not quite sure where to start. I would like to avoid creating projects or pickled objects and instead append the IFP onbits to a column within a dataframe (along with other descriptors) and then serialize this with apache arrow (pandas df -> arrow table -> parquet file).

I wondered if you have the time to briefly suggest some approaches where I could iteratively load protein/ligand pairs and generate IFPs. I can build this out to work with arrow.

I understand that this is probably a different use case than is intended based on your library, and you have limited time to work on it.

Thanks!

Tom

Installation errors Mac platform

Hello,

I have followed the instructions in the document but when reaching the python setup.py build step, I get this error:

ModuleNotFoundError: No module named 'Bio._py3k'`

Which I think is related to biopython? I have it installed just in case but was wondering if anyone had the same error before.

Many thanks

bug with HIE residues in ODDT (PLEC) library, that can be useful for LUNA too

The library ODDT, which includes PLEC, throws an error when reading a PDB file that contains HIE residues. ODDT can use both openbabel and RDKit, but the error only occurs when ODDT is using RDKit.
The error actually is introduced by ODDT, where a function of RDKit is redefined in order to "fix" double bonds in special residues such as HIE.
I have included a notebook and a PDB file where I show how to reproduce the error.

Bonus: it turns out that openbabel is much faster than RDKit in reading from PDB file.

ODDT_HIE_bug.zip

Issues with inconsistent valence in multiple frames in a MD trajectory

I'm having some problems running FIFP on certain frames in an MD simulation (issue_check.tar.gz)

For structures 11, 16, 21, 22, and 28 the code throws the following (or similar) error:

[14:37:41] Explicit valence for atom # 45 N, 4, is greater than permitted
2020-02-05 14:37:41,534 - Chunk 0 - root - ERROR - groups.py - _get_mol_from_entity - line 760 => Sanitization error: Explicit valence for atom # 45 N, 4, is greater than permitted
Traceback (most recent call last):
File "/home/jessica/work/keiser/ifp_v2/scripts/mol/groups.py", line 758, in _get_mol_from_entity
SanitizeMol(mol_obj, SanitizeFlags.SANITIZE_ALL)
ValueError: Sanitization error: Explicit valence for atom # 45 N, 4, is greater than permitted
2020-02-05 14:37:41,535 - Chunk 0 - root - ERROR - groups.py - _calculate_properties - line 706 => not all arguments converted during string formatting
Traceback (most recent call last):
File "/home/jessica/work/keiser/ifp_v2/scripts/mol/groups.py", line 758, in _get_mol_from_entity
SanitizeMol(mol_obj, SanitizeFlags.SANITIZE_ALL)
ValueError: Sanitization error: Explicit valence for atom # 45 N, 4, is greater than permitted

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/jessica/work/keiser/ifp_v2/scripts/mol/groups.py", line 638, in _calculate_properties
mol_obj = mol_obj or self._get_mol_from_entity(target_compound.get_parent_by_level('M'), compound_selector)
File "/home/jessica/work/keiser/ifp_v2/scripts/mol/groups.py", line 762, in _get_mol_from_entity
"RDKit. Check the logs for more information." % mol_file)
TypeError: not all arguments converted during string formatting

While these structures do produce a fingerprint, the resulting fingerprint is significantly more sparse than other structures which do not exhibit errors (see structures 20 and 21).

Note: execute script after changing the path to FIFP using python test_auto_fifp.py

Proximal-only pymol sessions do not include ligand

I noticed when you set proximal-only interactions and then try to save a pymol session the resulting pymol session only shows the protein. Can you add the ligand and the interactions between the protein and the ligand to this session?

Installation error on window

Hello,
I installed it according to the steps you gave,but when i use ### pip install luna, i get this error :

(luna-env) PS E:\论文\图神经网络\LUNA\LUNA-master> pip install luna
WARNING: Ignoring invalid distribution -tkinter-pymol (d:\anaconda3\envs\luna-env\dlls)
WARNING: Ignoring invalid distribution -tkinter-pymol (d:\anaconda3\envs\luna-env\dlls)
Collecting luna
Using cached luna-0.12.2.tar.gz (1.4 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
D:\Anaconda3\envs\luna-env\lib\openbabel_init_.py:15: UserWarning: "import openbabel" is deprecated, instead use "from openbabel import openbabel"
warnings.warn('"import openbabel" is deprecated, instead use "from openbabel import openbabel"')
'gbk' codec can't decode byte 0x98 in position 4512: illegal multibyte sequence
Traceback (most recent call last):
File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\util\config.py", line 27, in init
self.config.read(config_file)
File "D:\Anaconda3\envs\luna-env\lib\configparser.py", line 696, in read
self._read(fp, filename)
File "D:\Anaconda3\envs\luna-env\lib\configparser.py", line 1014, in _read
for lineno, line in enumerate(fp, start=1):
UnicodeDecodeError: 'gbk' codec can't decode byte 0x98 in position 4512: illegal multibyte sequence
Traceback (most recent call last):
File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\util\config.py", line 27, in init
self.config.read(config_file)
File "D:\Anaconda3\envs\luna-env\lib\configparser.py", line 696, in read
self._read(fp, filename)
File "D:\Anaconda3\envs\luna-env\lib\configparser.py", line 1014, in _read
for lineno, line in enumerate(fp, start=1):
UnicodeDecodeError: 'gbk' codec can't decode byte 0x98 in position 4512: illegal multibyte sequence

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 36, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\setup.py", line 28, in <module>
      from luna.version import version
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\__init__.py", line 2, in <module>
      from luna.projects import Project, LocalProject
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\projects.py", line 16, in <module>
      from luna.config.params import ProjectParams
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\config\params.py", line 7, in <module>
      from luna.mol.entry import *
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\mol\entry.py", line 16, in <module>
      from luna.util.default_values import ACCEPTED_MOL_OBJ_TYPES, ENTRY_SEPARATOR, ARTIFACTS_LIST
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\util\default_values.py", line 20, in <module>
      INTERACTION_CONFIG = DefaultInteractionConfig()
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\interaction\config.py", line 80, in __init__
      config = InteractionConfig.from_config_file(default_config_file)
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\interaction\config.py", line 46, in from_config_file
      params = Config(config_file)
    File "C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\util\config.py", line 30, in __init__
      raise IOError('Configuration file %s not read.' % config_file)
  OSError: Configuration file C:\Users\oasis\AppData\Local\Temp\pip-install-6gyd323a\luna_d2256ffdc9fa41c98de5ae4da1ca0758\luna\interaction/config.cfg not read.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: Ignoring invalid distribution -tkinter-pymol (d:\anaconda3\envs\luna-env\dlls)
WARNING: Ignoring invalid distribution -tkinter-pymol (d:\anaconda3\envs\luna-env\dlls)
WARNING: Ignoring invalid distribution -tkinter-pymol (d:\anaconda3\envs\luna-env\dlls)

Many thanks

create a PyPI package

To make the process of creating a PyPI package easier, I think it woud be better to organize the package in a more canonical, "Pythonic" way. This means having a luna/ folder, instead of scripts/, and __init__.py files in every (sub)modules (so you can import luna package with import luna). See for instance e3fp and rhapsody. It should be easy to do, and I can help with that, by I don't want to touch the base code, so I will leave this to @alexandrefassio
Next, we need to create a setup.py file in the root folder and a requirements.txt file that lists the required packages.

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.