SNP分析命令

E:\ > cd e:
E:
E:\ > cd plink-1
E:\plink-1>plink –file test

  1. Map 更新
    Plink --goat --file data --update-map position.txt --recode --out data1
    Chrnew.txt -- update-chr --recode --out data2
    Position: SNP code and position
    Chrnew:SNP code and Chr.
    2.SNP merge
    Plink --file data1 --merge data2.ped data2.map --recode --out merge
    3.提取SNP位点
    Plink --file data --extract 50kSNP.txt --recode --out data1
    50kSNP.txt: 50k中的SNP名
  2. Quality control
    Call rate >98%/99%
    Plink --file goat --geno 0.02 --recode --out goatgeno
    Plink --file goatgeno --mind 0.01 --recode --out goatmind
    MAF>0.05
    Plink --file goatmind --maf 0.05 --recode --out goatmaf
    Hardy-Weinberg equilibrium <0.0001
    Plink --file goatmaf --hwe 0.0001 --recode --out goathwe
    Exclude the SNP markers with either chromosome or both unknown
    Plink --goat --file goathwe --extract 4newsnp.txt --recode --out goat4
    Note: 制作4newsnp.txt(包含 chromosome 和 base-pair position 都为0的SNP)
    To identify sample duplication or half-sibs or closer
    Plink –goat –file goat4 –genome –max 0.85
    Note:Check the genome file
  3. LD quality control
    Plink –goat --file goat4 –indep-pairwise 100 25 0.2 –out goatld0.2
    Plink --goat --file goat4 --indep-pairwise 100 25 0.05 --out goatld0.05
    Plink --file goat4 --ld-window-r2 0.2 --out goatldr0.2
    输出结果为 data prunein 和 data prune out
    (质控时,要去除X染色体)
    将data prune in 转化为ped和map
    Plink --goat --file 114hwe --extract 114goat0.05.prune.in --recode --out goatforpca
  4. PCA-
    PCA的三个文件:
    Plink --goat --file data(生成LD的文件) --extract data (LD).prune.in --recode --out goatforpca
    1goatforpca.ped 改为5.ped
    2goatforpca.map 改为5.pedsnp
    3将goatforpca 制作成二进制文件 输出5b
    plink --file hapmap1 --make-bed --out hapmap1
    结果为5b.farm即为ped文件的前6列, 将5b.farm 改名为5.pedind
    Note: 5.pedind 文件中要将第六列-9换成familyID.
    参数文件
    Genotypename: 5.ped
    Snp name: 5.pedsnp
    Indivame: 5.pedind
    Evecoutname: 5.pca.evec
    Evaloutname: 5.eval
    Altnormstyle: NO
    Numoutevec: 3
    Numoutlieriter: 5
    Numoutlierevec: 10
    Outlier sigmathresh: 6.0
    Qt mode: NO
    将上述文件拷贝到eigensoft/bin 文件夹内
    打开命令
    Cd EIG5.01/bin
    作图命令
    ./smartpca –p 5.par
    ./ploteig –I 5.pca.evec –c 1:2 –p AL:BSB:…Tiberan –x 5-0
    即可得到PCA
    在5.pca.evec文件中可以看到主成分占的比例。
    7 原始SNP数据转化成map和ped文件

data=read.csv("E:/SNP/zang.csv") (data=read.csv("E:/SNP/chicken.csv")
Ta=t(data)
write.table(Ta,file="E:/snp/1.txt", quote=FALSE, sep=" ", na="0")
检查命令:--Compound –genotypes
8: 近交系数计算, 多态性含量, Ho He 哈温P值)
plink --file filename --het --out filename1
plink --file filename --homozyg --out filename1
plink --file filename --hardy --out filename1(Plink --file filename –hardy, 结果为plink.hwe)
9: ADZE软件计算Ar 和 pAr
Plink 转化成structure
1Plink --file filename --recode-structure --out filename1
2用PGDspider 转化ped 文件为structure结构。
将plink转化的位点信息粘贴到PGDspider转化的文件中
全基因组关联分析
plink --file data --remove mylist.txt --recode --out filename
plink --goat --file filename --out name –assoc
plink --goat --file filename --out name --assoc --adjust
R软件中绘制manhattan 图
先安装qqman软件
library(qqman)
results<- read.table("D:/plink/plink1/plink.assoc",T)
manhattan(results, ylim = c(0, 10), col = c("blue4", "orange3"))
R软件中绘制qq-plot图
library(qqman)
results<- read.table("D:/plink/plink1/plink.assoc",T)
qq(results$P)
用其他关联分析方法:
plink --goat --file mar --out mar-model --model --model-trend --adjust
LD 分析(haploview)
1 info 文件生成:plink --file hu-M2 --recodeHV --out hu-M2HV
R 安装 GenABEL
Install packages (GenABEL)
Install packages (MASS)
Install packages(Gen ABEL.data)
加载安装包
Library (MASS)
Library(Gen ABEL.data)
Library(GenABEL)
在使用GenABEL前需要准备4个文件
Ped、map、phen(当ped中含有多个表型时用到)、praw
1生成tped、tfram 文件
Plink –file name –transpose –recode –out gwa-gabel
当多个表型时还还需要—pheo phenol.phen –pheno-name
2制作praw文件
格式 id sex phen(sex:female=0, male=1 phen case=1 control=0)
“Sss12” 1 0
“Sss18” 1
1 GLM test
Testb<- scan.glm(‘phen~CRSNP’, family=binomial(),data=b.dat)
2 score test
Testb.qt<- qtscore(phen, data=b.dat, trait=”binomial”)
Test.qt@lambda

格式转化:
1 二进制格式转为 tped/tfam 或 ped/map

用bfile来读取test3.bed,test3.bim和test3.fam文件

生成test4.tped和test4.tfam

plink --bfile test3 --recode --transpose --out test4

生成test5.ped和test5.map

plink --bfile test3 --recode --out test5

  1. Quality control
    Call rate >98%/99%
    Plink --file goat1 --geno 0.02 --recode --out goatgeno
    Plink --file goatgeno --mind 0.01 --recode --out goatmind
    MAF>0.05
    Plink --file goatmind --maf 0.05 --recode --out goatmaf
    Hardy-Weinberg equilibrium <0.0001
    Plink --file goatmaf --hwe 0.0001 --recode --out goathwe
    Exclude the SNP markers with either chromosome or both unknown
    Plink --file goathwe --exclude 4newsnp.txt --recode --out goat4
    Note: 制作4newsnp.txt(包含 chromosome 和 base-pair position 都为0的SNP)
    To identify sample duplication or half-sibs or closer
    Plink –goat –file goat4 –genome –max 0.85
    Note:Check the genome file
  2. LD quality control
    Plink --file goat --indep-pairwise 100 25 0.2 --out goatld0.2
    Plink --goat --file goat --indep-pairwise 100 25 0.05 --out goatld0.05
    Plink --file goat4 --ld-window-r2 0.2 --out goatldr0.2
    输出结果为 data prunein 和 data prune out
    (质控时,要去除X染色体)
    将data prune in 转化为ped和map
    Plink --goat --file goat --extract goatld0.05.prune.in --recode --out goatforpca

D:\科研\山羊SNP\SNP分析软件\plink-1.07-dos

plink --cow --vcf Europeanibex.vcf --recode --out output

山羊分群:

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 217,907评论 6 506
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,987评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,298评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,586评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,633评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,488评论 1 302
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,275评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,176评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,619评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,819评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,932评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,655评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,265评论 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,871评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,994评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,095评论 3 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,884评论 2 354

推荐阅读更多精彩内容