Structure_Threader not reading the mainparams file

111 views
Skip to first unread message

Omar Zayas

unread,
Jan 25, 2024, 10:31:06 AMJan 25
to structure-software
Hello all:

I am trying to run Structure_Threader for a file with SNPs data. However, when running the command, it seems like the software can not find the mainparams file but reads the extraparams file. However, when running just ./structure, the command runs without any problem. 
Any thoughts on this? I attached the error message, the input file example, and the params file data I am using here.

Command: I have tried several commands using --params and using -m and -e.
structure_threader run -K 4 -R 10 --log 1 -i /home/rosalind/.local/bin/new_29samples_R0.60 -o /home/rosalind/.local/bin/results -t 8 -st ~/.local/bin/structure --params /home/rosalind/.local/bin/mainparams --params /home/rosalind/.local/bin/extraparams

structure_threader run -K 4 -R 10 --log 1 -i /home/rosalind/.local/bin/new_29samples_R0.60 -o /home/rosalind/.local/bin/results -t 8 -st /home/rosalind/.local/bin/structure --params /home/rosalind/.local/bin/

structure_threader run -K 4 -R 10 --log 1 -i /home/rosalind/.local/bin/new_29samples_R0.60 -o /home/rosalind/.local/bin/results -t 8 -st ~/.local/bin/structure -m /home/rosalind/.local/bin/mainparams -e /home/rosalind/.local/bin/extraparams

This is the Structure command that works well:
./structure -K 4 -R 10 --log 1 -i /home/rosalind/.local/bin/new_29samples_R0.60 -o /home/rosalind/.local/bin/results_normal -t 8 -st ~/.local/bin/structure --params /home/rosalind/.local/bin/

Error message in command-line:
:~$ structure_threader run -K 4 -R 10 --log 1 -i /home/rosalind/.local/bin/new_29samples_R0.60 -o /home/rosalind/.local/bin/results -t 8 - st /home/rosalind/.local/bin/structure --params /home/rosalind/.local/bin/
INFO: Running: /home/rosalind/.local/bin/structure -K 4 -i /home/rosalind/.local/bin/new_29samples_R0.60 -o /home/rosalind/.local/bin/results/str_K4_rep10 
-D 2153978 -m /home/rosalind/.local/bin -e /home/rosalind/.local/extraparams

CRITICAL: 40 structure runs exited with errors. Check the log files of the following output files:
ERROR: /home/rosalind/.local/bin/results/str_K4_rep10

Traceback (most recent call last):
  File "/home/rosalind/.local/bin/structure_threader", line 8, in <module>
    sys.exit(main())
  File "/home/rosalind/.local/lib/python3.6/site-packages/structure_threader/structure_threader.py", line 353, in main
    full_run(arg)
  File "/home/rosalind/.local/lib/python3.6/site-packages/structure_threader/structure_threader.py", line 311, in full_run
    bestk = structure_harvester(arg.outpath, wrapped_prog)
  File "/home/rosalind/.local/lib/python3.6/site-packages/structure_threader/structure_threader.py", line 192, in structure_harvester
    bestk = sh.main(resultsdir, outdir)
  File "/home/rosalind/.local/lib/python3.6/site-packages/structure_threader/evanno/structureHarvester.py", line 169, in main
    harvestFiles(data, resultsdir)
  File "/home/rosalind/.local/lib/python3.6/site-packages/structure_threader/evanno/structureHarvester.py", line 87, in harvestFiles
    'the results directory %s' % resultsdir)
structure_threader.evanno.structureHarvester.Exception: Error, unable to locateany _f files in the results directory /home/rosalind/.local/bin/results

Error message in the results file: 

Reading file "/home/rosalind/.local/bin".
Reading file "/home/rosalind/.local/extraparams".
Need to set NUMINDS>0 in the file mainparams
Need to set NUMLOCI>0 in the file mainparams
Need to set LABEL=0 or 1 in the file mainparams
Need to set POPDATA=0 or 1 in the file mainparams
Need to set POPFLAG=0 or 1 in the file mainparams
Need to set PHENOTYPE=0 or 1 in the file mainparamsNeed to set EXTRACOLS>=0 in the file mainparams

Exiting the program due to error(s) listed above.

The first column the sample ID and in the second column the Locdata, then the markers ID.

Example_Input_SNPs_file_.png

Mainparams file
Mainparams_flie.png

Ps. In other matters, Structure accepts the missing information identified as 0, or it has to be -9? The output file of Stacks identified the missing information with a 0. I changed it to -9 but would like to know if it works with the 0.

Thank you in advance,
-Omar

Francisco Pina Martins

unread,
Jan 26, 2024, 4:41:37 AMJan 26
to structure-software

Dear Omar,

You need only specify the path to yourmainparams file.
When you pass the --params switch twice, only the last one is read (which pointed to extraparams).

Just run your command like this:

structure_threader run -K 4 -R 10 --log 1 -i /home/rosalind/.local/bin/new_29samples_R0.60 -o /home/rosalind/.local/bin/results -t 8 -st ~/.local/bin/structure --params /home/rosalind/.local/bin/mainparams


This is stated in the manual, but maybe I should clarify it…

Regarding the 0 and -9, as far as I know you can set missing information to 0 and it should work just fine. But the -9 value is the “recommended” default due to being hard to confuse for anything else.

Hope this helps,

Francisco

Omar Zayas

unread,
Jan 26, 2024, 12:36:27 PMJan 26
to structure...@googlegroups.com
Hello Francisco, thank you for your response!

That solved my problem! Certainly, I read it in the manual and tried it in the first command that I wrote, but it didn't work (it had another error). For some reason, I started changing things in the command and forgot to use the first command, since Structure read it that way, I thought it was a problem with Structure_threader. I see that the program is generating .Stlog and _f  files hope everything goes well.

Thanks again,

Omar

--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/structure-software/fe596464-ec4a-4bde-b50d-05160c74e59cn%40googlegroups.com.


--
Omar Zayas Cruz

Francisco Pina Martins

unread,
Jan 28, 2024, 12:36:27 PMJan 28
to structure...@googlegroups.com

Hi Omar,

Glad to hear it’s sorted. I have, nevertheless clarified the documentation on the --params switch.

https://structure-threader.readthedocs.io/en/latest/usage/

Thank you for your feedback.

Best,

Francisco

You received this message because you are subscribed to a topic in the Google Groups "structure-software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/structure-software/Bp6bF_x6pq4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to structure-softw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/structure-software/CAE0Jn_b0S82ZcZLUnqq6BMEf67UeruyiecBgXXMZmXKjkZDUVA%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages