Hi Everybody, I calculated f3-statistics values with admixtools using combination (TARGETPOP, WORLD_WIDEPOPS, OUTGROUP), now i want to draw the data values for given population in terms of color circle points on world map. I started from here http://eriqande.github.io/rep-res-web/lectures/making-maps-with-R.html] and I figured out few initial commands:
library(ggplot2)
library(ggmap)
library(maps)
library(mapdata)
w <- map_data("world")
ggplot() + geom_polygon(data = w, aes(x=long, y = lat, group = group), fill = "gray", color = "gray") + coord_fixed(1.3)
But I don't know how to plot data values for hundred of populations, how to get long and lat values or work in layers in R, plotting country boundaries, etc..
Can anyone please guide me how to plot such data points on a world map. For example the image:
https://pbs.twimg.com/media/Cl89J3rUoAA4P8o.jpg:large
How to plot those outgroup f3-statistics on a map, as in the Anzick man paper https://t.co/AwAZLdx6SB pic.twitter.com/G28e5ltr6P
— Craig Anderson (@craigandersn) June 27, 2016
kind regards
sohail
Please edit your page and just post the actual link, not the Google redirect URL.
This is the actual link: https://twitter.com/craigandersn/status/747383480720424960
Or if you want just the image: https://pbs.twimg.com/media/Cl89J3rUoAA4P8o.jpg:large
Provide example data.
Hi @zx8754,
The example dataset includes many populations with F3-statistics values. For instance, F3(TARGET, X, OUTGROUPPOP), where the X pop with their corresponding output values are e.g.:
thanks!
To put these on a world map you need to know where in the world they come from, i.e. your data should also contain this information either as countries or as geographic coordinates. The example data you showed is incomplete.
@Jean-Karim, Thanks for your reply. is there any way to get the approximate Lat. and long. information, if the exact info. is unknown and haven't collected during sample collection, but the city/province/area names are known...
If country level resolution is sufficient, you can get country coordinates in R from the rworldmap package:
For a wider range of names, you can try the package geonames which gets names from the geonames database. To use the package, you need to create an account and enable webservices for your account. Then use the GNsearch() function. Try something like: