【3.1】One-Based和Zero-Based区别

用bedtools等工具的时候,就已经困惑了,为什么有的文件是0-based的,有的是1-based。直到前几天,zh发给我了一个连接,才彻底释怀。

In addition to the illustrations/explanation below, Ben Ainscough (a member of our lab) has created a python tool to convert between zero and one based coordinate systems here: https://github.com/griffithlab/convert_zero_one_based

一 0-based和1-based的区别

  • 1-based coordinate system
    Numbers nucleotides directly
  • 0-based coordinate system
    Numbers between nucleotides

二 0-based和1-based都有哪些应用

Ensembl uses 1-based coordinate system UCSC uses 0-based coordinate system

1-based (GFF, SAM, VCF,BLAST))
0-based (BED, BAM,)

三 0-based和1-based的转换

0-based coordinates to 1-based

if (type=SNV){start=start+1; end=end;}
if (type=DEL){start=start+1; end=end;}
if (type=INS){start=start; end=end+1;}

1-based coordinates to 0-based

if (type=SNV){start=start-1; end=end;}
if (type=DEL){start=start-1; end=end;}
if (type=INS){start=start; end=end-1;}

资料

这里是一个广告位,,感兴趣的都可以发邮件聊聊:tiehan@sina.cn
个人公众号,比较懒,很少更新,可以在上面提问题,如果回复不及时,可发邮件给我: tiehan@sina.cn