# toy admixture matrix with labels for individuals/rows that match well with ancestry/columns
Q <- matrix(
c(
0.1, 0.8, 0.1,
0.1, 0.7, 0.2,
0.0, 0.4, 0.6,
0.0, 0.3, 0.7,
0.9, 0.0, 0.1
),
nrow = 5,
ncol = 3,
byrow = TRUE
)
labs <- c('X', 'X', 'Y', 'Y', 'Z')
# to calculate matches and save as column names, do this:
colnames( Q ) <- admix_label_cols( Q, labs )
# expected column names: c('Z', 'X', 'Y')
Run the code above in your browser using DataLab