def pdb_to_structure(filename):
try:<EOL><INDENT>from Bio.PDB import PDB<EOL><DEDENT>except ImportError:<EOL><INDENT>print("<STR_LIT>")<EOL>raise<EOL><DEDENT>p = PDB.PDBParser()<EOL>structure = p.get_structure('<STR_LIT:S>', filename)<EOL>for _ in structure.get_chains():<EOL><INDENT>atoms = [np.array(atom.get_coord()) for atom in structure.get_atoms()]<EOL><DEDENT>return atoms<EOL>
Import a structure object from a PDB file.