[adegenet-forum] scatterplot

Chelsea Didinger chelsea.didinger at gmail.com
Thu Jul 23 12:23:40 CEST 2015


Hi Everyone,

I am a Master's student and new to R, and I could not find a previous
thread on this, so I apologize if I am asking a question someone has
already answered.

Basically, I am trying to use my data to try doing something similar to the
2014 paper "A tutorial for Discriminant Analysis of Principal
Components (DAPC) using adegenet 1.4-1".  I'm working with adegenet 2.0.0.

The data I uploaded only has 1 dataset (as opposed to the example in this
paper with 4 datasets where only 1 is selected to work with). In the
dataset, there are 49 rows (corresponding to 15 amino acids of an allele
variant) and 75 columns (each amino acid in the allele variant has 5 values
assigned, hence 15X5). I was wondering if the following script should work
to produce a scatterplot:

- library(adegenet)
- PSS <- read.csv(file.choose(),header=F)
- find.clusters(PSS)             - here, I did not use max.n.clust
- (note: the cluster plot stops at 5...it decreases until 5 and then the
slope doesn't go up again, it simply stops. so I would select 5 then(?))
- head(grp$Kstat,8)             - is it correct to still use 8 (same value
as used in the paper)?
- grp$stat
- head(grp$grp,10)              - correct to use 10 still (same value as
used in the paper)?
- grp$size
- dapc1 <- dapc(PSS,grp$grp)
- scatter(dapc1)

Also, if I want to make a table and plot like in this paper,
[table(pop(x),grp$grp)], how could I do this? What would I do instead of
pop?

Sorry for asking about something so simple. I'm still learning, so I very
much appreciate your time and understanding. Any help would be very welcome
- thank you so much!

Best,

Chelsea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20150723/5ed3e5b1/attachment.html>


More information about the adegenet-forum mailing list