PDB file downloading: pymol automation vs. manual I automated a PDB download using a Pymol script (below)
python
pdb_lists = ['3LZG', '6HJN'] # lots more pdbs
for x in pdb_lists:
    cmd.fetch(x)
    cmd.select(x)
    cmd.save(x + '.pdb', x)
    cmd.delete(x)
cmd.quit()
python end

When the script is run within Pymol it pulls down a collection of pdbs, however this flopped when I  plugged it through a Biopython PDB parser, but was okay when I manually downloaded the same pdb file from RCSB.org
A manual downloaded PDB was perfect, meaning the amino acids which cannot be observed by X-ray crystalography (e.g. they not sufficiently stationary) were recognised as being absent from the parser (resulting in a protein ~390 amino acids), but the Pymol scripted download contained all amino acid residues, i.e. even those which couldn't be observed in the X-ray (resulting in a protein of ~440 amino acid residues). Any ideas why the script resulted in a pdb that flopped and how to correct it?
To expand on the comment by marcin:


fetch downloads files in mmCIF format by default (https://pymolwiki.org/index.php/Fetch). Not all PDB entries have PDB format files, e.g. due to too many chains. Presumably this is why the change was made, though mmCIF files tend to be larger and hence download slower.
When calling save with the .pdb file extension the structure is converted to PDB format. Perhaps the converter uses the SEQRES records to define the sequence, and hence gives bad files when there are some residues not resolved.


To correct it you could try:


Saving as .cif and reading in with the Biopython mmCIF parser.
Providing the type=pdb argument to fetch, which will force PDB format downloads. Some PDB files may not be available.
Don't do it in PyMol and instead use the Biopython structure downloader (http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc187).


Also, if download speed is limiting you then consider using the MMTF file format, which is a binary format and hence smaller. Biopython can read in and write out MMTF files.