1# This code is part of the Biopython distribution and governed by its 2# license. Please see the LICENSE file that should have been included 3# as part of this package. 4# 5 6"""Parser for FSSP files, used in a database of protein fold classifications. 7 8This is a module to handle FSSP files. For now it parses only the header, 9summary and alignment sections. 10 11See: Holm and Sander (1996) The FSSP database: fold classification based on 12structure-structure alignment of proteins. 13 14functions: read_fssp(file_handle): reads an fssp file into the records. Returns a 15tuple of two instances. 16mult_align: returns a Biopython alignment object 17""" 18from__future__importprint_function 19 20importre 21from.importfssp_rec 22fromBio.AlignimportGeneric 23fromBioimportAlphabet 24fff_rec=fssp_rec.fff_rec 25header_records={ 26'database':re.compile('^DATABASE'), 27'pdbid':re.compile('^PDBID'), 28'header':re.compile('^HEADER'), 29'compnd':re.compile('^COMPND'), 30'author':re.compile('^AUTHOR'), 31'source':re.compile('^SOURCE'), 32'seqlength':re.compile('^SEQLENGTH'), 33'nalign':re.compile('^NALIGN') 34} 35 36summary_title=re.compile('## +SUMMARY') 37summary_rec=re.compile(' *[0-9]+: +[1-9][0-9a-z]{3,3}') 38alignments_title=re.compile('## +ALIGNMENTS') 39alignments_rec=re.compile(' *[0-9]+ +-{0,1}[0-9]+') 40equiv_title=re.compile('## +EQUIVALENCES') 41 42

167# The following two dictionaries are pointers to records in self168# The first dictionary is a "pdb_residue_number: self_key"169# The second dictionary is a "absolute_residue_number: self_key"170self.pdb_res_dict={}171self.abs_res_dict={}172self.data={}