Creating population hierachy in Structure data file

252 views
Skip to first unread message

Ramendra Sarma

unread,
Nov 8, 2015, 10:54:22 AM11/8/15
to poppr
Hi,
I am not clear how to proceed with my data with 4 populations as defined in my file originally  meant for structure to use in poppr to define hierarchy.  After going through the tutorial of strata I am a bit confused to apply the same for my data.  In my file I have a column of 4 population only. should I put another column station as subpopulation as required for Strats before going for AMOVA after reading my structure formated data fie? Please help.

Thanking you

Zhian Kamvar

unread,
Nov 8, 2015, 1:16:33 PM11/8/15
to poppr

Hi,


For context, this post is a product of the following posts:


https://groups.google.com/forum/#!topic/poppr/hgEwoowW3gA

https://groups.google.com/forum/#!topic/poppr/2oLpsGlI54Y


For further information on strata, type help("strata", package = "adegenet") in your R console. Since the strata slot is optional, it is empty by default. It takes a data frame where the rows represent samples and the columns represent the different population strata that each individual could take. 


In your example, you only have 1 population stratum which defines 4 populations, thus you would only have 1 column for the strata.  


As outlined in section 2.1 of the strata tutorial, you can define the strata using the function strata() with a data frame like so:


strata(myData) <- data.frame(Pop = pop(myData)) # create the strata
head
(strata(myData))                            # show the results


This will create the data frame with a single column called "Pop" and then show you the top of the resulting data frame. I'm using "Pop" here because it's generic, but you can change it to anything that's meaningful. From here, you can use the poppr.amova() function like so:


poppr.amova(myData, hier = ~Pop)

If you find that you want to do a hierarchical AMOVA and you have definitions for subpopulations, you can add those definitions to your object with the function addStrata(). 


Hope that helps,

Zhian

Ramendra Sarma

unread,
Nov 9, 2015, 12:11:11 AM11/9/15
to poppr
Thank you for clearing the doubts. How to calculate pairwise Fst now in "poppr"

Zhian Kamvar

unread,
Nov 9, 2015, 12:09:57 PM11/9/15
to poppr
Hi,

The package poppr does not calculate pairwise Fst because it can be calculated via other packages. This can be done with the package hierfstat, but you need to install the development version (instructions on website): https://github.com/jgx65/hierfstat

After that, you can use the function Fst as outlined in the adegenet basics tutorial (past page 42): https://github.com/thibautjombart/adegenet/raw/master/tutorials/tutorial-basics.pdf


Best,
Zhian
Reply all
Reply to author
Forward
0 new messages