pyCADD.Dock package

Subpackages

Submodules

pyCADD.Dock.cli module

pyCADD.Dock.common module

class pyCADD.Dock.common.PDBLine(line: str)[source]

Bases: object

__init__(line: str) None[source]

One line in a pdb file

Parameters:

line (str) – one line in a pdb file

property is_atom_line: bool
property is_amino: bool
property is_hetatm: bool
property is_conect: bool
property is_ter: bool
property is_end: bool
property line: str
get_line() str[source]

Get the line string from current attributes

Returns:

line string

Return type:

str

get_atom_name() str[source]

Get the atom name from the line

Returns:

atom name

Return type:

str

class pyCADD.Dock.common.PDBLineParser(pdb_str: str = None, pdb_file: str = None)[source]

Bases: object

__init__(pdb_str: str = None, pdb_file: str = None) None[source]

Parse pdb file string or file.

Parameters:
  • pdb_str (str, optional) – pdb string. Defaults to None.

  • pdb_file (str, optional) – pdb file path. Required if pdb_str is not provided. Defaults to None.

Raises:

ValueError – Either pdb_str or pdb_file must be provided.

get_lines()[source]

Get a list of all lines parsed from the pdb file.

Returns:

pdb line object list

Return type:

list[PDBLine]

get_atom_lines()[source]

Get a list of atom line objects parsed from the pdb file.

Returns:

atom line object list

Return type:

list[PDBLine]

get_amino_lines()[source]

Get a list of amino acid line objects parsed from the pdb file. Amino acid line is defined as the line with record name ‘ATOM’ and res_name in AMINO_ACIDS

Returns:

amino acid line objects list

Return type:

list[PDBLine]

get_hetatm_lines()[source]

Get a list of HETATM line objects parsed from the pdb file.

Returns:

HETATM line objects list

Return type:

list[PDBLine]

get_str_list()[source]

Get a list of pdb line strings.

Returns:

pdb line strings list

Return type:

list[str]

save_pdb(file_path)[source]

Save the pdb file to the file_path

Parameters:

file_path (str) – file path to save the pdb file

class pyCADD.Dock.common.PDBFile(path: str)[source]

Bases: File

__init__(path: str) None[source]

PDB file class

Parameters:

path (str) – file path string

get_lines(return_str: bool = False) list | str[source]

Get the pdb file content as a list of lines or a string

Parameters:

return_str (bool, optional) – get the string instead of list[str]. Defaults to False.

Returns:

pdb file content

Return type:

list|str

get_chain(chain_id: str, return_str: bool = False) list | str[source]

Get the pdb file content of a single chain

Parameters:
  • chain_id (str) – chain id

  • return_str (bool, optional) – get the string instead of list[str]. Defaults to False.

Returns:

pdb file content of a single chain

Return type:

str

class pyCADD.Dock.common.EnsembleInputFile(path: str)[source]

Bases: File

__init__(path: str) None[source]

Input file class for ensemble docking

Parameters:

path (_type_) – file path

property pdbid_list: list
property ligand_list: list
classmethod from_csv(file_path: str, sep: str = ',', header: bool = False) EnsembleInputFile[source]

Parse input file as csv format

Parameters:
  • file_path (str) – csv file path

  • sep (str, optional) – separator. Defaults to ‘,’.

  • header (bool, optional) – whether the csv file has header. Defaults to None.

csv examples:

` 1XJ7,DHT 1XQ3,R18 2AM9,TES 2AM9,DTT 2YLP,TES 2YLP,056 `

Returns:

instance of EnsembleInputFile

Return type:

EnsembleInputFile

classmethod from_ini(config_file: str) EnsembleInputFile[source]

Parse input file as ini format

Parameters:

config_file (str) – ini file path

ini examples:

``` [P10275]

1XJ7: DHT 1XQ3: R18 2AM9: TES,DTT 2YLP: TES,056

```

Returns:

instance of EnsembleInputFile

Return type:

EnsembleInputFile

classmethod from_yaml(yaml_file: str) EnsembleInputFile[source]

Parse input file as yaml format

Parameters:

yaml_file (str) – yaml file path

Returns:

instance of EnsembleInputFile

Return type:

EnsembleInputFile

classmethod parse_file(path: str, header: bool = False) EnsembleInputFile[source]

Parse input file

Parameters:
  • path (str) – file path

  • header (bool, optional) – whether the file has header. Only for csv file. Defaults to False.

Raises:

ValueError – Unsupported file type

Returns:

instance of EnsembleInputFile

Return type:

EnsembleInputFile

read(file_path: str) None[source]

Read and parse the input file

Parameters:

file_path (str) – file path

get_pairs_list() list[tuple][source]

Get the list of pairs. Pairs are defined as (pdb, ligand)

Returns:

list of pairs

Return type:

list

get_pdbid_list() list[str][source]

Get the list of unique pdb ids

Returns:

list of pdb ids

Return type:

list

get_ligand_list() list[str][source]

Get the list of unique ligands

Returns:

list of ligands

Return type:

list

pyCADD.Dock.const module

pyCADD.Dock.env module

pyCADD.Dock.env.check_virtual_environment(package_name: str, environment_name: str) bool[source]
pyCADD.Dock.env.create_environment(environment_name: str, schrodinger_home: str, root_path: str = None) str[source]
pyCADD.Dock.env.main()[source]

pyCADD.Dock.ui module

class pyCADD.Dock.ui.UI_dock(menu_name: str = 'Dock Mode')[source]

Bases: UI

__init__(menu_name: str = 'Dock Mode') None[source]
run(flag)[source]

pyCADD.Dock.utils module

pyCADD.Dock.utils.check_pdb(pdb: str) bool[source]

Check if the input is a valid PDB ID.

Parameters:

pdb (str) – pdb ID

Returns:

True if the input is a valid PDB ID, False otherwise

Return type:

bool

pyCADD.Dock.utils.get_input_pdbid() str[source]

Get PDB ID from directory name or user input.

Returns:

PDB ID

Return type:

str

Module contents