<div dir="ltr"><div><div>humm.. I realise that it's gonna be difficult to do that with my 300+ samples so if someone has other suggestions, that would be fantastic.<br><br></div>Cheers<br></div>Nic<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 May 2015 at 10:05, Nicolas Dussex <span dir="ltr"><<a href="mailto:nicolas.dussex@gmail.com" target="_blank">nicolas.dussex@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks Pablo, seems to be working!<br><br></div>Nic<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 30 April 2015 at 14:28, pablo fresia <span dir="ltr"><<a href="mailto:pfresia@gmail.com" target="_blank">pfresia@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">... the errors are probably because of the bounds within [..., ...]<br><div class="gmail_extra"><br><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div>I got this error message now:<span><br><br>> points(dapc1$ind.coord[1:90,],<br>+ pch=17, cex=1, col="black")<br></span>Error in dapc1$ind.coord[1:90, ] : subscript out of bounds<span><br>> par(xpd=TRUE)<br>> points(dapc1$ind.coord[91:218,],<br>+ pch=18, cex=1.4, col="black")<br></span>Error in dapc1$ind.coord[91:218, ] : subscript out of bounds<span><br>> par(xpd=TRUE)<br>> points(dapc1$ind.coord[219:326,],<br>+ pch=21, cex=1, col="black")<br></span>Error in dapc1$ind.coord[219:326, ] : subscript out of bounds<span><br>> par(xpd=TRUE)<br>> points(dapc1$ind.coord[327:392,],<br>+ pch=20, cex=1.3, col="black")<br></span>Error in dapc1$ind.coord[327:392, ] : subscript out of bounds<br><br></div>I thought about sorting indviduals by morphotype, but not sure how to do it as I want to keep the population info too. My samples are grouped by population at this stage. <br></div></div></div></div></div></blockquote></span><div><br>... mixing both approaches may be you find a way. I figure, if you keep the inds organized by pop but dividing it by morphotype you can assign colors and symbols in the way you need.<br><br>eg. pop 1: 1 to 30 inds, 1-15 morph 1 and 16-30 morph 2:<br><br>> points(dapc1$ind.coord[1:15,], pch=17, cex=1, col="black")<br>> points(dapc1$ind.coord[16:30,], pch=18, cex=1, col="black")<br><br>and so on... <br><br></div><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div></div>If I run this:<br><br>scatter(dapc1, cstar=0,cex=2.5, cell=0, label=NULL, leg = TRUE,scree.da=FALSE,txt.leg = c("233","287","418","674","878","957","1085")) #pch=c)#col = myCol)<br>par(new=TRUE)<br>df <- data.frame(x = dapc1$ind.coord[,1], y = dapc1$ind.coord[,2])<br>morph_data_6m<-read.table("morph_data_6m.txt", header=T)<br>c<-morph_data_6m[,1]<br>s.label(dfxy = df, xax=1, yax=2, label=c,clabel=0.7,boxes=FALSE,grid=FALSE, addaxes=FALSE)<br><br></div>I obtain a plot of coloured dots corresponding to each population and I then add the morphotype label (W, WR or X; from my "moprh_data_6m.txt" file) on top of each dot, but it gets difficult to read when dots overlap (see example attached)<br></div></div></div></blockquote><div><br></div></span><div> best<br></div><div><div><div>pablo<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 30 April 2015 at 13:53, pablo fresia <span dir="ltr"><<a href="mailto:pfresia@gmail.com" target="_blank">pfresia@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">... maybe, the individuals needs to be by organized morphotype before to run the DAPC.</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 29 April 2015 at 22:49, pablo fresia <span dir="ltr"><<a href="mailto:pfresia@gmail.com" target="_blank">pfresia@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Nic,<br><div><div class="gmail_extra"><br><div class="gmail_quote">an error, should be here<br><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><span><span>> myCol <- c("darkblue","darkgreen","red")<br></span>> scatter(dapc1, scree.da=FALSE, bg="white", pch=20, solid=.4, cex=0, cstar=1, clab=1, col=myCol)</span><span><br>> par(xpd=TRUE)<br>> points(<u>dapc<b><span style="background-color:rgb(255,255,255)">1</span></b></u>$ind.coord[1:90,],<br></span><span>+ pch=17, cex=1, col="black")<br><b>Error in dapc$ind.coord : object of type 'closure' is not subsettable</b></span><span><br>> par(xpd=TRUE)<br>> points(<u>dapc<b>1</b></u>$ind.coord[91:218,],<br></span><span>+ pch=18, cex=1.4, col="black")<br><b>Error in dapc$ind.coord : object of type 'closure' is not subsettable</b></span><span><br>> par(xpd=TRUE)<br>> points(<u>dapc<b>1</b></u>$ind.coord[219:326,],<br></span><span>+ pch=21, cex=1, col="black")<br><b>Error in dapc$ind.coord : object of type 'closure' is not subsettable</b></span><span><br>> par(xpd=TRUE)<br>> points(<u>dapc<b>1</b></u>$ind.coord[327:392,],<br></span><span>+ pch=20, cex=1.3, col="black")<br><b>Error in dapc$ind.coord : object of type 'closure' is not subsettable</b><br></span></div></div></div></blockquote><div><br></div><div>cheers,<br></div><div>pablo<br> <br></div><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div></div><div class="gmail_quote">On 30 April 2015 at 13:03, pablo fresia <span dir="ltr"><<a href="mailto:pfresia@gmail.com" target="_blank">pfresia@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Nicolas,<br><br>what's going on, if you try something like this below ?<br><div><br>myCol <- c("darkblue","darkgreen","red")<br>scatter(dapc, scree.da=FALSE, bg="white", pch=20, solid=.4, cex=0, cstar=1, clab=1, col=myCol)<br>par(xpd=TRUE)<br>points(dapc$ind.coord[1:90,], <br> pch=17, cex=1, col="black")<br>par(xpd=TRUE)<br>points(dapc$ind.coord[91:218,], <br> pch=18, cex=1.4, col="black")<br>par(xpd=TRUE)<br>points(dapc$ind.coord[219:326,], <br> pch=21, cex=1, col="black")<br>par(xpd=TRUE)<br>points(dapc$ind.coord[327:392,], <br> pch=20, cex=1.3, col="black")<br><br></div><div>good luck!<br></div><div>pablo<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On 29 April 2015 at 21:50, Nicolas Dussex <span dir="ltr"><<a href="mailto:nicolas.dussex@gmail.com" target="_blank">nicolas.dussex@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I am doing a DAPC for a dataset that contains 6 populations. Among all my samples, there are three different morphs and each population contains a variable mixture of each. What I want to do is to use a different color for each population (I managed to do it) and use a different type of point for each sample according to its moprhotype. I have a file that contains this info ( 1 colomn with either X, W or WR). <br><br></div>I tried using pch as described below, but the labels do not correspond to the individuals. <br><br>dapc1 <- dapc(Z1, n.pca = 10, n.da = 3)<br>c<-morph_data_6m[,1]<br>scatter(dapc1, cstar=0,cex=2.5, cell=0, label=NULL, leg = TRUE,scree.da=FALSE,txt.leg = c("233","287","418","674","878","957","1085"), <b>pch=c</b>)<br><br></div>Would there be a way to assign to each individual a type of point corresponding to its morphotype? Say point for W, star for X and triangle for WR.<br><br></div>Thanks for your help!<br></div>Nic<span><font color="#888888"><br><div><div><div><br><br><div><div><div>-- <br><div><div dir="ltr"><div><div dir="ltr">Nic Dussex PhD<br>Department of Zoology<br>University of Otago<br>340 Great King Street<br>P.O.Box 56<br>Dunedin 9054<br>New Zealand<br><br>Mobile: +64 21 02790938<br></div></div></div></div>
</div></div></div></div></div></div></font></span></div>
<br></div></div>_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div dir="ltr">Nic Dussex PhD<br>Department of Zoology<br>University of Otago<br>340 Great King Street<br>P.O.Box 56<br>Dunedin 9054<br>New Zealand<br><br>Mobile: +64 21 02790938<br></div></div></div></div>
</div></div><div><div>
</div></div></blockquote></div></div></div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div dir="ltr">Nic Dussex PhD<br>Department of Zoology<br>University of Otago<br>340 Great King Street<br>P.O.Box 56<br>Dunedin 9054<br>New Zealand<br><br>Mobile: +64 21 02790938<br></div></div></div></div>
</div>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div dir="ltr">Nic Dussex PhD<br>Department of Zoology<br>University of Otago<br>340 Great King Street<br>P.O.Box 56<br>Dunedin 9054<br>New Zealand<br><br>Mobile: +64 21 02790938<br></div></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Nic Dussex PhD<br>Department of Zoology<br>University of Otago<br>340 Great King Street<br>P.O.Box 56<br>Dunedin 9054<br>New Zealand<br><br>Mobile: +64 21 02790938<br></div></div></div></div>
</div>