其他分享
首页 > 其他分享> > plink格式中如何提取重复的位点

plink格式中如何提取重复的位点

作者:互联网

1、

dat <- read.table("test.map",header = F)
dat2 <- dat[c(1,4)]
unique(sort(dat2$V1))
dat2[dat2$V1 == "X",]$V1 = 10000
dat2$V1 <- as.numeric(dat2$V1)
dat2$V4 <- as.numeric(dat2$V4)
dat3 <- dat2[order(dat2$V1,dat2$V4),]
dat4 <- dat[duplicated(dat3),]
dim(dat4)
write.table(dat4$V2, "dup1.txt",col.names = F, row.names = F,quote = F,sep = "\t")

 

 

2、简化程序

dat <- read.table("test.map",header = F)
dat2 <- dat[c(1,4)]
dat3 <- dat[duplicated(dat2),]
write.table(dat3$V2, "dup2.txt",col.names = F, row.names = F,quote = F,sep = "\t")

 

标签:提取,plink,dat,简化,格式,位点
来源: https://www.cnblogs.com/liujiaxin2018/p/14976459.html