Biskit :: Mod :: Modeller :: Modeller :: Class Modeller
[hide private]
[frames] | no frames]

Class Modeller

source code


Run a Modeller job

Take Alignment from t_coffee and template PDBs. Creates a modeller-script and runs modeller and post-processes the results. The Modeller output ends up in the output folder.

Example usage

>>> m = Modeller( outfolder )
>>> m.run()

References



Instance Methods [hide private]
  __init__(self, outFolder='.', log=None, fasta_target=None, f_pir=None, template_folder=None, fout=None, starting_model=1, ending_model=10, verbose=0, host=None, **kw)
  prepareFolders(self)
Create needed output folders if they don't exist.
  prepare(self)
Create needed folders and get information needed by Modeller
str generateInp(self)
Convert the list of template id's into a string in addition Executor.generateInp functionality.
  logWrite(self, msg, force=1)
Write message to log.
[str] get_template_ids(self)
Extract names of all PDB files in a folder (without .PDB)
  get_target_id(self, f_fasta)
Extract (first) sequence id from fasta file.
  prepare_alignment(self)
Convert t_coffee - generated PIR into PIR for Modeller.
  prepare_modeller(self, fasta_target=None, fout=None)
Prepare information needed by modeller.
  finish(self)
Overrides Executor method
[str] pdb_list(self, model_folder)
Compile a list with the names of all models created by Modeller.
float extract_modeller_score(self, f_model, model)
Extract the modeller score from the models
  output_score(self, pdb_list, model_folder)
Write a list of model scores to file F_SCORE_OUT
  update_PDB(self, pdb_list, cwd, model_folder)
Extract number of templates per residue position from alignment.
  update_rProfiles(self, pdb_list)
Read Modeller score from the 'temperature_factor' column and create a profile from it.
  write_PDBModels(self, pdb_list, model_folder=None)
Dump the list of PDBModels.
  postProcess(self, model_folder=None)
Rename model PDBs to 'model_01.pdb' - 'model_xx.pdb' according to their score, create and dump a ModelList instance containing these models and info-records and profiles with the Modeller score.

Class Variables [hide private]
  MODELLER_TEMPLATE = """ # Homology modelling by the MODELLER TOP routine...
  F_RESULT_FOLDER = '/modeller'
  F_MOD_SCRIPT = 'modeller.top'
  F_INPUT_FOLDER = '/modeller'
  F_INP = F_RESULT_FOLDER+ '/'+ F_MOD_SCRIPT
  F_PDBModels = '/PDBModels.list'
  F_SCORE_OUT = F_RESULT_FOLDER+ '/Modeller_Score.out'

Method Details [hide private]

__init__(self, outFolder='.', log=None, fasta_target=None, f_pir=None, template_folder=None, fout=None, starting_model=1, ending_model=10, verbose=0, host=None, **kw)
(Constructor)

source code 
Parameters:
  • outFolder (str) - base folder for Modeller output (default: F_RESULT_FOLDER)
  • log (LogFile) - log file instance, if None, STDOUT is used (default: None)
  • f_pir (str) - PIR alignment file (default: None -> Aligner.F_FINAL_ALN)
  • template_folder (str) - folder with template coordinate files (default: None -> TC.F_MODELLER)
  • fout (None or str) - name of modeller script (default: None -> F_INP)
  • starting_model (int) - first model (default: 1)
  • ending_model (int) - last model (default: 10)
  • verbose (1|0) - verbosity level (default: 1)
  • host (str) - host for calculation (None->no ssh) (default: None)

prepareFolders(self)

source code 

Create needed output folders if they don't exist.

prepare(self)

source code 

Create needed folders and get information needed by Modeller

generateInp(self)

source code 

Convert the list of template id's into a string in addition Executor.generateInp functionality.

Replace formatstr place holders in inp by fields of this class.
Returns: str
input file name OR (if pipes=1) content of input file
Raises:
  • TemplateError - if error while creating template file

logWrite(self, msg, force=1)

source code 

Write message to log.
Parameters:
  • msg (str) - message to print

get_template_ids(self)

source code 

Extract names of all PDB files in a folder (without .PDB)
Returns: [str]
list of PDB names

get_target_id(self, f_fasta)

source code 

Extract (first) sequence id from fasta file. Make intelligent guess if there is no exact match between target fasta and alignment file.
Parameters:
  • f_fasta (str) - fasta file with target sequence
Raises:

prepare_alignment(self)

source code 

Convert t_coffee - generated PIR into PIR for Modeller. On the way all sequence ids are extracted into self.pir_ids.
Raises:

prepare_modeller(self, fasta_target=None, fout=None)

source code 

Prepare information needed by modeller.
Parameters:
  • fasta_target (str) - target fasta file (default: None -> SS.F_FASTA_TARGET)
  • fout (None or str) - name of modeller script (default: None -> F_INP)

finish(self)

source code 

Overrides Executor method

pdb_list(self, model_folder)

source code 

Compile a list with the names of all models created by Modeller.
Parameters:
  • model_folder (str) - folder containing model PDBs (output from Modeller)
Returns: [str]
pdb files from modeller

extract_modeller_score(self, f_model, model)

source code 

Extract the modeller score from the models
Parameters:
  • f_model (str) - file name of model pdb
  • model (PDBModel) - model
Returns: float
modeller score for the models

output_score(self, pdb_list, model_folder)

source code 

Write a list of model scores to file F_SCORE_OUT
Parameters:
  • pdb_list (ModelList) - list of models
  • model_folder (str) - ouput folder

update_PDB(self, pdb_list, cwd, model_folder)

source code 

Extract number of templates per residue position from alignment. Write new PDBs with number of templates in occupancy column.
Parameters:
  • pdb_list (ModelList) - list of models
  • cwd (str) - current project directory
  • model_folder (str) - folder with models

update_rProfiles(self, pdb_list)

source code 

Read Modeller score from the 'temperature_factor' column and create a profile from it.
Parameters:
  • pdb_list (ModelList) - list of models

write_PDBModels(self, pdb_list, model_folder=None)

source code 

Dump the list of PDBModels.
Parameters:
  • pdb_list (ModelList) - list of models
  • model_folder (str) - ouput folder (default: None -> F_PDBModels)

postProcess(self, model_folder=None)

source code 

Rename model PDBs to 'model_01.pdb' - 'model_xx.pdb' according to their score, create and dump a ModelList instance containing these models and info-records and profiles with the Modeller score.
Parameters:
  • model_folder (str) - folder containing model PDBs (default: None -> F_INPUT_FOLDER)

Class Variable Details [hide private]

MODELLER_TEMPLATE

Value:
"""
# Homology modelling by the MODELLER TOP routine 'model'.

INCLUDE                               # Include the predefined TOP rou
tines

SET OUTPUT_CONTROL = 1 1 1 1 1        # uncomment to produce a large l
og file
...                                                                    
      

F_RESULT_FOLDER

Value:
'/modeller'                                                            
      

F_MOD_SCRIPT

Value:
'modeller.top'                                                         
      

F_INPUT_FOLDER

Value:
'/modeller'                                                            
      

F_INP

Value:
F_RESULT_FOLDER+ '/'+ F_MOD_SCRIPT                                     
      

F_PDBModels

Value:
'/PDBModels.list'                                                      
      

F_SCORE_OUT

Value:
F_RESULT_FOLDER+ '/Modeller_Score.out'