The template structure is written out to the named file, in PDB format. file can be either a file name or a modfile.File() object open in write mode (in which case the structure is appended to the file).