IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP.pmi.io Namespace Reference

Utility classes and functions for reading and storing PMI files. More...

Detailed Description

Utility classes and functions for reading and storing PMI files.

Namespaces

Classes

class  TotalScoreOutput
 A helper output for model evaluation. More...

Functions

 add_provenance (prov, hiers)
 Add provenance information in prov (a list of _TempProvenance objects) to each of the IMP hierarchies provided.
 get_bead_sizes (model, rmf_tuple, rmsd_calculation_components=None, state_number=0)
 get_best_models (stat_files, score_key='SimplifiedModel_Total_Score_None', feature_keys=None, rmf_file_key='rmf_file', rmf_file_frame_key='rmf_frame_index', prefiltervalue=None, get_every=1, provenance=None)
 Given a list of stat files, read them all and find the best models.
 get_trajectory_models (stat_files, score_key='SimplifiedModel_Total_Score_None', rmf_file_key='rmf_file', rmf_file_frame_key='rmf_frame_index', get_every=1)
 Given a list of stat files, read them all and find a trajectory of models.
 parse_dssp (dssp_fn, limit_to_chains='', name_map=None)
 Read a DSSP file, and return secondary structure elements (SSEs).
 read_coordinates_of_rmfs (model, rmf_tuples, alignment_components=None, rmsd_calculation_components=None, state_number=0)
 Read in coordinates of a set of RMF tuples.
 save_best_models (model, out_dir, stat_files, number_of_best_scoring_models=10, get_every=1, score_key='SimplifiedModel_Total_Score_None', feature_keys=None, rmf_file_key='rmf_file', rmf_file_frame_key='rmf_frame_index', override_rmf_dir=None)
 Given a list of stat files, read them all and find the best models.

Function Documentation

◆ add_provenance()

add_provenance ( prov,
hiers )

Add provenance information in prov (a list of _TempProvenance objects) to each of the IMP hierarchies provided.

Note that we do this all at once since we typically don't preserve the IMP.Model object throughout a PMI protocol.

Note
This function is only available in Python.

Definition at line 281 of file pmi/io/__init__.py.

◆ get_bead_sizes()

get_bead_sizes ( model,
rmf_tuple,
rmsd_calculation_components = None,
state_number = 0 )
Parameters
modelThe IMP model
rmf_tuplescore,filename,frame number,original order number, rank
rmsd_calculation_componentsTuples to specify what components are used for RMSD calc
state_numberThe state to extract from the file
Note
This function is only available in Python.

Definition at line 513 of file pmi/io/__init__.py.

◆ get_best_models()

get_best_models ( stat_files,
score_key = 'SimplifiedModel_Total_Score_None',
feature_keys = None,
rmf_file_key = 'rmf_file',
rmf_file_frame_key = 'rmf_frame_index',
prefiltervalue = None,
get_every = 1,
provenance = None )

Given a list of stat files, read them all and find the best models.

Returns the best rmf filenames, frame numbers, scores, and values for feature keywords

Note
This function is only available in Python.

Definition at line 293 of file pmi/io/__init__.py.

◆ get_trajectory_models()

get_trajectory_models ( stat_files,
score_key = 'SimplifiedModel_Total_Score_None',
rmf_file_key = 'rmf_file',
rmf_file_frame_key = 'rmf_frame_index',
get_every = 1 )

Given a list of stat files, read them all and find a trajectory of models.

Returns the rmf filenames, frame numbers, scores, and values for feature keywords

Note
This function is only available in Python.

Definition at line 390 of file pmi/io/__init__.py.

◆ parse_dssp()

parse_dssp ( dssp_fn,
limit_to_chains = '',
name_map = None )

Read a DSSP file, and return secondary structure elements (SSEs).

Values are all PDB residue numbering.

Parameters
dssp_fnThe file to read
limit_to_chainsOnly read/return these chain IDs
name_mapIf passed, return tuples organized by molecule name (name_map should be a dictionary with chain IDs as keys and molecule names as values).
Returns
a dictionary with keys 'helix', 'beta', 'loop'. Each contains a list of SSEs. Each SSE is a list of elements (e.g. strands in a sheet). Each element is a tuple (residue start, residue end, chain).

Example for a structure with helix A:5-7 and Beta strands A:1-3,A:9-11:

ret = { 'helix' : [ [ (5,7,'A') ], ...]
'beta' : [ [ (1,3,'A'),
(9,11,'A'), ...], ...]
'loop' : same format as helix
}
Note
This function is only available in Python.

Definition at line 28 of file pmi/io/__init__.py.

◆ read_coordinates_of_rmfs()

read_coordinates_of_rmfs ( model,
rmf_tuples,
alignment_components = None,
rmsd_calculation_components = None,
state_number = 0 )

Read in coordinates of a set of RMF tuples.

Returns the coordinates split as requested (all, alignment only, rmsd only) as well as RMF file names (as keys in a dictionary, with values being the rank number) and just a plain list

Parameters
modelThe IMP model
rmf_tuples[score,filename,frame number,original order number, rank]
alignment_componentsTuples to specify what you're aligning on
rmsd_calculation_componentsTuples to specify what components are used for RMSD calc
state_numberThe state to extract from the file
Note
This function is only available in Python.

Definition at line 434 of file pmi/io/__init__.py.

◆ save_best_models()

save_best_models ( model,
out_dir,
stat_files,
number_of_best_scoring_models = 10,
get_every = 1,
score_key = 'SimplifiedModel_Total_Score_None',
feature_keys = None,
rmf_file_key = 'rmf_file',
rmf_file_frame_key = 'rmf_frame_index',
override_rmf_dir = None )

Given a list of stat files, read them all and find the best models.

Save to a single RMF along with a stat file.

Parameters
modelThe IMP Model
out_dirThe output directory. Will save 3 files (RMF, stat, summary)
stat_filesList of all stat files to collect
number_of_best_scoring_modelsNum best models to gather
get_everySkip frames
score_keyUsed for the ranking
feature_keysKeys to keep around
rmf_file_keyThe key that says RMF file name
rmf_file_frame_keyThe key that says RMF frame number
override_rmf_dirFor output, change the name of the RMF directory (experiment)
Note
This function is only available in Python.

Definition at line 126 of file pmi/io/__init__.py.