read_al_373E> Protein specified in ALIGN_CODES(i) was not found in the alignment file
Hello everybody! I am new to Modeller, so please excuse me if my question seems stupid. I build a model from multiple templates following your tutorial (https://salilab.org/modeller/tutorial/advanced.html). It's working. When I try to develop a module function with scripts, the 'align2d_mult.py' give me the following error: ModellerError: read_al_373E> Protein specified in ALIGN_CODES(i) was not found in the alignment file; ALIGN_CODES( 3) = P02489
I can't understand because my sequence.ali file is built in the right way:
>P1;P02489 sequence:P02489:::::::0.00: 0.00 MDVTIQHPWFKRTLGPFYPSRLFDQFFGEGLFEYDLLPFLSSTISPYYRQSLFRTVLDSGISEVRSDRDKFVIFLDVKHFSPEDLTVKVQDDFVEIHGKHNERQDDHGYISREFHRRYRLPSNVDQSALSCSLSADGMLTFCGPKIQTGLDATHAERAIPVSREEKPTSAPSS*
In attached you can find the python module with the function of script Thank you. Andrea
On 1/12/18 1:35 AM, Andrea Spinelli wrote: > I can't understand because my sequence.ali file is built in the right way:
Looks fine to me, but I won't be able to tell without seeing the file itself (not pasted into an email). You probably have a typo in the file that we can't see in the email - maybe an errant space character.
Ben Webb, Modeller Caretaker
The error appears only when I try to use the script function encapsulated in a module file, calling it the function from another python file.
Andrea
On 12/01/18 17:08, Modeller Caretaker wrote: > On 1/12/18 1:35 AM, Andrea Spinelli wrote: >> I can't understand because my sequence.ali file is built in the right >> way: > > Looks fine to me, but I won't be able to tell without seeing the file > itself (not pasted into an email). You probably have a typo in the > file that we can't see in the email - maybe an errant space character. > > Ben Webb, Modeller Caretaker
On 1/12/18 8:34 AM, Andrea Spinelli wrote: > The error appears only when I try to use the script function > encapsulated in a module file, calling it the function from another > python file.
That doesn't make any sense - Python and Modeller don't care about where the function is. At any rate, to reproduce your problem I need to see all your files, not just one of them.
Ben Webb, Modeller Caretaker
Le 12/01/2018 à 17:34, Andrea Spinelli a écrit : > The error appears only when I try to use the script function > encapsulated in a module file, calling it the function from another > python file. > > Andrea
Dear Andrea,
The very same python version (not 2 in one case and 3 in the other ?). Pay attention to encoding, dashes for instance are sometimes misinterpreted and not handled properly in python2...
Best,
Stéphane
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.
In attached file there is the main file (from_fasta_to_best_coverage.py) from which I call the module function (model.py). The file called 'down_fasta_if_not_PDB' is used in the first part of main file and It works
To test it, I use the uniprot code P02489.
Please, help me
Andrea
On 12/01/18 20:08, Téletchéa Stéphane wrote: > Le 12/01/2018 à 17:34, Andrea Spinelli a écrit : >> The error appears only when I try to use the script function >> encapsulated in a module file, calling it the function from another >> python file. >> >> Andrea > > Dear Andrea, > > The very same python version (not 2 in one case and 3 in the other ?). > Pay attention to encoding, dashes for instance are sometimes > misinterpreted and not handled properly in python2... > > Best, > > Stéphane >
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
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
participants (3)
-
Andrea Spinelli
-
Modeller Caretaker
-
Téletchéa Stéphane