binana.output package

A few functions to output BINANA analysis.

Submodules

binana.output.csv module

binana.output.csv.collect(data)[source]

Collects all the characterized interactions between the protein and ligand into a CSV-formatted string.

Parameters

data (dict) – A dictionary containing information about all the interactions. The output of collect()

Returns

A CSV-formatted string containing the same information present in the input dictionary.

Return type

str

binana.output.dictionary module

binana.output.dictionary.collect(closest=None, close=None, hydrophobics=None, hydrogen_bonds=None, halogen_bonds=None, salt_bridges=None, metal_coordinations=None, pi_pi=None, cat_pi=None, electrostatic_energies=None, active_site_flexibility=None, ligand_atom_types=None, ligand_rotatable_bonds=None)[source]

Collects all the characterized interactions between the protein and ligand into one dict object, suitable for conversion to JSON.

Parameters
  • closest (dict, optional) – A dictionary containing information about the closest protein/ligand interactions. Defaults to None.

  • close (dict, optional) – A dictionary containing information about the close protein/ligand interactions. Defaults to None.

  • hydrophobics (dict, optional) – A dictionary containing information about the hydrophobic protein/ligand interactions. Defaults to None.

  • hydrogen_bonds (dict, optional) – A dictionary containing information about the hydrogen bonds between the protein and ligand. Defaults to None.

  • halogen_bonds (dict, optional) – A dictionary containing information about the halogen bonds between the protein and ligand. Defaults to None.

  • salt_bridges (dict, optional) – A dictionary containing information about the salt-bridges protein/ligand interactions. Defaults to None.

  • metal_coordinations (dict, optional) – A dictionary containing information about the metal-coordination protein/ligand interactions. Defaults to None.

  • pi_pi (dict, optional) – A dictionary containing information about the pi-pi (stacking and T-shaped) protein/ligand interactions. Defaults to None.

  • cat_pi (dict, optional) – A dictionary containing information about the pi-cation protein/ligand interactions. Defaults to None.

  • electrostatic_energies (dict, optional) – A dictionary containing information about the electrostatic energies between protein and ligand atoms. Defaults to None.

  • active_site_flexibility (dict, optional) – A dictionary containing information about the flexibility of ligand-adjacent protein atoms. Defaults to None.

  • ligand_atom_types (dict, optional) – A dictionary containing information about the ligand atom types. Defaults to None.

  • ligand_rotatable_bonds (int, optional) – The number of ligand rotatable bonds. Defaults to None.

Returns

A dictionary describing all the detected interactions, suitable for conversion to JSON.

Return type

dict

binana.output.dictionary.collect_all(all_interactions)[source]

Collects all the characterized interactions between the protein and ligand into one dict object, suitable for conversion to JSON. This function simply unpacks the contents of all_interactions and passes them to collect().

Parameters

all_interactions (dict) – A single dictionary containing information about all the protein/ligand interactions. The output of get_all_interactions()

Returns

A dictionary describing all the detected interactions, suitable for conversion to JSON.

Return type

dict

binana.output.pdb_file module

binana.output.pdb_file.write(ligand, receptor, closest=None, close=None, hydrophobics=None, hydrogen_bonds=None, halogen_bonds=None, salt_bridges=None, metal_coordinations=None, pi_pi=None, cat_pi=None, active_site_flexibility=None, log_output=None, as_str=None, pdb_filename=None)[source]

Writes a single PDB file containing the ligand, receptor, and atoms that participate in various interactions (with distinct resnames).

Parameters
  • ligand (binana._structure.mol.Mol) – The ligand molecule object.

  • receptor (binana._structure.mol.Mol) – The receptor molecule object.

  • closest (dict, optional) – A dictionary containing information about the closest protein/ligand interactions. Defaults to None.

  • close (dict, optional) – A dictionary containing information about the close protein/ligand interactions. Defaults to None.

  • hydrophobics (dict, optional) – A dictionary containing information about the hydrophobic protein/ligand interactions. Defaults to None.

  • hydrogen_bonds (dict, optional) – A dictionary containing information about the hydrogen bonds between the protein and ligand. Defaults to None.

  • halogen_bonds (dict, optional) – A dictionary containing information about the halogen bonds between the protein and ligand. Defaults to None.

  • salt_bridges (dict, optional) – A dictionary containing information about the salt-bridges protein/ligand interactions. Defaults to None.

  • metal_coordinations (dict, optional) – A dictionary containing information about the metal-coordination protein/ligand interactions. Defaults to None.

  • pi_pi (dict, optional) – A dictionary containing information about the pi-pi (stacking and T-shaped) protein/ligand interactions. Defaults to None.

  • cat_pi (dict, optional) – A dictionary containing information about the pi-cation protein/ligand interactions. Defaults to None.

  • active_site_flexibility (dict, optional) – A dictionary containing information about the flexibility of ligand-adjacent protein atoms. Defaults to None.

  • log_output (str, optional) – The log text, returned from collect(). Defaults to "".

  • as_str (bool, optional) – Whether to save the file to the disk (or fake disk in case of JavaScript), or to return the contents as a string. Defaults to False.

  • pdb_filename (str, optional) – The name of the file where the pdb should be saved, assuming as_str is False. Defaults to “results.pdb”.

Returns

The contents of the PDB file if as_str is True. Otherwise, "".

Return type

str

binana.output.pdb_file.write_all(ligand, receptor, all_interactions, log_output=None, as_str=None, pdb_filename=None)[source]

Writes a single PDB file containing the ligand, receptor, and atoms that participate in various interactions (with distinct resnames). This function simply unpacks the contents of all_interactions and passes them to write().

Parameters
  • ligand (binana._structure.mol.Mol) – The ligand molecule object.

  • receptor (binana._structure.mol.Mol) – The receptor molecule object.

  • all_interactions (dict) – A single dictionary containing information about all the protein/ligand interactions. The output of get_all_interactions()

  • log_output (str, optional) – The log text, returned from collect(). Defaults to "".

  • as_str (bool, optional) – Whether to save the file to the disk (or fake disk in case of JavaScript), or to return the contents as a string. Defaults to False.

  • pdb_filename (str, optional) – The name of the file where the pdb should be saved, assuming as_str is False. Defaults to “results.pdb”.

Returns

The contents of the PDB file if as_str is True. Otherwise, "".

Return type

str