Skip to content

learningmatter-mit/ligpargen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LigParGen server 2.0, Updated LigParGen version

To install LigParGen follow these steps:

  • Get the latest version of BOSS
    • Download it and uncompress it into this directory
  • Either create a new environment conda create --name ligpargen or activate your HiTPoly (or other) environment
  • Install dependencies
    • conda install openbabel -c openbabel
  • Clone this repo onto your directory
  • Navigate in the directory and pip install -e .
  • Add to your .bashrc/.zshrc the following line
    • export BOSSdir=$HOME/ligpargen/boss
  • You can also export a ligpargen path and call it as
    • export LigParGen=$HOME/ligpargen/LigParGen
    • python $LigParGen/Converter.py and then the ligpargen command
  • LigParGen uses a c-like syntax interpreter, so you'll have to ask the superuser on a machine to install csh if it's already not
    • sudo apt-get install csh
  • This worked with python up to 3.10 (and potentially more)

The main script is compiled on a 32-bit version so there might be sometimes problems for some machines that don't have Multi-Arhc support enabled by default, if that's the case, you must resort to using containers!

Okay, everything now runs on podman/docker

  • You need to have podman/docker on your workstation installed to have this work, podman, docker
  • Important!! For images to work you must uncomment the os.environ["BOSSdir"]... line in the LigParGen/Converter.py file
  • Run the following command, this will build the container image
    • podman build -t ligpargen .
  • docker build -t ligpargen .
  • If you are on an apple silicon machine or ARM-based linux one you need to ensure the image works for Intel-based environments, so run either one of these:
    • podman build --platform linux/amd64 -t ligpargen .
    • podman build --platform linux/amd64 -t ligpargen .
  • Then you must save the container image in some directory via
    • podman save -o ./ligpargen.tar ligpargen:latest
    • docker save -o ./ligpargen.tar ligpargen:latest
  • Then you must move the ligpargen.tar file to your cluster in a folder in your home directory called containers, and then everything else is done inside hitpoly (with platform set to 'supercloud').

To run LigParGen

This is a test case for a simple glyme molecule. Create and run a python script with this code with your desired smiles in the ./RUN directory and then run the commands below. The ./RUN directory already has the necessary file to test if LigParGen works.

from rdkit import Chem
from rdkit.Chem import AllChem

smiles = "COCCOC"
mol = Chem.MolFromSmiles(smiles)
mol = Chem.AddHs(mol, addCoords=True)

initial_confs = AllChem.EmbedMultipleConfs(
mol,
numConfs=1,
maxAttempts=50000,
boxSizeMult=5,
useRandomCoords=False, # use 'True' here if this doesn't generate a 3D conformation, LigParGen will fail if it doesn't have a 3D conformation
)

print(Chem.MolToMolBlock(mol),file=open(f'./poly.mol','w+'))

And then run the command in the same folder where you've saved the poly.mol file

python ../LigParGen/Converter.py -m poly.mol -o 0 -c 0 -r PLY -d . -l

or

$LigParGen/Converter.py -m poly.mol -o 0 -c 0 -r PLY -d . -l

Official page/post about the local version of ligpargen

Official post about the dockerized version of ligpargen

Info from the original github repo

About

Update LigParGen version from Leela Sriram Dodda

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors