Monday, November 30, 2009

convert protein data bank files into Ansys nodes, key points and lines

Here are two small python scripts I wrote that will read in a PDB file and output a text file to be used as input for Ansys finite element analysis. They're still kind of rough in that the input directory is hard coded, but they seem to work great at least for carbon nanotubes and other fullerenes.

convert PDB file to Ansys key points and lines

convert PDB file to Ansys nodes

To use these scripts:

1. create a protein data bank file of your structure
2. name it test.pdb and save it in a folder: C:\xyz
3. make sure you have python installed
4. and to make things easier for development and use, grab the free version of Wingware IDE 101
5. download the two scripts and open them in Wing
6. run the scripts

The output file will be in the xyz directory. To load them in Ansys: File > Read input from...