Thursday, August 18, 2011

Bases in sequence positions

There are two different coordinate base systems in different files: 0-base and 1-base. Different files use different base systems, and sometimes it causes confusions (especially when one tries to calculate the length of the region). Here I show the differences in two systems, and summarize several file formats that use both sytems.

0-base system: the first base is 0. You represent a region as [a, b). This is also called "half-close-half-open", "0-base end exclusive", or "1-base end inclusive". When calculating the length of the region, subtract a from b directly:

L=b-a

1-base system: the first base is 1, and you represent a region as [a,b]. When calculating the length of the region, don't forget to add 1:

L=b-a+1

Here is an example. Suppose you want to represent a region of X in the following sequence:


000XXX0000


In the 0-base system, this is represented as [3,6), and the length is 6-3=3. In the 1-base system, use [4, 6], and the length is 6-4+1=3.


0-base system files: BED, BAM
1-base system files: SAM, GFF, GTF, Wig, PSL

7 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Such a wonderful article and I feel that it is best to write more on this topic. Thank you so much because i learn a lot of ideas about it. Keep posting...keep it up guys.
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete
  3. บริการเกมสล็อตออนไลน์ปี 2022 เกมให้เลือกเล่นมากกว่า 1,000 เกมซุปเปอร์สล็อตเล่นผ่านเว็บ f

    ReplyDelete
  4. Sometimes you just want a physical place to go and ask questions when you're stuck. A good aws coaching center electronic city should let you walk in with a broken lab setup and get help, not just push you to a forum. That hands-on support is what separates coaching from passive video courses.

    ReplyDelete