How to index residues by icode in biopython? I am indexing a structure by the code below:
PDB_CODE = '1lve'
RES_CHAIN = 'A'
RES_NUM = 27    

structure = PDBParser(is_pqr=True).get_structure(PDB_CODE, PDB_CODE+&quot;.pqr&quot;)
residue = structure[0][RES_CHAIN][RES_NUM]

However, the 1lve contains residues with the same RES_NUM but different icodes 'A' to 'F' so my code either ignores them or throws an error if I pass '27A'. Does biopython allow this kind of structure indexing directly?
Okay, I found the answer myself. It is possible to index not only by RES_NUM, but by its id (check with residue.get_id()), so the below example would work:
#structure[0][RES_CHAIN][het, resseq, icode]
structure[0][RES_CHAIN][' ', 27, 'A']