Täällä voi tarkastella Suomen kuntien geneettistä rakennetta; projekti liittyy aiemmin linkitettyyn Sini Kermisen väitöskirjaan.
https://geneviz.aalto.fi/genetic_ancestry_finland/
library(pheatmap)
library(colorspace)
download.file("https://pastebin.com/raw/QRkUDupj","fst")
t=read.csv("fst",header=T,row.names=1,check.names=F)
g=grep("^R",row.names(t))
t=t[g,g]
t[upper.tri(t)]=0
t=t+t(t)
k=hclust(as.dist(t))
pheatmap(
t/10,
filename="output.png",
clustering_callback=function(...){c(k)},
legend=F,
cellwidth=16,
cellheight=16,
fontsize=8,
border_color=NA,
display_numbers=T,
number_format="%.0f",
fontsize_number=7,
number_color="black",
colorRampPalette(hex(HSV(c(210,180,150,120,90,60,30,0),.5,1)))(256)
)
library(tidyverse)
download.file("https://pastebin.com/raw/QRkUDupj","fst")
x="R10-Savo-Karelia"
y="R10-Southwest"
t=read.csv("fst",header=T,row.names=1,check.names=F)
g=grep("^R",row.names(t))
t=t[g,g]
t[upper.tri(t)]=0
t=t+t(t)
t[is.na(t)]=0
xy=as.data.frame(t[,c(x,y)])
names(xy)=c("x","y")
ggplot(xy,aes(x,y))+
geom_hline(yintercept=0,color="gray60")+
geom_vline(xintercept=0,color="gray60")+
geom_abline(linetype="dashed",color="gray70")+
geom_point(size=1)+
geom_text(label=rownames(xy),size=3.5,vjust=-.7)+
theme(
legend.position="none",
axis.ticks.x=element_blank(),
axis.ticks.y=element_blank(),
axis.ticks.length=unit(0,"pt"),
plot.background=element_rect(fill="white"),
panel.background=element_rect(fill="white"),
panel.grid.major=element_line(color="gray80",size=.25),
panel.grid.minor=element_blank(),
axis.text=element_text(color="black")
)+
coord_fixed()+
scale_x_continuous(breaks=seq(0,1000,100),expand=expansion(mult=.12))+
scale_y_continuous(breaks=seq(0,1000,100),expand=expansion(mult=.05))+
xlab(paste("FST distance to",x))+
ylab(paste("FST distance to",y))+
ggsave("output.png")
system("/usr/local/bin/mogrify -trim -bordercolor white -border 16x16 output.png")
Käyttäjiä lukemassa tätä aluetta: Ei rekisteröityneitä käyttäjiä ja 5 vierailijaa