smirarab / pasta

PASTA (Practical Alignment using SATe and Transitivity)
GNU General Public License v3.0
85 stars 26 forks source link

GUI unable to setup configuration file #36

Closed NElnour closed 6 years ago

NElnour commented 6 years ago

Hello,

I am encountering the following error when attemping to analyze a FASTA collection using run_pasta_gui.py:

PASTA ERROR: PASTA is exiting because of an error: The file "/home/nadaelnour/PASTA/pasta/tmpFXAY6D_internal.cfg" does not appear to be a valid configuration file format. It lacks section headers. Job pastajob is finished.

MGNute commented 6 years ago

Hi Nada,

The config files in pasta have to be in a valid INI file format, specifically the structure used by the python configparser module (see https://docs.python.org/3/library/configparser.html). So the most likely issue is that some part of the cfg file did not conform to those specs. In the case of PASTA, it will be looking for specific section and key names. The best way to create a config file might be to run pasta on one of the examples and look at the config file that is created in the output folder. That will be populated by default settings (excpet for things like input and output paths and such). But using that as a template for a new config file should be helpful.

Let me know if that doesn't help.

Mike

On Wed, Oct 3, 2018 at 4:25 PM Nada Elnour notifications@github.com wrote:

Hello,

I am encountering the following error when attemping to analyze a FASTA collection using run_pasta_gui.py:

PASTA ERROR: PASTA is exiting because of an error: The file "/home/nadaelnour/PASTA/pasta/tmpFXAY6D_internal.cfg" does not appear to be a valid configuration file format. It lacks section headers. Job pastajob is finished.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/smirarab/pasta/issues/36, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuefehPawYuYugwu15QbtJgkRa8D-Frks5uhR0lgaJpZM4XGze5 .

-- Michael Nute Mike.Nute@gmail.com

NElnour commented 6 years ago

Hi Mike,

Thanks! Although 2.7 is my default python version, configure.py was using python 3.6's configparser. I fixed the issue by running python setup.py develop again but in a conda py2.7 environment.

Best, Nada

LuziaThea commented 3 years ago

Dear all, I am having the same issue as Nada and can not solve it using her solution.

What I did:

To create my config file, I first run pasta directly on provided example data: sbatch -c 26 -p normal.168h --wrap="run_pasta.py --num-cpus=26 --input /home/luzia/pasta-code/pasta/data/hummingbirds/nd2.fasta"

This runs successfully and creates a config file named "pastajob_temp_pasta_config.txt".

I then try to run the pasta using this config file: sbatch -c 26 -p normal.168h --wrap="run_pasta.py /home/luzia/pasta-code/pasta/data/hummingbirds/pastajob_temp_pasta_config.txt"

This outputs the error: PASTA ERROR: PASTA is exiting because of an error: The file "/home/luzia/pasta-code/pasta/data/hummingbirds/pastajob_temp_pasta_config.txt" does not appear to be a valid configuration file format. It lacks section headers.

I tried to rerun python setup.py develop as Nada suggested, but this didn't solve the issue. Specifically, my python version is 2.7.15, so I created an env using conda create -n myenv2.7 python=2.7.15, and rerun setup.py in this.

Do you have an idea how to solve this issue? I would like to run pasta using a config file because I need to adjust mafft parameters for my purpose. If I understood correctly, there is no option to do this without using the config file.

Thank you so much for your help in advance!

Best wishes, Luzia

smirarab commented 3 years ago

Can you share the config file with me? My guess is that the issue has something to do with python versioning. For whatever reason, PASTA is using python2.6, which you probably also have installed.

When you installed PASTA in conda environment, did you run python setup.py develop? Did it produce any errors?

LuziaThea commented 3 years ago

Thank you so much for your answer, this is really helpful!! Yes, a python versioning error seems likely. Unfortunately, I am not yet skilled enough in these issues to figure out a solution myself.

I attach my config file below: pastajob_temp_pasta_config.txt

Yes, I ran python setup.py develop in the conda environment as follows:

python --version # shows Python 2.7.15 conda create -n myenv2.7 python=2.7.15

cd /home/luzia/pasta-code/pasta source activate myenv2.7 python setup.py develop conda deactivate

This did not produce any error.

Thanks a lot for your help with this in advance!

smirarab commented 3 years ago

If you have deactivated your env, you need to activate it again before running PASTA by running:

cd /home/luzia/pasta-code/pasta source activate myenv2.7

I am guessing you have done that, but if not, that would be the problem. On Mon, Aug 2, 2021 at 2:38 AM Luzia Stalder @.***> wrote:

Thank you so much for your answer, this is really helpful!! Yes, a python versioning error seems likely. Unfortunately, I am not yet skilled enough in these issues to figure out a solution myself.

I attach my config file below: pastajob_temp_pasta_config.txt https://github.com/smirarab/pasta/files/6915891/pastajob_temp_pasta_config.txt

Yes, I ran python setup.py develop in the conda environment as follows:

python --version # shows Python 2.7.15 conda create -n myenv2.7 python=2.7.15

cd /home/luzia/pasta-code/pasta source activate myenv2.7 python setup.py develop conda deactivate

This did not produce any error.

Thanks a lot for your help with this in advance!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/smirarab/pasta/issues/36#issuecomment-890881224, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGJXOAE4FRXD3UYQ2W7KLLT2ZRPRANCNFSM4FY3G64Q .

-- Siavash Mirarab

LuziaThea commented 3 years ago

Yes, I have done this and I get this same error unfortunately. I attach the output of the following lines below

conda create -n myenv2.7 python=2.7.15
cd /home/luzia/pasta-code/pasta
source activate myenv2.7
python setup.py develop
sbatch -c 26 -p normal.168h --wrap="run_pasta.py  /home/luzia/pasta-code/pasta/data/hummingbirds/pastajob_temp_pasta_config.txt"

output_pasta.txt

Do you see what could be the issue with this? Thanks again so much for your help, I really appreciate it!

smirarab commented 3 years ago

Is sbatch meant to submit the job to a cluster? If so, you need to activate the right env inside the script you submit because, on the node where it runs, you will have a different environment. Put differently, what you put inside --wrap is probably not run with the correct environment.

Try:

sbatch -c 26 -p normal.168h --wrap="source activate myenv2.7; run_pasta.py  /home/luzia/pasta-code/pasta/data/hummingbirds/pastajob_temp_pasta_config.txt;"

or something like that.

LuziaThea commented 3 years ago

Is sbatch meant to submit the job to a cluster? If so, you need to activate the right env inside the script you submit because, on the node where it runs, you will have a different environment. Put differently, what you put inside --wrap is probably not run with the correct environment.

Try:

sbatch -c 26 -p normal.168h --wrap="source activate myenv2.7; run_pasta.py  /home/luzia/pasta-code/pasta/data/hummingbirds/pastajob_temp_pasta_config.txt;"

or something like that.

Oh, this was an embarrassing mistake from my side, thank you so much for helping me with very basic issues Siavash! Really looking forward to play around with Pasta alignments now :)