Giter Site home page Giter Site logo

prolint / prolintpy Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 1.46 MB

A python package for the automated analysis and visualization of lipid-protein interactions.

Home Page: https://prolint.github.io/prolintpy

License: MIT License

Python 100.00%
lipid-protein-interactions molecular-dynamics molecular-dynamics-simulation interactive-visualizations automated-analysis

prolintpy's Introduction

logo

A web-based tool to analyze and visualize lipid-protein interactions.

Installation

This is the source-code for the ProLint Webserver.

Install Docker

You need to have Docker installed first, in order to install ProLint.

Install ProLint

To install ProLint locally, all you have to do is download/clone the repository:

git clone https://github.com/ProLint/ProLint.git

and then execute:

cd ProLint
docker-compose up

The main and only installation command is docker-compose up. It will create a Docker build that contains all of the software packages, python libraries and environment configuration required by ProLint to work. As such, this will take a few minutes to finish.

You may get warning and notifications about missing files, but they are harmless. If Docker asks to share the image, make sure to click Share It (I think this is Windows specific).

When installation finishes, open a browser and navigate to: 127.0.0.1:8000 (not 0.0.0.0:8000).

Note that Docker has a default memory allocation that it uses. So if you submit large (and multiple) files make sure to increase the memory allocation otherwise the calculations will fail, with the following error: WorkerLostError: Worker exited prematurely: signal 9 (SIGKILL).

Docker Installation Tested

The installation process above has been test on MacOS and confirmed to work. Linux should work too. I assume WSL 2 would also work, although I have not tested it yet.

If you are using Windows OS directly (e.g., through the command prompt, or powershell, or anaconda prompt for windows), then you may get errors because of the different line-ending termination. To fix this, you need to tell git to keep line endings as they are. You can do that globally or on a per-repo basis. The instructions below are for configuring git globally, but if you want to do it for the repo specifically please read here for instructions.

# Windows users
git config --global core.autocrlf input
docker-compose up --build

Installation from source

You can also install ProLint directly from source. You can use the provided environment.yml file to create the conda environmet. You'll also need to have gromacs installed and sourced for g_surf to work (if you do not need thickness&curvature app, then you can skip this). Once you have all dependencies installed, you should activate your new conda environment and do the following: Open the terminal and run the redis server:

# simply execute: 
redis-server

Then you need to open prolint/settings.py and change the CELERY_BROKER_URL and CELERY_RESULT_BACKEND variables like so:

CELERY_BROKER_URL = os.environ.get("CELERY_BROKER", "redis://127.0.0.1:6379")
CELERY_RESULT_BACKEND = os.environ.get("CELERY_BROKER", "redis://127.0.0.1:6379")

After that, you will need to open another terminal, navigate to the root django directory (that's the directory that contains manage.py in it) and execute:

# run the celery worker, if you have celery version 4:
celery -A prolint worker -l info

# run the celery worker, if you have celery version 5: 
celery --app prolint worker --loglevel=info

# if you are on windows - for which celery has dropped support since version 4, 
# you will need to install a program like gevent and run the command like this: 
# celery -A prolint worker -l info -P gevent              # v4
# celery --app prolint worker --loglevel=info -P gevent   # v5

Once that is done, you have to open a third terminal, navigate to the root django directory and run the django server:

python manage.py managemigrations
python manage.py migrate
python manage.py runserver

Of course you can run these commands in the background so you do not need to have three terminals open, but for ProLint to work you need at least the following components: the django web application, celery to run tasks asynchronously, and a message broker such as redis to keep track of submitted tasks. This is why the docker installation is preferred, because it reduces installation to one single command.

Important things to know

The following are a list of things I think are important to know:

  • The docker build will show useful information about your session, and you can use terminals to access the docker images.
  • Celery output is saved on the logs/celery.log file, so keep an eye on that when you submit jobs.
  • Submissions are saved in the media/user-data/prolint folder. They are not deleted automatically yet, so please keep an eye on that.
  • The functions to download and delete submissions are kept, but their usefulness is limited since now you have the data locally. The reason why these buttons are kept is clear from the development roadmap provided below.

Roadmap

ProLint is the result of a lot of work and it already provides many features. It is also in very active development and the following is a rough roadmap of what is planned to come to ProLint:

  • A cleaner installation without the notifications and warning messages given by Docker currently.
  • Full support for atomistic simulations. Currently, atomistic data are supported as a beta-feature and we want to fix bugs and add stability to fully handle data at this resolution.
  • Martini 3 should be supported already, but we still need to test it.
  • Allow the user to specify residues manually in the submission form.
  • Provide additional metric support and add the ability for the user to select the preferred ones.
  • Provide support for systems containing multiple different proteins. Currently, support for these systems is partial.
  • Support user-requested features.

Roadmap: support for deployment on local networks.

This can already be done, but the current config is not secure. We want to allow people to deploy ProLint on a local network where multiple users/members of research groups can use it. For this reason, ProLint already has a working setup with support for secure user accounts and individual pages to track all the submitted jobs and ability to make them available to other members of the local network. This allows members of a group, for example, to share data with others, prepare for group meetings, use the data during presentations (e.g. during zoom calls), and in general, collaborate. This functionality already exists and has been implemented in ProLint but currently it has been disabled!

Development

All you need to contribute to the development of ProLint is open the ProLint directory with a code editor such as VS Code. Your saves will automatically trigger docker to autoload the build and update the website. These updates are, however, not transmitted when you make changes to the calcul app which is used by Celery. Celery auto-reload on file save is on the to-do list, however.

Bug report

Please feel free to open an issue or contact us if you encounter any problem or bug while working with ProLint.

Citation

ProLint is research software. If you make use of it in work which you publish, please cite it. The BibTeX reference is

@article{10.1093/nar/gkab409,
    author = {Sejdiu, Besian I and Tieleman, D Peter},
    title = "{ProLint: a web-based framework for the automated data analysis and visualization of lipid–protein interactions}",
    journal = {Nucleic Acids Research},
    year = {2021},
    month = {05},
    issn = {0305-1048},
    doi = {10.1093/nar/gkab409},
    url = {https://doi.org/10.1093/nar/gkab409},
    note = {gkab409},
    eprint = {https://academic.oup.com/nar/advance-article-pdf/doi/10.1093/nar/gkab409/38270894/gkab409.pdf},
}

prolintpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

prolintpy's Issues

Attribute error while trying to import prolintpy

I have installed prolintpy using the third method outlined in the documentation. I ran into an import error while trying to import prolintpy, as detailed in the previous issue (#6 ) that has been kept open by you. I thought the problem would be resolved after following the solution outlined in the thread but now I'm getting this

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_8570/3457557373.py in <module>
      1 import mdtraj as md
----> 2 import prolintpy as pl

~/anaconda3/envs/prolint/lib/python3.7/site-packages/prolintpy/__init__.py in <module>
      5 from .vis.show_points import show_points
      6 from .vis.show_network import show_network
----> 7 from .vis.show_contact_projection import show_contact_projection
      8 from .vis.show_distances import show_distances
      9 from .vis.show_radar import show_radar

~/anaconda3/envs/prolint/lib/python3.7/site-packages/prolintpy/vis/show_contact_projection.py in <module>
      4 from matplotlib.pyplot import cm
      5 
----> 6 import nglview as nv
      7 
      8 from prolintpy.utils.shift_range import shift_range

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/__init__.py in <module>
      2 
      3 # for doc
----> 4 from . import adaptor, datafiles, show, widget
      5 from ._version import get_versions
      6 from .adaptor import *

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/show.py in <module>
     11                       RdkitStructure,
     12                       TextStructure)
---> 13 from .widget import NGLWidget
     14 
     15 __all__ = [

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/widget.py in <module>
     17 import traitlets
     18 
---> 19 from . import color, interpolate
     20 from .adaptor import Structure, Trajectory
     21 from .component import ComponentViewer

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/color.py in <module>
    112 
    113 
--> 114 ColormakerRegistry = _ColormakerRegistry()

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/base.py in getinstance()
      8     def getinstance():
      9         if cls not in instances:
---> 10             instances[cls] = cls()
     11         return instances[cls]
     12     return getinstance

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/color.py in __init__(self, *args, **kwargs)
     45         try:
     46             get_ipython() # only display in notebook
---> 47             self._ipython_display_()
     48         except NameError:
     49             pass

~/anaconda3/envs/prolint/lib/python3.7/site-packages/nglview/color.py in _ipython_display_(self, **kwargs)
     52         if self._ready:
     53             return
---> 54         super()._ipython_display_(**kwargs)
     55 
     56     def __repr__(self):

AttributeError: 'super' object has no attribute '_ipython_display_'

I don't why this is happening. I am also very new to Jupyter. Help would be great!

Saving heatmaps

Is there a way to save snapshots of the interactive heatmaps? This would be very useful.

key errors for lipidnames in local version

Hello,

I have been trying to use prolintpy locally in jupyter to look at an atomistic system with a rather complex membrane. If I just follow the tutorial on the contact analysis (except for changing the resolution to 'atomistic') it prints out all the correct lipidnames with lipids.lipid_names()

array(['CHL1', 'PDOPE', 'PAPS', 'PLPC', 'PLA20', 'POPI2', 'POPE', 'SAPS',
'SAPE', 'DPPC', 'POPC', 'PSM'], dtype=object)

However, when I try to use those same lipids it returns key errors (see screenshot). This is true for most lipids I tested, except for POPC. When I submit this to the webserver it seems to work without issues. Could this be a version error? I installed prolintpy via pip install today (3rd Sep. 2021).

Many thanks!
Stefan

Screenshot from 2021-09-03 16-42-01_cropped

Using Prolint for Lipid Analysis

I was wondering how to apply Prolint to an atomistic trajectory of a protein with a ligand.
The Tutorial indicates this is possible: https://prolint.github.io/prolintpy/#/ligands

I've tried loading my ligand (named 'LIG' in the topology) as a lipid with:

lipids = pl.Lipids(t.topology, resolution='atomistic', lipid_names=['LIG'])

This seems to work:

lipids.lipid_count()
{'LIG': 1}

However, running contacts.compute_neighbors gives: KeyError: 'LIG'

contacts = pl.ComputeContacts(t, proteins, lipids)
result = contacts.compute_neighbors(t, cutoff=0.5)

The full error message is attached.

What is the correct/intented way to load a ligand with Prolint?
lig_error.txt

import error

hi, i tried to install the prolintpy use your thirdth methods and success. But when i import the prolintpy, the error occur as follows:
屏幕截图 2022-04-11 195753

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.