swamp.mr.searchmodel module

class SearchModel(id, ensemble_code, workdir, ermsd=0.1, nsearch=1, disable_check=True, mod='unmod', model='ensemble', pdb_fname_input=None, logger=None)[source]

Bases: abc.ABC

Class with methods to prepare the search model before MR and data structures to keep all useful information

Parameters:
  • workdir (str) – working directory where the search model will be prepared
  • id (str) – unique identifier for the search model to be added
  • ensemble_code (str) – the ensemble’s SWAMP library id to be used as search model
  • ermsd (float) – the eRMSD to be used with phaser to place the search model (default 0.1)
  • nsearch (int) – number of copies to search with phaser
  • disable_check (bool) – passed to phaser.InputMR_AUTO.setENSE_DISA_CHEC (default True)
  • mod (str) – indicate how to prepare the search model (default ‘unmod’)
  • model (str) – indicate if the search model is an ensemble or a centroid (default ‘ensemble’)
  • logger (SwampLogger) – logging interface for the MR pipeline (default None)
Variables:
  • error (bool) – if True an error has occurred while preparing the search model
  • modified_model_list (list) – a list with the file names of the modified models to be merged into the new ensemble
create_pdbfile()[source]

Create the pdb file to be used as a search model on run

static extract_core(pdbout, workdir, model_list)[source]

Extract the core structural alignment of a given ensemble

Parameters:
  • pdbout (str) – the pdb file name of the resulting ensemble to output
  • workdir (str) – the working directory where temporary files will be created
  • model_list (list) – a list with the pdb file names of the models that make the ensemble
idealhelix_fname

File name of the ideal helix to be used to extend the solution

model_dir

Directory with the models that formed the original search model (if it was an ensemble)

model_list

A list with all the models in the original search model

modified_pdbfname

The file name of the search model after running prepare()

pdbfname

The PDB file name of the search model

phaser_info

A dictionary with all the information necessary to use with add_searchmodel()

prepare()[source]

Prepare the pdbfname with the searchmodel using the indicated mod before MR

static split_models(pdbin, directory, strip_hetatm=True)[source]

Method to split an ensemble into its model components

Parameters:
  • pdbin (str) – input pdb file name
  • directory (str) – directory where the models of the ensemble will be dumped
  • strip_hetatm (bool) – if set, the hetatm will be ommited from the output models (default True)
Returns:

a list with the output file names listed (list)

static transfer_flags_pdb(pdb_ref, pdb_file, flags_to_transfer=('CRYST1', 'SCALE', 'REMARK'), overwrite=True)[source]

Transfer PDB flags between two given pdb files

Parameters:
  • pdb_ref (str) – pdb file with the reference flags to be transferred
  • pdb_file (str) – pdb file where the flags will be transferred
  • flags_to_transfer (tuple) – set of flags that need to be transferred
  • overwrite (bool) – if False, pdb_file original flags will be kept (default True)
static truncate_polyALA(pdbin, pdbout)[source]

Method to truncate a given pdb into poly-ala

Parameters:
  • pdbin (str) – input pdb file name
  • pdbout (str) – output pdb file name