I am working with the 3-D coordinates of proteins. The file format I import and modify coordinates of is in the .PDB format, and the string to import is also in this same format. Currently, when I try to export as in "final.pdb", I get: "Export::type: "String cannot be exported to the !(\"PDB\") format." However, when I export with the extension .txt, and use:

Import["final.txt", "PDB"]

The file imports as the protein structure.

My question: Is there a way to export using the .PDB extension. Or even force the export. Having the .pdb extension would be much easier for other programs. If there is a way, please let me know.


1 Answer 1


In Documentation there are two examples on export as .PDB which work fine - you can follow the links and go through them. I'll give you here another example to show that export as .PDB works.

Import a large PDB file from independent source - the RCSB Protein Data Bank website.

data = Import["http://www.rcsb.org/pdb/download/downloadFile.do?fileFormat=pdb&
compression=NO&structureId=1tf6", {"PDB", "Rules"}]

enter image description here

Note we imported as rules, which is needed for Export. If we wouldn't specify "Rules" - it would give you 3D graphics and loose information about protein structure. Now let's export these rules back as some test.PDB file and import it right back to verify that export worked properly:

Export["test.PDB", data]



enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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