0
$\begingroup$

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+".pqr")
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?

$\endgroup$
0
$\begingroup$

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']
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.