The function to_pdb() can be restricted to a location of the tertiary structure.  A secondary structure checks for pseudo knots, finds its single-strands and its stem-loops.