Treemix - wrong values of m and i in OptM

448 views
Skip to first unread message

Zoe Meziere

unread,
Dec 26, 2022, 1:14:39 AM12/26/22
to structure-software
Hi all,

I am using the OptM R package to determine the optimal number of migration edged from my Treemix runs. However, when using the function optM(), it recognises the wrong number of migration edges and iterations. In my bash script (pasted bellow), I used tm varying from 1 to 10 and using 10 iterations, but optM() outputs "m ranges between 0 and 4. The average number of iterations per m (not including m = 0) was 25.". The Treemix output files are correctly labelled so I don't know where the issue is coming from...

Have you had this issue before?
Cheers,

for m in {1..10}

   do

   for i in {1..10}

      do

      s=$RANDOM

      echo "Random seed = ${s}"

      treemix \

         -i Stylo_treemix_input.frq.gz \

         -o Stylo.${i}.${m} \

         -global \

         -m ${m} \

         -k 500 \

         -seed ${s}

      done 

done



Haley Arnold

unread,
Mar 29, 2024, 11:19:19 AM3/29/24
to structure-software
Hi, I am experiencing the same issue. Did you ever figure out what was going on? Is this normal optM behavior?

Thank you,

Haley

Dylan O'Hearn

unread,
May 26, 2025, 11:07:09 AMMay 26
to structure-software
I believe I've figured this out.  When it reports the range of m values and how many iterations there were of each, it's basing that not on how many migration edges you allowed in the runs (1-10) but how many were actually used in each run, since Treemix is evaluating all values up to the number you allow and then going with whichever has the highest likelihood.  So when it says m ranged from 0 to 4, that means that none of the runs resulted in an m value >4 having the highest likelihood. So I don't think it's actually a problem although it is very confusing.
Reply all
Reply to author
Forward
0 new messages