目录

说明

Admixture通过EM算法一般用于指定亚群分类;或者在不知材料群体结构背景下,通过迭代交叉验证获得error值,取最小error对应的K值为推荐亚群数目。如果我们预先已知群体的类型(百分百确信),那么可以考虑监督分类方法,设置标签,提高分群的准确性。

Admixture目前是1.3.0,文档也刚更新不久。

怕翻译有误,贴上官方文档:

Estimating P and Q from the SNP matrix G, without any additional information, can be

viewed as an unsupervised learning problem. However it is not uncommon that some or

all of the individuals in our data sample will have known ancestries, allowing us to set

some rows in the matrix Q to known constants. This allows more accurate estimation of

the ancestries of the remaining individuals, and of the ancestral allele frequencies. Viewing

these reference individuals as training samples, the problem is transformed into a supervised

learning problem.

Supervised learning mode is enabled with the flag --supervised and requires an additional

file with a .pop suffix, specifying the ancestries of the reference individuals. It is assumed

that all reference samples have 100% ancestry from some ancestral population. Each line

of the .pop file corresponds to individual listed on the same line number in the .fam or

.ped file. If the individual is a population reference, the .pop file line should be a string

(beginning with an alphanumeric character) designating the population. If the individual

is of unknown ancestry, use “-” (or a blank line, or any non-alphanumeric character) to

indicate that the ancestry should be estimated.

文档中说要准备一个.pop为后缀的群体文件,就是对个体进行分类(字符型),类型未知的可用“-”替代。不建议在windows中创建,因为换行符不同的问题。

如何验证准备的.pop文件?作者建议使用paste .fam .pop查看个体数目是不是相等(用wc -l不是更简单吗?)。

问题来了,作者根本就没说明到底怎么运行?我尝试了下,简单记录下。

实战

下载官网示例数据:

http://dalexander.github.io/admixture/download.html



解压后,有plink数据格式,配套的bed,bim,fam,但少了个ped,没有和map配套。这个作者有点粗心,不过可以用plink转一下:

wget http://dalexander.github.io/admixture/hapmap3-files.tar.gz
tar -xvf hapmap3-files.tar.gz
plink --bfile hapmap3 --recode --out hapmap3--noweb
wc -l hapmap3*

准备hapmap3.pop文件(注意前缀和pink数据保持一致,且在同一目录),可用R、awk等工具,随意模拟一个:

dat = data.frame(V1 = rep(c("A","-","B","-","C","-"),each=54))
write.table(dat,"hapmap3.pop",row.names=F,col.names=F,quote=F,sep="\t")

加上supervised,运行admixture即可:

admixture hapmap3.ped 3 --supervised

可以看看不加supervised和加了的区别,没加的结果:

加了的结果:

还是有很大差异的。具体对后续结果的影响这里就不研究了。

Admixture的监督分群(Supervised analysis)的更多相关文章

  1. Tableau 分群

    对数据的特征进行分析,分群. 数据选用的是Iris data 下载地址:http://archive.ics.uci.edu/ml/machine-learning-databases/iris/ 1 ...

  2. python实现六大分群质量评估指标(兰德系数、互信息、轮廓系数)

    python实现六大分群质量评估指标(兰德系数.互信息.轮廓系数) 1 R语言中的分群质量--轮廓系数 因为先前惯用R语言,那么来看看R语言中的分群质量评估,节选自笔记︱多种常见聚类模型以及分群质量评 ...

  3. 客户主题分析(tableau)—客户分群

    主要分析方面:客户合理分群 客户分群实现:使用聚类构建指标,需理解聚类的分析逻辑,需使用软件:tableau 聚类方法:选择3指标分别为购买总金额,客户购买次数.类平均购买价格(四类的平均购买价格,四 ...

  4. 用K-Means聚类分析做客户分群

    聚类指的是把集合,分组成多个类,每个类中的对象都是彼此相似的.K-means是聚类中最常用的方法之一,它是基于点与点距离的相似度来计算最佳类别归属. 在使用该方法前,要注意(1)对数据异常值的处理:( ...

  5. k-means实战-RFM客户价值分群

    数据挖掘的十大算法 基本概念 导入数据集到mysql数据库中 总共有940个独立消费数据 K-Means 算法 K-Means 算法是一个聚类算法.你可以这么理解,最终我想把物体划分成 K 类.假设每 ...

  6. ModelArts微认证零售客户分群知识点总结

    \ 作者:华为云MVP郑永祥

  7. Cohort Analysis Using Python

    Cohort Analysis是将某一个时期内的用户划分为一个cohort,并将多个cohort进行时间上的某个属性的比较的一种分析方法.Cohort Analysis在有些场景下非常有用.比如一个网 ...

  8. 【P3O是什么】P3O认证之项目组合、项目群和项目办公室

    如何区分项目组合办公室与项目群和项目办公室? P3O®(Portfolio,Programmed and Project Offices-项目组合.项目群和项目办公室)是由英国商务部 OGC 于200 ...

  9. DSAPI官方QQ群

    DSAPI官方QQ群  请加主群,若主群成员已满,请加分群. 群内除常规的.NET技术交流外,也负责DSAPI的使用技术支持和更新通知.   『VB.NET/C#编程』主群              ...

随机推荐

  1. airtest常用指令

    airtest 操作adb命令   常用adb 1)对特定设备执行adb指令 dev = connect_device("Android:///device1") dev.shel ...

  2. 验证域用户(C#)

    代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Intero ...

  3. [对对子队]Scrum Meeting 博客汇总

    对对子队 博客目录 一.Scrum Meeting 1. Alpha Scrum Meeting 1(会议记录4.10) Scrum Meeting 2(会议记录4.11) Scrum Meeting ...

  4. BUAA2020软工作业(一)——谈谈我和计算机的缘分

    项目 内容 这个作业属于哪个课程 2020春季计算机学院软件工程(罗杰 任健) 这个作业的要求在哪里 第一次作业-热身! 我在这个课程的目标是 进一步提高自己的编码能力,工程能力 这个作业在哪个具体方 ...

  5. Go语言核心36讲(Go语言进阶技术八)--学习笔记

    14 | 接口类型的合理运用 前导内容:正确使用接口的基础知识 在 Go 语言的语境中,当我们在谈论"接口"的时候,一定指的是接口类型.因为接口类型与其他数据类型不同,它是没法被实 ...

  6. 如何理解Stand SPI Dual SPI 和Quad SPI??

    1.首先看一下接口 Standard SPI: CLK, /CS, DI, DO, /WP, /Hold Dual SPI: CLK, /CS, IO0, IO1, /WP, /Hold Quad S ...

  7. 单片机I/O口推挽与开漏输出详解(力荐)

    推挽输出:可以输出高,低电平,连接数字器件;推挽结构一般是指两个三极管分别受两互补信号的控制,总是在一个三极管导通的时候另一个截止. 开漏输出:输出端相当于三极管的集电极. 要得到高电平状态需要上拉电 ...

  8. Python:Ubuntu上出现错误 Could not load dynamic library 'libnvinfer.so.6' / 'libnvinfer_plugin.so.6'

    运行一个py文件,出现如下的错误,原因是没有找到 libnvinfer.so.6 相关库的文件. 1 2021-01-04 18:41:17.324477: W tensorflow/stream_e ...

  9. 因为一个小小的Integer问题导致阿里一面没过,遗憾!

    面试题:new Integer(112)和Integer.valueOf(112)的区别 面试官考察点猜想 这道题,考察的是对Integer这个对象原理的理解,关于这道题的变体有很多,我们会一一进行分 ...

  10. 浅谈对typora的使用

    内容概要 - 什么是typora - typora的具体使用 目录 内容概要 - 什么是typora - typora的具体使用 1. 什么是typora 2.typora的具体使用 1.标题级别 2 ...