[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [modeller_usage] read_al_373E> Protein specified in ALIGN_CODES(i) was not found in the alignment file



Thank you.

I resolved the problem.

Thank you very much.

Andrea


On 16/01/2018 20:58, Modeller Caretaker wrote:
On 01/13/2018 11:05 AM, Andrea Spinelli wrote:
I try to use python3, but it doesn't working.

I can't understand why if I use my modeller module file in python command prompt, it works. If I use the function in a script, not.
You have an elementary Python error in your script - not a Modeller 
problem. Your pir_export function never closes its file handle, so the 
alignment file is empty until the handle is flushed (at the end of the 
script, too late for Modeller). Simple solution would be to replace 
"pir_file.close" with "pir_file.close()". A better solution would be 
to use 'with' to open your file, as per 
https://jeffknupp.com/blog/2016/03/07/python-with-context-managers/
    Ben Webb, Modeller Caretaker