pyrosetta_help.ligands package
Submodules
pyrosetta_help.ligands.hunter module
- class pyrosetta_help.ligands.hunter.LigandHunter(sequence: str)[source]
Bases:
object
Given a sequence find homologues (Blast) and find if they have ligands (PDBe API). The definition of what ligand is a cofactor comes from PDBe and does not count ions or triphospho-nucleotides as cofactors, but does count NADH adducts.
.data
is a list of dictionaries..to_dataframe()
converts into a pandas dataframe for further analysis..candidate_ligands
list of ligand residue 3-letter codes
- property candidate_ligands: List[str]
- property cofactor_codes
- property cofactor_reference: Dict[str, List[dict]]
- get_pdb_entry_by_ligand(ligand_code: str) dict [source]
get pdb entry by ligand. Returns the first, which should be lowest e-value
- property ligand_data
Data for the ligands.
Note that LigandNicker has a get smiles method, that works like this, but is unrelated.
- missing_codes = ['ATP', 'GTP', 'CA', 'MG', 'W']
pyrosetta_help.ligands.load module
- pyrosetta_help.ligands.load.get_smiles(ligand_code: str) str [source]
Get the smiles of a ligand. Remember that PDBe smiles need to charged to pH 7.
- pyrosetta_help.ligands.load.parameterized_pose_from_file(pdb_filename, wanted_ligands: List[str] | Dict[str, str | None] = (), force_parameterisation: bool = False, neutralize_params: bool = True, save_params: bool = True, overriding_params=()) Pose [source]
pose loading, the circutous way to not lose ligand or use PDB_component. Assumes all mystery components are PDB residues. Works best with ignore_unrecognized_res False
- Parameters:
pdb_filename –
wanted_ligands – a list of three-letter codes (PDB chemcomponent identifiers) or a dictionary of three-letter codes to None or smiles
force_parameterisation –
neutralize_params – protonated for pH 7
save_params –
overriding_params – list of params filenames
- Returns:
- pyrosetta_help.ligands.load.parameterized_pose_from_pdbblock(pdbblock: str, wanted_ligands: List[str] | Dict[str, str | None] = (), force_parameterisation: bool = False, neutralize_params: bool = True, save_params: bool = True, overriding_params=()) Pose [source]
pose loading, the circutous way to not loose ligand or use PDB_component. Assumes all mystery components are PDB residues. Works best with ignore_unrecognized_res False
- Parameters:
pdbblock –
wanted_ligands – a list of three letter codes or a dictionary of three letter codes to None or smiles
force_parameterisation –
neutralize_params – protonated for pH 7
save_params –
overriding_params – list of params filenames
- Returns:
pyrosetta_help.ligands.nick module
- class pyrosetta_help.ligands.nick.LigandNicker(pdb_filename: None | str = None, pdb_filehandle: IOBase | None = None, pdb_block: None | str = None, pose: Pose | None = None, chain: str = 'A', wanted_ligands: List[str] = (), force_parameterisation: bool = False, neutralize_params: bool = True, save_params: bool = True, overriding_params=())[source]
Bases:
object
Given a pdb_file (regular initialisation) or code (
.from_pdbcode
classmethod) and a list of 3-letter codes of wanted residues (wanted_ligands
argument), it loads it as Pyrosetta Pose (donor_pose
), ready formigrate
to loads the acceptor_pose and nick the residues that are wanted.If
force_parameterisation
is on it or the residue is novel it parameterises it.- __init__(pdb_filename: None | str = None, pdb_filehandle: IOBase | None = None, pdb_block: None | str = None, pose: Pose | None = None, chain: str = 'A', wanted_ligands: List[str] = (), force_parameterisation: bool = False, neutralize_params: bool = True, save_params: bool = True, overriding_params=())[source]
Initialisation loads the donor.
migrate
loads the acceptor.Unfortunately, I originally wrote it to use pdb_filename only. I should have written the init to accept a pose and a class method the filename. And now some chucks of out there in the wild use pdb_filename. So I could not switch it to something generic. Now it accepts four possible alternative choices: pdb_filename, pdb_filehandle, pdb_block, pose.
- Parameters:
pdb_filename –
pdb_filehandle –
pdb_block –
pose –
chain –
wanted_ligands –
force_parameterisation –
neutralize_params – pH 7 protonation
save_params –
overriding_params – overide paramaterisation and use provide params
- get_mapping_between_poses(index_list: List[int]) Dict[int, int] [source]
Given a list of indices for one pose, return their aligned equivalents in the second. Modded to be donor_pose –> acceptor_pose
- migrate(acceptor_pose: Pose, acceptor_chain: str = 'A', constrained: bool = True, relaxed: bool = True, relax_radius: int = 20, relax_cycles: int = 3)[source]
The acceptor pose is the non-empty pose.
This method aligns the sequences of the acceptor and donor pose. It finds the mapping of the neighbourhood of the wanted residues of the donor_pose It superimposes the poses by those residues. It adds the residues that need nicking. It adds constraints (optionally) based on the hydrogen bonding of the residues around the wanted residues. onto the
.acceptor_pose
. To check:>>> print( len(self.acceptor_pose.constraint_set().get_all_constraints()) )
It then optionally relaxes the neighbourhood.
- Parameters:
acceptor_pose –
acceptor_chain –
constrained –
relaxed –
relax_radius –
relax_cycles –
- Returns: