- Get the latest version of BOSS
- Download it and uncompress it into this directory
- Either create a new environment
conda create --name ligpargenor 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/LigParGenpython $LigParGen/Converter.pyand then the ligpargen command
- LigParGen uses a c-like syntax interpreter, so you'll have to ask the superuser on a machine to install
cshif it's already notsudo 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!
- 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:latestdocker save -o ./ligpargen.tar ligpargen:latest
- Then you must move the
ligpargen.tarfile to your cluster in a folder in your home directory calledcontainers, and then everything else is done inside hitpoly (with platform set to 'supercloud').
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