Skip to content

visualization

Renderer = Literal['html', 'notebook', 'streamlit', 'raw'] module-attribute

Which molstar renderer to use for visualization.

load_fitted_models(*, fitted_models_csv, report_csv, runs_csv)

Load fitted models from CSV files generated by the PowerFit CLI commands.

Parameters:

Name Type Description Default
fitted_models_csv Path

CSV file containing fitted models. Can be generated with protein-detective powerfit fit-models command.

required
report_csv Path

CSV file containing PowerFit report. Can be generated with protein-detective powerfit report command.

required
runs_csv Path

CSV file containing PowerFit runs. Can be generated with protein-detective powerfit list-runs command.

required

Returns:

Type Description
DataFrame

DataFrame containing fitted models with additional information from the report and runs. The returned columns are:

  • powerfit_run_id: ID of the PowerFit run
  • structure: Name of the structure file
  • rank: Rank of the solution
  • cc: Cross-correlation coefficient of the solution
  • fishz: FishZ score of the solution
  • relz: Relative Z-score of the solution
  • translation: Translation vector of the solution as a list of floats
  • rotation: Rotation matrix of the solution as a list of floats
  • fitted_model_file: Path to the fitted model file
  • unfitted_model_file: Path to the unfitted model file
  • density_map: Path to the density map used for fitting
  • run_dir: Path to the PowerFit run directory
  • options: Stringified PowerFit options for the run
  • uniprot_accessions: List of UniProt accessions for the template structure
  • structure_id: Structure ID of the template structure (UniProt or PDB)
  • is_alphafold: Boolean indicating if the template structure is from AlphaFoldDB

show_fitted_models_and_density(fitted_models, renderer='notebook')

Visualizes fitted models and their associated density map with molstar.

Parameters:

Name Type Description Default
fitted_models DataFrame

The fitted models returned by load_fitted_models. Expected columns: powerfit_run_id, structure, rank, cc, fishz, relz, translation, rotation, fitted_model_file, unfitted_model_file, density_map, run_dir, options, uniprot_accessions, structure_id, is_alphafold.

required
renderer Renderer

Renderer to use for visualization.

'notebook'

show_structure_and_density(structure, density, renderer='notebook')

Visualizes a structure and its associated density map with molstar.

Parameters:

Name Type Description Default
structure Path | str

Path to the structure file (PDB format).

required
density Path

Path to the density map file (e.g., CCP4 format).

required
renderer Renderer

Renderer to use for visualization.

'notebook'