swamp.parsers.gesamtparser module

class GesamtErrorCodes[source]

Bases: enum.Enum

An enumerator to handle the possible gesamt error codes

DISSIMILAR = 1
ERROR_2 = 2
NO_STDOUT = 3
READ_ERRORS = 4
class GesamtParser(mode, stdout=None, fname=None, logger=None)[source]

Bases: swamp.parsers.parser.Parser

Gesamt output parser

Parameters:
  • mode (str) – corresponds with mode used to create the output to be parsed
  • stdout (str) – the stdout to be parsed (default None)
  • fname (str) – the file name to be parsed (default None)
  • logger (SwampLogger) – logging interface for the parser (default None)
Variables:
  • error (bool) – if True an error has occurred along the process
  • qscore (float) – qscore as reported by gesamt
  • rmsd (float) – the obtained rmsd as reported by gesamt
  • seq_id (float) – sequence identity between the input structures
  • n_align (int) – number of aligned residues
Example:
>>> from swamp.parsers import GesamtParser
>>> my_parser = GesamtParser('<mode>', '<stdout>', '<fname>')
>>> my_parser.parse()
static get_pairwise_qscores(stdout)[source]

Method to get the pairwise qscores of a given alignmnet between several models in an ensemble

Parameters:stdout (str) – gesamt stdout for the command
Returns:qscores_dict: a dictionary with the pairwise qscores for each of the models in the alignment (dict)
parse()[source]

Method to parse fname and store figures of merit

parse_hitfile()[source]

Method to parse a gesamt .hit output file

Parameters:fname (str) – file name of the .hit output file
Returns:a dataframe with the results contained in the hit file (pandas.Dataframe)
parse_stdout()[source]

Method to retrieve qscore, rmsd, sequence identity and no. of aligned residues from stdout

Parameters:
  • stdout (str) – gesamt stdout to be parsed
  • n_models (int) – number of models that were used in the structural alignment to generate the provided stdout
Returns:

qscore, rmsd, sequence identity and no. of aligned residues (tuple)

summary

Dataframe with hits found in the archive if mode is ‘search-archive’ otherwise a tuple with all the parsed figures of merit