PyMOLSplitChainsAndLigands.py - Split macromolecule into chains and ligands
PyMOLSplitChainsAndLigands.py [--chainIDs <First, All or ID1,ID2...>] [--ligandIDs <Largest, All or ID1,ID2...>] [--ligandFileFormat <PDB, SDF, MDLMOL>] [--mode <Chains or ChainsLigands>] [--keepInorganics <yes or no>] [--keepSolvents <yes or no>] [--overwrite] [-w <dir>] -i <infile>
PyMOLSplitChainsAndLigands.py -h | --help | -e | --examples
Spit a macromolecule into chains and ligands, and write them out to different files. The solvents and inorganic molecules may be optionally removed from chains. You may also skip the generation of ligand files and write out a chain along with associated ligands into the same chain file.
The supported input file format is: PDB (.pdb), CIF (.cif)
The supported output file formats are: Chains - PDB (.pdb); Ligands: PDB (.pdb), SD file (.sdf, .sd), MDL MOL (.mol)
The names of the output files are automatically generated from the name of input file as shown below:
List of chain IDs for splitting input file. Possible values: First, All, or a comma delimited list of chain IDs. The default is to use all chain IDs in input file.
Print this help message.
Input file name.
List of ligand IDs present in chains for splitting input file. Possible values: Largest, All, or a comma delimited list of ligand IDs. The default is to use the largest ligand present in all or specified chains in input file. This option is ignored during 'Chains' value of '--mode' option.
Ligands are identified using organic selection operator available in PyMOL. It'll also identify buffer molecules as ligands. The largest ligand contains the highest number of heavy atoms.
Ligand file format.
Split input file into chains or chains and ligands. The ligands are kept together with chains in the output files for 'Chains' mode. Separate files are generated for ligands during 'ChainsAndLigands' mode.
Keep inorganic molecules during splitting of input file and write them to output files. The inorganic molecules are identified using inorganic selection operator available in PyMOL.
Keep solvent molecules during splitting of input file and write them to output files. The solvent molecules are identified using solvent selection operator available in PyMOL.
Overwrite existing files.
Location of working directory which defaults to the current directory.
To split a macromolecule into the first chain and the largest ligand in the first chain along with solvent and inorganic molecules, and write chain PDB and ligand SDF files, type:
To split a macromolecule into all chains and all ligands across all chains along with solvent and inorganic molecules, and write out corresponding chain and ligand files, type:
To split a macromolecule into all chains along with any associated ligands without any solvent and inorganic molecules, and write corresponding PDB files for chains and skipping generation of any ligand files, type:
To split a macromolecule into a specific chain and a specific ligand in the chain along with solvent and inorganic molecules, and write chain PDB and ligand MDLMOL files, type:
Copyright (C) 2023 Manish Sud. All rights reserved.
The functionality available in this script is implemented using PyMOL, a molecular visualization system on an open source foundation originally developed by Warren DeLano.
This file is part of MayaChemTools.
MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.