This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Pymol - trouble saving images.

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.

pymol png export

1 answer

I managed to save it using mpng, but this question is still open.

I moved it to an answer, you can accept your own answer, if you think the details are enough!

Log in to answer this question.