Sails 0.2.0 Help

Sails::Utils

namespace Sails::Utils

Summary

Members

Descriptions

public std::stringget_environment_variable(std::string const & key)

Retrieves the value of the specified environment variable.

public voidprint_vector(const gemmi::Vec3 & vec)

Prints the components of the given vector.

public voidprint_vector(const gemmi::Vec3 & vec, const std::string & name)

Prints the components of the given vector with given label prefix.

public voidprint_position(const gemmi::Position & position)

Prints the coordinates of a given gemmi::Position object.

public std::stringformat_residue_key(const gemmi::Residue * residue)

Formats the key for a given residue.

public std::stringformat_site_key(constGlycosite& glycosite)

Formats the key for a given glycosite.

public std::stringformat_residue_from_site(constGlycosite& glycosite, gemmi::Structure * structure)

Formats the key of the residue for a given glycosite.

public gemmi::Chainget_chain_from_glycosite(constGlycosite& site, const gemmi::Structure * structure)

Retrieves the gemmi::Chain object corresponding to a given Glycosite.

public gemmi::Residueget_residue_from_glycosite(constGlycosite& site, const gemmi::Structure * structure)

Retrieves the gemmi::Residue corresponding to a given Glycosite.

public gemmi::Residue *get_residue_ptr_from_glycosite(constGlycosite& site, gemmi::Structure * structure)

Retrieves the gemmi::Residue pointer corresponding to a given Glycosite.

public gemmi::Chain *get_chain_ptr_from_glycosite(constGlycosite& site, gemmi::Structure * structure)

Retrieves the gemmi::Chain pointer corresponding to a given Glycosite.

public gemmi::Atomget_atom_from_glycosite(constGlycosite& site, const gemmi::Structure * structure)

Retrieves the gemmi::Atom from the specified glycosite.

public std::stringlinkage_to_id(constSails::LinkageData& data)

Converts the given LinkageData object into an ID string.

public voidsave_residues_to_file(std::vector< gemmi::Residue > residues, const std::string & path)

Save a vector of gemmi::Residue objects to a specified file path.

public voidsave_grid_to_file(const gemmi::Grid<> & grid, const std::string & path)

Saves a grid to a file in CCP4 format.

public voidsave_structure_to_file(const gemmi::Structure & structure, const std::string & path)

Saves the provided gemmi::Structure object to a file.

public std::stringget_next_string(const std::string & input)

Computes the next string will be alphabetically.

public boolfile_exists(const std::string & path)

Checks if a file exists at the specified path.

Members

public std::stringget_environment_variable(std::string const & key)

Retrieves the value of the specified environment variable.

This function retrieves the value of the specified environment variable identified by the provided key.

Parameters

  • key The name of the environment variable to retrieve.

Returns

The value of the specified environment variable. If the environment variable is not found, an empty string is returned.

public voidprint_vector(const gemmi::Vec3 & vec)

Prints the components of the given vector.

This method prints the x, y, and z components of the provided vector using the format "(x, y, z)" using the std::cout stream

Parameters

  • vec The gemmi::Vec3 object whose coordinates will be printed.

public voidprint_vector(const gemmi::Vec3 & vec, const std::string & name)

Prints the components of the given vector with given label prefix.

This method prints the x, y, and z components of the provided vector using the format "(x, y, z)" using the std::cout stream

Parameters

  • vec The gemmi::Vec3 object whose coordinates will be printed.

public voidprint_position(const gemmi::Position & position)

Prints the coordinates of a given gemmi::Position object.

This method prints the x, y, and z components of the provided position using the format "(x, y, z)" using the std::cout stream

Parameters

  • position The gemmi::Position object whose coordinates will be printed.

public std::stringformat_residue_key(const gemmi::Residue * residue)

Formats the key for a given residue.

This function formats the key for the provided residue by concatenating its name and sequence identifier.

Parameters

  • residue A pointer to the gemmi::Residue object representing the residue.

Returns

The formatted key for the residue.

public std::stringformat_site_key(constGlycosite& glycosite)

Formats the key for a given glycosite.

This function formats the key for the provided residue by concatenating its the model, chain, residue and atom ids.

Parameters

  • glycosite A glycosite

Returns

The formatted key for the site.

public std::stringformat_residue_from_site(constGlycosite& glycosite, gemmi::Structure * structure)

Formats the key of the residue for a given glycosite.

This function formats the key for the provided glycosite by getting chain ID, residue name and residue SeqId.

Parameters

  • glycosite A glycosite

  • structure

Returns

The formatted key for the site.

public gemmi::Chainget_chain_from_glycosite(constGlycosite& site, const gemmi::Structure * structure)

Retrieves the gemmi::Chain object corresponding to a given Glycosite.

This function retrieves the gemmi::Chain object that represents the chain of the provided Glycosite within the specified gemmi::Structure.

Parameters

  • site The glycosite object containing the model, chain, and residue indices.

  • structure A ptr to a gemmi::Structure object from which the chain is to be retrieved.

Returns

The gemmi::Chain object from the specified glycosute.

public gemmi::Residueget_residue_from_glycosite(constGlycosite& site, const gemmi::Structure * structure)

Retrieves the gemmi::Residue corresponding to a given Glycosite.

This function retrieves the gemmi::Residue object that represents the residue of the provided Glycosite within the specified gemmi::Structure.

Parameters

  • site The glycosite object containing the model, chain, and residue indices.

  • structure A ptr to a structure object from which to retrieve the residue.

Returns

The gemmi::Residue from the specified glycosite.

public gemmi::Residue *get_residue_ptr_from_glycosite(constGlycosite& site, gemmi::Structure * structure)

Retrieves the gemmi::Residue pointer corresponding to a given Glycosite.

This function retrieves the gemmi::Residue pointer that represents the residue of the provided Glycosite within the specified gemmi::Structure.

Parameters

  • site The glycosite object containing the model, chain, and residue indices.

  • structure A ptr to a structure object from which to retrieve the residue.

Returns

The gemmi::Residue pointer from the specified glycosite.

public gemmi::Chain *get_chain_ptr_from_glycosite(constGlycosite& site, gemmi::Structure * structure)

Retrieves the gemmi::Chain pointer corresponding to a given Glycosite.

This function retrieves the gemmi::Chain pointer that represents the chain of the provided Glycosite within the specified gemmi::Structure.

Parameters

  • site The glycosite object containing the model, chain, and residue indices.

  • structure A ptr to a structure object from which to retrieve the chain.

Returns

The gemmi::Chain pointer from the specified glycosite.

public gemmi::Atomget_atom_from_glycosite(constGlycosite& site, const gemmi::Structure * structure)

Retrieves the gemmi::Atom from the specified glycosite.

This function retrieves the gemmi::Atom object that represents the atom of the provided Glycosite within the specified gemmi::Structure.

Parameters

  • site The glycosite object containing the model, chain, and residue indices.

  • structure The structure from which to retrieve the atom.

Returns

The gemmi::Atom from the specified glycosite.

Exceptions

  • std::runtime_error if the site has not been initialised from a Mark.

public std::stringlinkage_to_id(constSails::LinkageData& data)

Converts the given LinkageData object into an ID string.

This function takes a reference to a LinkageData object and converts it into an ID string. The ID string is constructed by concatenating the donor, donor_number, acceptor_number, and acceptor fields of the LinkageData object.

Parameters

  • data The LinkageData object to convert to an ID string.

Returns

The ID string representation of the LinkageData object.

public voidsave_residues_to_file(std::vector< gemmi::Residue > residues, const std::string & path)

Save a vector of gemmi::Residue objects to a specified file path.

This method takes a vector of gemmi::Residue objects and saves them to the specified file path. It creates a gemmi::Structure, gemmi::Model, and gemmi::Chain to hold the residues. The provided residues are appended to the chain, and the chain is added to the model. Finally, the model is added to the structure. The structure is then written to the specified file path using the gemmi::write_pdb function.

Parameters

  • residues The vector of gemmi::Residue objects to save.

  • path The file path to save the residues to.

The file path must be valid and accessible for writing. If the file already exists, it will be overwritten.

public voidsave_grid_to_file(const gemmi::Grid<> & grid, const std::string & path)

Saves a grid to a file in CCP4 format.

This function saves the given grid to a file in CCP4 format. The grid is defined by the provided gemmi::Grid<> object and the file path is specified using the std::string path parameter.

Parameters

  • grid The grid object to save to file.

  • path The path to the file where the grid will be saved.

public voidsave_structure_to_file(const gemmi::Structure & structure, const std::string & path)

Saves the provided gemmi::Structure object to a file.

This method saves the provided gemmi::Structure object to a file specified by the given path.

Parameters

  • structure The gemmi::Structure object to be saved.

  • path The path of the file where the structure should be saved.

public std::stringget_next_string(const std::string & input)

Computes the next string will be alphabetically.

This computes what the string will be if we increment the letter by one. For example this function will return "B" given the input "A".

Parameters

  • input The string to increment.

Returns

The incremented string.

public boolfile_exists(const std::string & path)

Checks if a file exists at the specified path.

This function checks if a file exists at the specified path.

Parameters

  • path The path of the file to check.

Returns

true if the file exists, false otherwise.

Last modified: 08 August 2024