I have thousands of PDB files and I need to extract the following information from each of them: an ID or the name of the small molecule (ligand) present in the complex.

Is there a way to do that with BioPython or similar tools? Taking this PDB entry as an example, the tools should return 7FM.

  • $\begingroup$ Can you please edit your question and include some examples and the output you would want from them? That way, we can test our solutions using your examples and we can be sure to give you the output you need. $\endgroup$ – terdon May 4 '19 at 16:22
  • $\begingroup$ The PDB entry states that the ligand is 7FM. $\endgroup$ – wrong_path May 4 '19 at 17:35
  • $\begingroup$ Anyway use the MMCIF2Dict tool to extract the information from the header via the PDB module of BioPython. If it's not in the header you can't do it because XML is not supported (not currently supported). Goodluck $\endgroup$ – M__ May 4 '19 at 17:43

I found out that the package PyPDB has the function get_ligands that does exactly what I'm looking for.

  • $\begingroup$ Thanks, for the feedback. Apologies for not spotting this. $\endgroup$ – M__ May 7 '19 at 9:44
  • 1
    $\begingroup$ No problem! Strange I was not able to find this tool before... $\endgroup$ – wrong_path May 7 '19 at 11:52

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.