diff --git a/modelling/pymod/_afdb_modelling.py b/modelling/pymod/_afdb_modelling.py index a273d8d80276aed9aaa3cd793831d3b1cc718b15..ffecf687d33b519399d4b7fd37838c3beb2b5b9f 100644 --- a/modelling/pymod/_afdb_modelling.py +++ b/modelling/pymod/_afdb_modelling.py @@ -226,6 +226,27 @@ class FSStructureServer: omf_data = self.data[chunk][pos:pos+length] return io.OMF.FromBytes(gzip.decompress(omf_data)) + def GetOMFByPLC(self, pos, length, chunk): + """ Get stored OMF data structure + + Get data by explicitely specifying PLC (pos, length, chunk). For expert + use only, no range checks performed. + Instead of providing a uniprot AC or an index, this function takes + directly the internal pos, length and chunk parameters that are stored + for that particular index. Use case: avoid loading the respective data + files and only open the memory mapped files. + + :param pos: Byte pos in specified chunk + :type pos: :class:`int` + :param length: Num bytes of entry + :type length: :class:`int` + :param chunk: Chunk in which entry resides + :type chunk: :class:`int` + :returns: OMF data structure of type :class:`ost.io.OMF` + """ + omf_data = self.data[chunk][pos:pos+length] + return io.OMF.FromBytes(gzip.decompress(omf_data)) + def GetOMF(self, uniprot_ac, fragment="F1", version="v4"): """ Get stored OMF data structure