restraintmaker.io package

Subpackages

Submodules

restraintmaker.io.Exporter module

The module Exporter is providing the required code for exporting files from PyMol If you want to add a new exporter, simply just derive it from _Exporter and the code will automatically add it to the GUI.

class restraintmaker.io.Exporter._Exporter(restraints: List[restraintmaker.utils.Restraints._Restraint])[source]

Bases: object

..class: _exporter

__init__(restraints: List[restraintmaker.utils.Restraints._Restraint])[source]

This class is the private parent class, that is giving the interface for submethods.

Parameters

restraints (Restraints) – Restraints to be saved

export_restraints(verbose: bool = False)[source]

export_restraints must be overridden by every subclass of Exporter. Writes the restraints into a file.

Parameters

verbose (bool) – print progress (True) or not (False)

Return type

NoReturn

get_args(input_function: Callable[[str], Any])[source]

should be overridden by every subclass of Exporter. It will assign all necessary attributes using input_function

Parameters

input_function (t.Callable[[str],t.Any]) – a function that will provide the arguments for the selection in the necessary format.

Return type

NoReturn

Raises

u.BadArgumentException

class restraintmaker.io.Exporter.export_Gromacs_Distance_Restraints(restraints: List[restraintmaker.utils.Restraints.DistanceRestraint])[source]

Bases: restraintmaker.io.Exporter._Export_Distance_Restraints

export_restraints(verbose: bool = True) str[source]

export_restraints must be overridden by every subclass of Exporter. Writes the restraints into a file. For Gromacs Exporter it will be in a gromacs compatible format.

Parameters

verbose (bool) – print progress (True) or not (False)

class restraintmaker.io.Exporter.export_Gromacs_Position_RESTRAINTS(restraints: List[restraintmaker.utils.Restraints.PositionRestraint])[source]

Bases: restraintmaker.io.Exporter._Export_Position_Restraints

export_restraints(verbose: bool = True) str[source]

export_restraints must be overridden by every subclass of Exporter. Writes the restraints into a file. For Gromacs Exporter it will be in a gromacs compatible format.

Parameters

verbose (bool) – print progress (True) or not (False)

class restraintmaker.io.Exporter.export_Gromos_Distance_Restraints(restraints: List[restraintmaker.utils.Restraints.DistanceRestraint])[source]

Bases: restraintmaker.io.Exporter._Export_Distance_Restraints

export_restraints(verbose: bool = True) str[source]

export_restraints must be overridden by every subclass of Exporter. Writes the restraints into a file. For Gromos Exporter it will be in a gromos compatible format.

todo: realise these parameters as settings dict, which the user can provide as input

Parameters

verbose (bool) – print progress (True) or not (False)

class restraintmaker.io.Exporter.export_Gromos_Position_RESTRAINTS(restraints: List[restraintmaker.utils.Restraints.PositionRestraint])[source]

Bases: restraintmaker.io.Exporter._Export_Position_Restraints

export_restraints(verbose: bool = True) str[source]

export_restraints must be overridden by every subclass of Exporter. Writes the restraints into a file. For Gromos Exporter it will be in a gromos compatible format.

todo: realise these parameters as settings dict, which the user can provide as input

Parameters

verbose (bool) – print progress (True) or not (False)

class restraintmaker.io.Exporter.export_JSON_Distance_Restraints(restraints: List[restraintmaker.utils.Restraints.DistanceRestraint])[source]

Bases: restraintmaker.io.Exporter._Export_Distance_Restraints

export_restraints(verbose: bool = True) str[source]

export_restraints must be overridden by every subclass of Exporter. Writes the restraints into a file. For Gromacs Exporter it will be in a gromacs compatible format.

Parameters

verbose (bool) – print progress (True) or not (False)

class restraintmaker.io.Exporter.export_JSON_Position_RESTRAINTS(restraints: List[restraintmaker.utils.Restraints.PositionRestraint])[source]

Bases: restraintmaker.io.Exporter._Export_Position_Restraints

export_restraints(verbose: bool = True) str[source]

export_restraints must be overridden by every subclass of Exporter. Writes the restraints into a file. For Gromacs Exporter it will be in a gromacs compatible format.

Parameters

verbose (bool) – print progress (True) or not (False)

restraintmaker.io.Importer module

Importer This module contains the functions, to import Files.

class restraintmaker.io.Importer.import_Gromacs_Distance_Restraints(all_atoms: List[restraintmaker.utils.Utilities.Atom])[source]

Bases: restraintmaker.io.Importer._Importer_Distance_Restraints

file_ending: str = 'itp'
import_restraints(verbose: bool = False) List[dict][source]
This function reads in a gromos distance restraint file. TODO: Read

in additional Settings (r0, w0, etc…)

TODO: WE could try to read thefile in get_args to get the Error there already.

IDEA: READ THE WHOLE TEXT IN GET ARGS AND ONLY CONVERT IT HERE. OS ALLERRORS HAPPEN IN GET ARGS

Parameters

verbose

Returns

returns a dict containing the atom ids for each disres. (has to be translated in interface_Pymol

Return type

t.List[dict]

class restraintmaker.io.Importer.import_Gromacs_Position_Restraints(all_atoms: List[restraintmaker.utils.Utilities.Atom])[source]

Bases: restraintmaker.io.Importer._Importer_Position_Restraints

file_ending: str = 'itp'
import_restraints(verbose: bool = False) List[dict][source]
This function reads in a gromos distance restraint file. TODO: Read

in additional Settings (r0, w0, etc…)

TODO: WE could try to read thefile in get_args to get the Error there already.

IDEA: READ THE WHOLE TEXT IN GET ARGS AND ONLY CONVERT IT HERE. OS ALLERRORS HAPPEN IN GET ARGS

Parameters

verbose

Returns

returns a dict containing the atom ids for each disres. (has to be translated in interface_Pymol

Return type

t.List[dict]

class restraintmaker.io.Importer.import_Gromos_Distance_Restraints(all_atoms: List[restraintmaker.utils.Utilities.Atom])[source]

Bases: restraintmaker.io.Importer._Importer_Distance_Restraints

file_ending: str = 'disres'
import_restraints(verbose: bool = False) List[dict][source]
This function reads in a gromos distance restraint file. TODO: Read

in additional Settings (r0, w0, etc…)

TODO: WE could try to read thefile in get_args to get the Error there already.

IDEA: READ THE WHOLE TEXT IN GET ARGS AND ONLY CONVERT IT HERE. OS ALLERRORS HAPPEN IN GET ARGS

Parameters

verbose

Returns

returns a dict containing the atom ids for each disres. (has to be translated in interface_Pymol

Return type

t.List[dict]

class restraintmaker.io.Importer.import_Gromos_Position_Restraints(all_atoms: List[restraintmaker.utils.Utilities.Atom])[source]

Bases: restraintmaker.io.Importer._Importer_Position_Restraints

file_ending: str = 'por'
import_restraints(verbose: bool = True) List[dict][source]
This function reads in a gromos distance restraint file. TODO: Read

in additional Settings (r0, w0, etc…)

TODO: WE could try to read thefile in get_args to get the Error there already.

IDEA: READ THE WHOLE TEXT IN GET ARGS AND ONLY CONVERT IT HERE. OS ALLERRORS HAPPEN IN GET ARGS

Parameters

verbose

Returns

returns a dict containing the atom ids for each disres. (has to be translated in interface_Pymol

Return type

t.List[dict]

class restraintmaker.io.Importer.import_JSON_Distance_Restraints(all_atoms: List[restraintmaker.utils.Utilities.Atom])[source]

Bases: restraintmaker.io.Importer._Importer_Distance_Restraints

file_ending: str = 'json'
import_restraints(verbose: bool = False) List[dict][source]
This function reads in a gromos distance restraint file. TODO: Read

in additional Settings (r0, w0, etc…)

TODO: WE could try to read thefile in get_args to get the Error there already.

IDEA: READ THE WHOLE TEXT IN GET ARGS AND ONLY CONVERT IT HERE. OS ALLERRORS HAPPEN IN GET ARGS

Parameters

verbose

Returns

returns a dict containing the atom ids for each disres. (has to be translated in interface_Pymol

Return type

t.List[dict]

class restraintmaker.io.Importer.import_JSON_Position_Restraints(all_atoms: List[restraintmaker.utils.Utilities.Atom])[source]

Bases: restraintmaker.io.Importer._Importer_Position_Restraints

file_ending: str = 'json'
import_restraints(verbose: bool = False) List[dict][source]
This function reads in a gromos distance restraint file. TODO: Read

in additional Settings (r0, w0, etc…)

TODO: WE could try to read thefile in get_args to get the Error there already.

IDEA: READ THE WHOLE TEXT IN GET ARGS AND ONLY CONVERT IT HERE. OS ALLERRORS HAPPEN IN GET ARGS

Parameters

verbose

Returns

returns a dict containing the atom ids for each disres. (has to be translated in interface_Pymol

Return type

t.List[dict]

Module contents