ample.util.tm_util module

class ModelData(model_name, structure_name, model_fname, structure_fname, log_fname, tmscore, rmsd, nr_residues_common)[source]

Bases: object

Class to store model data

gdtha
gdtts
log_fname
maxsub
model_fname
model_name
nr_residues_common
rmsd
seq_id
structure_fname
structure_name
tmscore
class TMalign(executable, wdir=None, **kwargs)[source]

Bases: ample.util.tm_util.TMapps

Wrapper to handle TMalign scoring for one or more structures

Examples

>>> models = ["<MODEL_1>", "<MODEL_2>", "<MODEL_3>"]
>>> references = ["<REFERENCE_1>", "<REFERENCE>", "<REFERENCE>"]
>>> tm = TMalign("<PATH_TO_EXE>")
>>> entries = tm.compare_structures(models, references)
compare_structures(models, structures, all_vs_all=False)[source]

Compare a list of model structures to a second list of reference structures

Parameters:
  • models (list) – List containing the paths to the model structure files
  • structures (list) – List containing the paths to the reference structure files
  • all_vs_all (bool) – Flag to compare all models against all structures
Returns:

entries

Return type:

list

class TMapps(executable, method, wdir='.', **kwargs)[source]

Bases: object

Superclass of TMscore and TMalign

entries

List containing the TMscore entries on a per-model basis

Type:list
structure

Path to the reference structure

Type:str
method

One of [TMscore|TMalign]

Type:str
executable

Path to the TMscore executable

Type:str
work_dir

Path to the working directory

Type:str
static binary_avail(binary)[source]

Check if TM binary is available

binary : str
The binary name of TMscore or TMalign
Returns:
Return type:bool
Raises:ValueError – The binary is not TMalign or TMscore
comparison(models, structures)[source]

Compare a list of model structures to a second list of reference structures

Parameters:
  • models (list) – List containing the paths to the model structure files
  • structures (list) – List containing the paths to the reference structure files
Returns:

entries – List of TMscore data entries on a per-model basis

Return type:

list

class TMscore(executable, wdir=None, **kwargs)[source]

Bases: ample.util.tm_util.TMapps

Wrapper to handle TMscoring for one or more structures

Examples

>>> models = ["<MODEL_1>", "<MODEL_2>", "<MODEL_3>"]
>>> references = ["<REFERENCE_1>", "<REFERENCE>", "<REFERENCE>"]
>>> tm = TMscore("<PATH_TO_EXE>")
>>> entries = tm.compare_structures(models, references)
compare_structures(models, structures, fastas=None, all_vs_all=False)[source]

Compare a list of model structures to a second list of reference structures

Parameters:
  • models (list) – List containing the paths to the model structure files
  • structures (list) – List containing the paths to the reference structure files
  • fastas (list) – List containing the paths to the FASTA files
  • all_vs_all (bool) – Flag to compare all models against all structures
Returns:

entries – List of TMscore data entries on a per-model basis

Return type:

list

Notes

If a FASTA sequence is provided, a much more accurate comparison can be carried out. However, to by-pass this there is also an option to run the comparison without it. This might work just fine for larger models.

main()[source]