Entering edit mode
8.7 years ago
Bioaln
▴
360
Hello. I'm relatively new to PyMol scripting features and I've come across a problem regarding image export.
python
import time
import os
import csv
def get_num(x):
return float(''.join(ele for ele in x if ele.isdigit()))
with open('combined1.csv') as csvfile:
for entry in csvfile :
print(entry)
print("Fetching sequence..")
cmd.fetch(entry[0:4])
time.sleep(3)
outfile1 = str(entry+'.png')
print("Plotting!")
cmd.png(outfile1,ray=1)
cmd.remove('all')
print("New molecule!")
python end
Using this code, I successfully manage to obtain sequences, yet images are not exported. What am I doing wrong? In my csv there are just names of pdb files.
Thanks for any help.
I moved it to an answer, you can accept your own answer, if you think the details are enough!