1 准备bed文件(R)
rawID <- data.frame(matrix(unlist(rawID),ncol = 3,byrow = T))
colnames(rawID) <- c("chr","start","end")
write.table(rawID,"input.bed",col.names = F,row.names = F,quote = F, sep = "\t")
2 下载坐标转换对应文件,hg38TOhg19
wget http://hgdownload.soe.ucsc.edu/goldenPath/hg38/liftOver/hg38ToHg19.over.chain.gz
gunzip hg38ToHg19.over.chain.gz
3 下载转换工具
wget -c http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/liftOver
chmod 755 liftOver
./liftOver
4 进行转换
./liftOver input.bed hg38ToHg19.over.chain output_hg19.bed unMapped
5 查看结果
#hg38
cat input.bed | head
chr1 1223243 1223968
chr1 1804418 1806538
chr1 9931890 9934860
chr1 10433841 10442441
chr1 15534236 15536814
chr1 15638306 15643650
chr1 15717892 15721388
chr1 20749722 20773610
chr1 20757165 20773610
#hg19
cat output_hg19.bed | head
chr1 1158623 1159348
chr1 1735857 1737977
chr1 9991948 9994918
chr1 10493898 10502498
chr1 15860731 15863309
chr1 15964801 15970145
chr1 16044387 16047883
chr1 21076215 21100103
chr1 21083658 21100103