# Using dssp after chain extraction

I have a list of PDB IDs with realtive chains that are to be extracted, and the run on dssp. For the single chain extraction I tried several methods, such as:

import pymol2
for entry in list:
with pymol2.PyMOL() as pymol:
pymol.cmd.fetch(entry)
pymol.cmd.save(entry + '.cif')


Where, for example, if I want to extract chain AC for 4YBB, entry = 4YBBAC. This works well in saving the cif files (pymol correctly visualizes them), but makes them not suitable for mkdssp. Indeed, if i run

mkdssp 4YBBAC


I get

DSSP could not be created due to an error:
Is this an mmCIF file?


I tried also using Biopthon:

from Bio.PDB import MMCIFParser
from Bio.PDB.mmcifio import MMCIFIO
parser = MMCIFParser()
io = MMCIFIO()
structure = parser.get_structure("4YBB", "4YBB.cif")
model = structure[0]
chain = model['AC']
io.set_structure(chain)
io.save("4YBBAC.cif")


But again, when running mkdssp, I get:

DSSP could not be created due to an error:
bad lexical cast: source type value could not be interpreted as target


On a closer inspection, both methods drop the columns _atom_site.pdbx_formal_charge _atom_site.auth_comp_id _atom_site.auth_atom_id from the file, while retaining all the others. This is the first line of the coordinates from the biopython/pymol file:

ATOM   1    N N   . GLY A ? 1   ? -125.713 46.378 -19.108 1.0 77.15  2   AC 1


While this is the original file:

ATOM   34684  N  N     . GLY C   3  1    ? -125.713 46.378   -19.108  1.00 77.15  ?  2    GLY AC N     1


I think that renaming the AC chain to a single-character code would in principle resolve the issue, but it's more of a workaround.

mkdssp does support multicharacter chain ids. I've proved it first it by cutting and pasting the chain into the file and then with an ad-hoc parser. I think the issue is with how biopython and pymol extract the chains.

Is this a bug? Am I using the tools incorrectly? Can my purpose be achieved with other (possibly hassle free) methods?