Treemix plotnames coloring

543 views
Skip to first unread message

Vikram Chhatre

unread,
Jul 12, 2016, 1:26:07 PM7/12/16
to structure-software
I am looking for some help with assigning custom colors to population names in the Treemix plot.  Essentially I am trying to replicate figure 2 from Treemix manual using a different data set.

The code that needs tinkering is in plotting_funcs.R script line#185.  If anyone has had success doing this, I would appreciate some help.

Thanks
Vikram


ekir...@hotmail.com

unread,
Dec 1, 2016, 9:01:26 AM12/1/16
to structure-software
For anyone who stumbles across this question via google, the population colours in Treemix can be set using the second column in the optional population order file (the path to which is the second parameter to the plot_tree() function).

Pop1 #1f78b4
Pop2 #33a02c

Vikram Chhatre

unread,
Dec 1, 2016, 9:05:37 AM12/1/16
to structure-software
Thanks for posting this.  I searched for a while but never found a solution other than manually setting colors in illustrator etc.  How did you figure this out?

V




--
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-software+unsub...@googlegroups.com.
To post to this group, send email to structure-software@googlegroups.com.
Visit this group at https://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.

ekir...@hotmail.com

unread,
Dec 1, 2016, 9:13:54 AM12/1/16
to structure-software

I couldn’t find any documentation on how to do this either, so I read through the R code used to plot the graph and found that it was checking to see if a second column existed in the population order file.

 

The code itself is pretty hard to read, as the variables are poorly named. The parameter is called “o”, and expects a path to a whitespace delimited file that has the colour in the second column.

 

E.


On Thursday, December 1, 2016 at 2:05:37 PM UTC, Vikram Chhatre wrote:
Thanks for posting this.  I searched for a while but never found a solution other than manually setting colors in illustrator etc.  How did you figure this out?

V


On Thu, Dec 1, 2016 at 3:52 AM, <ekir...@hotmail.com> wrote:
On Tuesday, July 12, 2016 at 6:26:07 PM UTC+1, Vikram Chhatre wrote:
> I am looking for some help with assigning custom colors to population names in the Treemix plot.  Essentially I am trying to replicate figure 2 from Treemix manual using a different data set.
>
>
> The code that needs tinkering is in plotting_funcs.R script line#185.  If anyone has had success doing this, I would appreciate some help.
>
>
> Thanks
> Vikram

For anyone who stumbles across this question via google, the population colours in Treemix can be set using the second column in the optional population order file (the path to which is the second parameter to the plot_tree() function).

Pop1    #1f78b4
Pop2    #33a02c

--
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-software+unsub...@googlegroups.com.
To post to this group, send email to structure...@googlegroups.com.

Vikram Chhatre

unread,
Dec 1, 2016, 9:20:28 AM12/1/16
to structure-software, Joseph Pickrell
Terrific investigative work!  Perhaps Joe can add a small note to this effect in the Treemix manual.  I am copying him here.

V

On Thu, Dec 1, 2016 at 7:13 AM, <ekir...@hotmail.com> wrote:

I couldn’t find any documentation on how to do this either, so I read through the R code used to plot the graph and found that it was checking to see if a second column existed in the population order file.

 

The code itself is pretty hard to read, as the variables are poorly named. The parameter is called “o”, and expects a path to a whitespace delimited file that has the colour in the second column.

 

E.


On Thursday, December 1, 2016 at 2:05:37 PM UTC, Vikram Chhatre wrote:
Thanks for posting this.  I searched for a while but never found a solution other than manually setting colors in illustrator etc.  How did you figure this out?

V


On Thu, Dec 1, 2016 at 3:52 AM, <ekir...@hotmail.com> wrote:
On Tuesday, July 12, 2016 at 6:26:07 PM UTC+1, Vikram Chhatre wrote:
> I am looking for some help with assigning custom colors to population names in the Treemix plot.  Essentially I am trying to replicate figure 2 from Treemix manual using a different data set.
>
>
> The code that needs tinkering is in plotting_funcs.R script line#185.  If anyone has had success doing this, I would appreciate some help.
>
>
> Thanks
> Vikram

For anyone who stumbles across this question via google, the population colours in Treemix can be set using the second column in the optional population order file (the path to which is the second parameter to the plot_tree() function).

Pop1    #1f78b4
Pop2    #33a02c

--
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-software+unsubscribe@googlegroups.com.
To post to this group, send email to structure...@googlegroups.com.
Visit this group at https://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.

--
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-software+unsub...@googlegroups.com.
To post to this group, send email to structure-software@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages