[Chimera-users] BioPython in a Chimera Python script; PDBio?

Eric Pettersen pett at cgl.ucsf.edu
Tue Jan 7 16:08:11 PST 2014


Hi Darrell,
	You're right; due to the way we compile Chimera to maintain compatibility with older systems makes it tough to compile BioPython with newer Macs since it is a bear to get/use the 10.6 SDK on them (I've never gotten that to work).  So though BioPython compiles easily with my source-code installation of Chimera, I run aground on the same rocks you do using the distributed version of Chimera.
	On the other hand, for the task you describe I don't think using BioPython is going to help you any.  With the BioPython I installed, this is the value of the BioPython 'journal' header record for 1gcn:

	AUTH K.SASAKI,S.DOCKERILL,D.A.ADAMIAK,I.J.TICKLE,AUTH 2 T.BLUNDELLTITL X-RAY ANALYSIS OF GLUCAGON AND ITS RELATIONSHIP TOTITL 2 RECEPTOR BINDING.REF NATURE V. 257 751 1975REFN ISSN 0028-0836PMID 171582DOI 10.1038/257751A0

You can see that you'd have some tricky parsing on your hands anyway!  So if you have to do some parsing anyway you might as well stick with Chimera.
	So here's some code that will parse out the title and DOI from the JRNL records:

from chimera import openModels, Molecule
for m in openModels.list(modelTypes=[Molecule]):
	if hasattr(m, 'pdbHeaders') and 'JRNL' in m.pdbHeaders:
		title = doi = None
		for line in m.pdbHeaders['JRNL']:
			if line[12:16] == "TITL":
				if title:
					title += " " + line[19:].strip()
				else:
					title = line[19:].strip()
			if line[12:15] == "DOI":
				if doi:
					doi += " " + line[19:].strip()
				else:
					doi = line[19:].strip()
		print m.name, "Title:", title
		print m.name, "DOI:", doi
	else:
		print m.name, "has no JRNL header records"

I haven't tested the above code but it should work, modulo a typo or two.

--Eric

                        Eric Pettersen
                        UCSF Computer Graphics Lab
                        http://www.cgl.ucsf.edu

On Jan 7, 2014, at 11:55 AM, "Hurt, Darrell (NIH/NIAID) [E]" <darrellh at niaid.nih.gov> wrote:

> Hi Chimera friends,
> 
> I've been trying to install BioPython into the Python interpreter embedded within Chimera. I've been following the guidelines posted a couple of years ago:
> http://www.cgl.ucsf.edu/pipermail/chimera-dev/2011/000807.html
> 
> This works up to a point for me. I'm using Mac OS X 10.8.5 with MacPorts installed. I'm trying to install BioPython 1.63:
> http://biopython.org/wiki/Download#Installation_Instructions
> 
> The "build" process starts to work, but gets hung up with the error "xcrun: Error: failed to exec real xcrun. (No such file or directory)". It seems to be referencing "/Developer/SDKs/MacOSX10.6.sdk", which does not exist in recent versions of Xcode. I've been able to install the 10.6 frameworks into both Xcode 4.6.2 and Xcode 5.x, but that still doesn't work. I manually installed the MacOSX10.6.sdk from Xcode 4.2 into the appropriate location, but still no luck.
> 
> I'm using BioPython because I want to pull some information out of the PDB headers. I was able to use PDBio as described in this discussion:
> http://www.cgl.ucsf.edu/pipermail/chimera-users/2007-February/001291.html
> 
> But the "dictionary" entries "keyed by record type" need additional cleanup/parsing before I can use them (which is why I wanted to use BioPython).
> 
> Is this just a case of Apple not building in enough backwards compatibility? Or is it something that Chimera needs to fix?
> 
> Do you have any additional suggestions for me about "PDBio"? The fields I want are the DOI and title information.
> 
> Finally, is there an analogous "EMDBio" for EMDB records?
> 
> Thanks,
> Darrell
> 
> --
> Darrell Hurt, Ph.D.
> Section Head, Computational Biology
> Bioinformatics and Computational Biosciences Branch (BCBB)
> OCICB/OSMO/OD/NIAID/NIH
> 
> 31 Center Drive, Room 3B62B, MSC 2135
> Bethesda, MD 20892-2135
> Office: 301-402-0095
> Mobile: 301-758-3559
> Web: BCBB Home Page<http://www.niaid.nih.gov/about/organization/odoffices/omo/ocicb/Pages/bcbb.aspx#niaid_inlineNav_Anchor>
> Twitter: @niaidbioit<https://twitter.com/niaidbioit>
> 
> Disclaimer: The information in this e-mail and any of its attachments is confidential and may contain sensitive information. It should not be used by anyone who is not the original intended recipient. If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage devices. National Institute of Allergy and Infectious Diseases shall not accept liability for any statements made that are sender's own and not expressly made on behalf of the NIAID by one of its representatives.
> 
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users







More information about the Chimera-users mailing list