{"id":333,"date":"2016-12-12T17:10:52","date_gmt":"2016-12-13T01:10:52","guid":{"rendered":"http:\/\/genome.ucsc.edu\/blog\/?p=333"},"modified":"2021-10-30T22:15:53","modified_gmt":"2021-10-30T22:15:53","slug":"the-ucsc-genome-browser-coordinate-counting-systems","status":"publish","type":"post","link":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/2016\/12\/12\/the-ucsc-genome-browser-coordinate-counting-systems\/","title":{"rendered":"The UCSC Genome Browser Coordinate Counting Systems"},"content":{"rendered":"<p style=\"text-align: left;\"><span style=\"color: #666699;\"><i><span style=\"font-weight: 400;\">If you think dogs can&#8217;t count, try putting three dog biscuits in your pocket and then giving Fido only two of them. &nbsp;<\/span><\/i><\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"color: #666699;\"><i><span style=\"font-weight: 400;\">~Phil Pastoret<\/span><\/i><\/span><\/p>\n<p>\u201cCounting is easy. Right?\u201d<\/p>\n<p>I say this with my hand out, my thumb and 4 fingers spread out. With my other hand&#8217;s pointer finger, I simply count each digit, &#8220;one, two, three, four, five.&#8221; Easy.<\/p>\n<p>But what happens when you start counting at 0 instead of 1? You can see that you have 5 digits (4 fingers and a thumb), but how do you calculate the size of your range?<\/p>\n<p>With your hand in mind as an example, let&#8217;s look at counting conventions as they relate to bioinformatics and the UCSC Genome Browser genomic coordinate systems.<\/p>\n<p>The UCSC Genome Browser uses two different systems:<\/p>\n<div class='dropshadowboxes-container ' style='width:auto;'>\r\n                            <div class='dropshadowboxes-drop-shadow dropshadowboxes-rounded-corners dropshadowboxes-inside-and-outside-shadow dropshadowboxes-raised-with-inside-shadow-with-outside-shadow dropshadowboxes-effect-default' style=' border: 2px solid #dddddd; height:; background-color:#f7f8fd;    '>\r\n                            \u201c1-start, fully-closed\u201d = coordinates positioned within the web-based UCSC Genome Browser. \u201c0-start, half-open\u201d = coordinates stored in database tables.\r\n                            <\/div>\r\n                        <\/div>\n<h5><span style=\"color: #4a86e8;\"><b><span style=\"color: #666699;\">Table 1. UCSC Genome Browser coordinate systems summary<\/span><br \/>\n<\/b><\/span><\/h5>\n<table style=\"height: 118px;\" width=\"624\">\n<tbody>\n<tr>\n<td><b>0-start, half-open (0-based)<\/b><\/td>\n<td><b>1-start, fully-closed (1-based)<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">&#8220;BED&#8221; format (Browser Extensible Data):<\/span><br \/>\n<span style=\"color: #000000;\">chr1 12714000<\/span><span style=\"color: #ff0000;\"><strong>0<\/strong> <span style=\"color: #000000;\">127140001<br \/>\nNote: Spaces, not punctuation<br \/>\n<span style=\"color: #666699;\"><em>When using BED format, browser &amp; utilities<\/em><\/span><br \/>\n<span style=\"color: #666699;\"><em>assume coords are 0-start, half-open.<\/em><\/span><\/span><\/span><\/td>\n<td><span style=\"color: #000000;\">&#8220;Position&#8221; format:<\/span><br \/>\n<span style=\"color: #000000;\">chr1<strong><span style=\"color: #ff0000;\">:<\/span><\/strong>12714000<\/span><strong><span style=\"color: #ff0000;\">1-<\/span><\/strong><span style=\"color: #000000;\">127140001<br \/>\nNote: Punctuation used, no spaces<br \/>\n<span style=\"color: #666699;\"><em>When using &#8220;position&#8221; format, browser &amp; utilities<\/em><\/span><br \/>\n<span style=\"color: #666699;\"><em>assume coords are 1-start, fully-closed.<\/em><\/span><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">Stored in UCSC Genome Browser tables<\/span><\/td>\n<td><span style=\"color: #000000;\">Positioned in UCSC Genome Browser web interface<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">To convert to 1-start, fully-closed:<\/span><br \/>\n<span style=\"color: #000000;\">add 1 to start, end = same<\/span><\/td>\n<td><span style=\"color: #000000;\">To convert to 0-start, half-open:<br \/>\nsubtract 1 from start, end = same<\/span><i><span style=\"font-weight: 400;\">&nbsp;<\/span><\/i><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1><span style=\"color: #ff6600;\"><strong>Section 1: Interval types<\/strong><\/span><\/h1>\n<p><span style=\"color: #4a86e8;\"><b>0-start vs. 1-start<\/b>&nbsp;:&nbsp;<\/span><span style=\"font-weight: 400; color: #333333;\">Does counting start at 0 or 1?<br \/>\n<\/span><span style=\"font-weight: 400; color: #4a86e8;\">Synonyms:<br \/>\nSometimes referred to as \u201c0-based&#8221; vs &#8220;1-based\u201d or&nbsp;<\/span><span style=\"font-weight: 400; color: #4a86e8;\">&#8220;0-relative vs &#8220;1-relative.&#8221;<\/span><\/p>\n<p><span style=\"color: #4a86e8;\"><b>Interval Types<br \/>\n<\/b><\/span><span style=\"font-weight: 400;\">For a counted range, is the <\/span><b>specified interval<\/b> <span style=\"font-weight: 400; color: #ff0000;\">fully-open<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400; color: #0000ff;\">fully-closed<\/span><span style=\"font-weight: 400;\">, or a <\/span><span style=\"color: #713cc7;\"><span style=\"font-weight: 400;\">hybrid-interval (e.g., half-open)<\/span><span style=\"font-weight: 400;\">? <\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ok, time to flashback to math class!<br \/>\nYou might recall that specifying an interval type as open, closed (or a combination, e.g., \u201chalf-open\u201d) refers to whether or not the endpoints of the interval are included in the set. For further explanation, see the<\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Interval_(mathematics)#Terminology\"><span style=\"font-weight: 400;\">interval math terminology wiki article<\/span><\/a><span style=\"font-weight: 400;\">. <\/span><b>Figure 1<\/b><span style=\"font-weight: 400;\"> below describes various interval types.<br \/>\n<\/span><br \/>\n<a href=\"http:\/\/genome.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newInterval.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-334 aligncenter\" src=\"http:\/\/genome.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newInterval-300x199.png\" alt=\"Figure1\" width=\"597\" height=\"396\" srcset=\"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newInterval-300x199.png 300w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newInterval-768x510.png 768w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newInterval-624x414.png 624w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newInterval.png 836w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/a><\/p>\n<p><b>Figure 1.<\/b>&nbsp;(To enlarge, click image.)&nbsp;<i><span style=\"font-weight: 400;\">Description of interval types. <\/span><\/i><\/p>\n<h1><span style=\"color: #4a86e8;\"><b><span style=\"color: #ff6600;\">Section 2: Interval types in the UCSC Genome Browser<\/span><br \/>\n<\/b><\/span><\/h1>\n<h2><span style=\"color: #4a86e8;\"><b>UCSC Genome Browser web interface = \u201c1-start, fully-closed\u201d<\/b><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A common counting convention is a system that we all used when we first learned to count the fingers on our hands; this is referred to as the &#8220;one-based, fully-closed&#8221; system (<\/span><b>Figure 2<\/b><span style=\"font-weight: 400;\">, below). Note that an extra step is needed to calculate the range total (5). <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The <\/span>\u201c1-start, fully-closed\u201d <span style=\"font-weight: 400;\">system is what you SEE when using the UCSC Genome Browser web interface. However, all positional data that are stored in database tables use a different system. <\/span><\/p>\n<p><a href=\"http:\/\/genome.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/1-startHandFinal.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-434\" src=\"http:\/\/genome.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/1-startHandFinal.png\" alt=\"1-starthandfinal\" width=\"732\" height=\"726\" srcset=\"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/1-startHandFinal.png 732w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/1-startHandFinal-150x150.png 150w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/1-startHandFinal-300x298.png 300w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/1-startHandFinal-624x619.png 624w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><\/p>\n<p><b>Figure 2.&nbsp;<\/b><span style=\"font-weight: 400;\">(To enlarge, click image.)<\/span><i><span style=\"font-weight: 400;\">&nbsp;1-start, fully-closed interval. Most common counting convention. Used within the UCSC Genome Browser web interface (but not used in UCSC Genome Browser databases\/tables). We calculate that we have 5 digits because 5 (pinky finger, range end) &#8211; 1 (the thumb, range start) = 4. We then need to add one to calculate the correct range; 4+1= 5.<\/span><\/i><\/p>\n<h2><span style=\"color: #4a86e8;\"><b>UCSC Genome Browser tables = \u201c0-start, half-open\u201d<\/b><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">While the commonly-used &#8220;one-start, fully-closed&#8221; system is more intuitive, it is not always the most efficient method for performing calculations in bioinformatic systems, because an additional step is required to calculate the size of the base-pair (bp) range. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">To increase efficiency, the UCSC Genome Browser uses a \u201chybrid-interval\u201d coordinate system for storing coordinates in databases\/tables that is referred to as \u201c0-start, half-open\u201d (see <\/span><b>Figure 3<\/b><span style=\"font-weight: 400;\">, below). <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Although coordinates in the web browser are converted to the more human-readable \u201c1-start, fully-closed\u201d system, coordinates are stored in database tables as \u201c0-start, half-open.\u201d You may have heard various terms to express this 0-start system:<\/span><\/p>\n<p><span style=\"color: #4a86e8;\"><b>Synonyms for \u201c0-start, half-open\u201d<\/b><\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; color: #4a86e8;\">0-based, half-open <\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; color: #4a86e8;\">0-based start, 1-based end<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; color: #4a86e8;\">Note: This is not technically accurate, but conceptually helpful. A \u201c1-based end\u201d refers to the end of the range being included, as in the common \u201c1-based, fully-closed\u201d system.<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400; color: #4a86e8;\">0-start, hybrid-interval (interval type is: start-included, end-excluded)<\/span><\/li>\n<\/ul>\n<p><a href=\"http:\/\/genome.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newHand0-startFinal.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-437\" src=\"http:\/\/genome.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newHand0-startFinal.png\" alt=\"newhand0-startfinal\" width=\"768\" height=\"728\" srcset=\"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newHand0-startFinal.png 768w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newHand0-startFinal-300x284.png 300w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/newHand0-startFinal-624x592.png 624w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/p>\n<p><b>Figure 3.&nbsp;<\/b>(To enlarge, click image.)&nbsp;<i><span style=\"font-weight: 400;\">The UCSC Genome Browser coordinate system for databases\/tables (not the web interface) is \u201c0-start, half-open\u201d where start is included (closed-interval), and stop is excluded (open-interval). We calculate that we have 5 digits because 5 (range end after pinky finger) &#8211; 0 (the thumb, range start) &nbsp;= 5.<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">Another example which compares 0-start and 1-start systems is seen below, in <\/span><b>Figure 4<\/b><span style=\"font-weight: 400;\">. This figure describes the differences in defining and calculating the range for a specified sequence highlighted in yellow, \u201cT, C, G, A.\u201d<\/span><\/p>\n<p><a href=\"http:\/\/genome.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/finalGrid-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-441\" src=\"http:\/\/genome.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/finalGrid-1.png\" alt=\"finalgrid\" width=\"915\" height=\"773\" srcset=\"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/finalGrid-1.png 915w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/finalGrid-1-300x253.png 300w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/finalGrid-1-768x649.png 768w, https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-content\/uploads\/2016\/12\/finalGrid-1-624x527.png 624w\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" \/><\/a><\/p>\n<p><b>Figure 4.<\/b>&nbsp;(To enlarge, click image.) &nbsp;<i><span style=\"font-weight: 400;\">Calculation of genomic range for comparing \u201c1-start, fully-closed\u201d vs. \u201c0-start, half-open\u201d counting systems.<\/span><\/i><\/p>\n<h1><span style=\"color: #ff6600;\">Section 3: Formatting<\/span><\/h1>\n<h3><span style=\"color: #4a86e8;\"><b>Coordinate formatting indicates interval type<\/b><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The UCSC Genome Browser&nbsp;and many of its related command-line utilities&nbsp;distinguish two types of formatted coordinates and make assumptions of each type.<\/span><\/p>\n<p><b>The \u201cPosition\u201d format<\/b><span style=\"font-weight: 400;\"> (referring to the \u201c1-start, fully-closed\u201d system as coordinates are \u201cpositioned\u201d in the browser)<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Written as: chr1<span style=\"color: #ff0000;\"><b>:<\/b><\/span>12714000<b><span style=\"color: #ff0000;\">1-<\/span><\/b>127140001<\/span><\/li>\n<li><span style=\"font-weight: 400;\">No spaces. <\/span><\/li>\n<li><span style=\"font-weight: 400;\">Includes punctuation: a colon after the chromosome, and a dash between the start and end coordinates.<\/span><\/li>\n<li>When in this format, the assumption is that the coordinate is 1-start, fully-closed.<\/li>\n<\/ul>\n<p><b>The \u201cBED\u201d format<\/b><span style=\"font-weight: 400;\"> (referring to the \u201c0-start, half-open\u201d system)<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Written as: <\/span><span style=\"font-weight: 400;\">chr1<\/span> <span style=\"font-weight: 400;\">12714000<\/span><b><span style=\"color: #ff0000;\">0<\/span> <\/b><span style=\"font-weight: 400;\">127140001<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Spaces between chromosome, start coordinate, and end coordinate.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">No punctuation.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">When in this format, the assumption is that the coordinates are <\/span><span style=\"font-weight: 400;\">0-start, half-open.<\/span><\/li>\n<\/ul>\n<h1><span style=\"color: #ff6600;\">Section 4: Examples<\/span><\/h1>\n<h3><span style=\"color: #4a86e8;\"><b>SNP example<\/b><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">What we SEE in the Genome Browser interface itself is the &#8220;1-start, fully-closed&#8221; system. However, these data are not STORED in the UCSC Genome Browser databases and tables in the same way. The UCSC Genome Browser databases store coordinates in the \u201c0-start, half-open\u201d coordinate system.<\/span><\/p>\n<h5><span style=\"color: #666699;\"><b>Table 2. SNP coordinates in web browser (1-start) vs table (0-start)<\/b><\/span><\/h5>\n<table style=\"height: 118px;\" width=\"624\">\n<tbody>\n<tr>\n<td><b>rs782519173 (hg38)<\/b><\/td>\n<td><b>Start<\/b><\/td>\n<td><b>End<\/b><\/td>\n<\/tr>\n<tr>\n<td>Positioned in web browser: 1-start, fully-closed<\/td>\n<td><span style=\"font-weight: 400;\">&nbsp;13325570<span style=\"color: #ff0000;\"><strong>8<\/strong><\/span><\/span><\/td>\n<td>&nbsp;133255708<\/td>\n<\/tr>\n<tr>\n<td>Stored in table: 0-start, half-open<\/td>\n<td>&nbsp;13325570<strong><span style=\"color: #ff0000;\">7<\/span><\/strong><\/td>\n<td>&nbsp;133255708<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span style=\"color: #4a86e8;\"><b>LiftOver examples and coordinate formatting<\/b><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Let\u2019s take a look at the two types of coordinate formatting (\u201cBED\u201d and \u201cposition\u201d) when using the UCSC Genome Browser web-based and command-line utility liftOver tools. <\/span><\/p>\n<p><strong>1) Web-based LiftOver example<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Below is an example from the UCSC Genome Browser\u2019s <\/span><a href=\"http:\/\/genome.ucsc.edu\/cgi-bin\/hgLiftOver\"><span style=\"font-weight: 400;\">web-based LiftOver<\/span><\/a><span style=\"font-weight: 400;\"> tool (Home &gt; Tools &gt; LiftOver). Depending on how input coordinates are formatted, web-based LiftOver will assume the associated coordinate system and output the results in the same format.<\/span><\/p>\n<h5><span style=\"color: #666699;\"><b>Table 3. UCSC Genome Browser <\/b><b><i>web-based<\/i><\/b><b>&nbsp;LiftOver and &#8220;position&#8221; coordinate formatting<br \/>\n<\/b><\/span><\/h5>\n<table style=\"height: 118px;\" width=\"624\">\n<tbody>\n<tr>\n<td><b>Input:<\/b><\/td>\n<td><span style=\"font-weight: 400;\">Assembly = panTro3<br \/>\nchr1<\/span><b>:<\/b><span style=\"font-weight: 400;\">12714000<strong><span style=\"color: #ff0000;\">1<\/span><\/strong><\/span><b>&#8211;<\/b><span style=\"font-weight: 400;\">127140001<\/span><\/td>\n<\/tr>\n<tr>\n<td><strong>Output:<\/strong><\/td>\n<td><span style=\"font-weight: 400;\">Lifts to this position in hg19:<br \/>\n<\/span><span style=\"font-weight: 400;\">chr1<\/span><b>:<\/b><span style=\"font-weight: 400;\">11025531<strong><span style=\"color: #ff0000;\">3<\/span><\/strong><\/span><b>&#8211;<\/b><span style=\"font-weight: 400;\">110255313<\/span><\/td>\n<\/tr>\n<tr>\n<td><strong>Notes:<\/strong><\/td>\n<td><span style=\"font-weight: 400;\">If your input is entered with the&nbsp;<\/span><span style=\"font-weight: 400;\">\u201cposition\u201d formatted coords (1-start, fully-closed),<br \/>\n<\/span><span style=\"font-weight: 400;\">the browser will also output the same \u201cposition\u201d format. (Note positional format<br \/>\nincludes &#8220;:&#8221; and &#8220;-&#8221; and no spaces.)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5><span style=\"color: #666699;\"><b>Table 4. UCSC Genome Browser <\/b><b><i>web-based<\/i><\/b><b>&nbsp;LiftOver and &#8220;BED&#8221; coordinate formatting<\/b><\/span><\/h5>\n<table style=\"height: 118px;\" width=\"624\">\n<tbody>\n<tr>\n<td><b>Input:<\/b><\/td>\n<td><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Assembly = panTro3<br \/>\n<\/span><\/span><span style=\"font-weight: 400;\">chr1 12714000<\/span><span style=\"color: #ff0000;\"><b>0<\/b><\/span><span style=\"font-weight: 400;\"> 127140001<\/span><\/td>\n<\/tr>\n<tr>\n<td><strong>Output:<\/strong><\/td>\n<td><span style=\"font-weight: 400;\">Lifts to this position in hg19:<br \/>\n<\/span><span style=\"font-weight: 400;\">chr1 11025531<\/span><span style=\"color: #ff0000;\"><b>2<\/b><\/span><span style=\"font-weight: 400;\"> 110255313<\/span><\/td>\n<\/tr>\n<tr>\n<td><strong>Notes:<\/strong><\/td>\n<td><span style=\"font-weight: 400;\">If your input is entered with the&nbsp;\u201cBED\u201d formatted coords (0-start, half-open), the<br \/>\nbrowser will also output the same \u201cBED\u201d format. (Note BED format contains no<br \/>\npunctuation and includes spaces.)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5><span style=\"color: #666699;\"><b>&nbsp;<\/b><\/span><em><span style=\"font-weight: 400;\">* Note that the web-based output file extension is misleading in this case; while titled &#8220;*.bed&#8221; the positional output is not actually in &#8220;0-start, half-open&#8221; BED format, because the 1-start, fully-closed &#8220;positional&#8221; format was used for input.&nbsp;<\/span><\/em><\/h5>\n<p><b> &nbsp;2) Command-line liftOver utility example<\/b><\/p>\n<p><span style=\"font-weight: 400;\">When using the command-line utility of liftOver, understanding coordinate formatting is also important. Just like the web-based tool, coordinate formatting <\/span><i><span style=\"font-weight: 400;\">specifies<\/span><\/i><span style=\"font-weight: 400;\"> either the \u201c0-start half-open\u201d or the \u201c1-start fully-closed\u201d convention. For example, if you have a list of 1-start &#8220;position&#8221; formatted coordinates, and you want to use the <\/span><a href=\"http:\/\/hgdownload.soe.ucsc.edu\/admin\/exe\/\"><span style=\"font-weight: 400;\">command-line liftOver utility<\/span><\/a><span style=\"font-weight: 400;\">, you will need to specify in your command that you are using &#8220;position&#8221; <\/span><i><span style=\"font-weight: 400;\">formatted <\/span><\/i><span style=\"font-weight: 400;\">coordinates to the liftOver utility.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To view the liftOver utility usage statement and options, enter &#8220;liftOver&#8221; on your command-line (with no other arguments, and without the quotes). <\/span><\/p>\n<h5><span style=\"color: #666699;\"><b>Table 5. UCSC Genome Browser <\/b><b><i>command-line<\/i><\/b><b> liftOver and &#8220;position&#8221; coordinate formatting<\/b><\/span><\/h5>\n<table style=\"height: 118px;\" width=\"624\">\n<tbody>\n<tr>\n<td><b>Input:<br \/>\n<\/b><em>(panTro3.txt)<\/em><\/td>\n<td><span style=\"font-weight: 400;\">chr1<\/span><strong><span style=\"color: #ff0000;\">:<\/span><\/strong><span style=\"font-weight: 400;\">12714000<strong><span style=\"color: #ff0000;\">1<\/span><\/strong><\/span><strong><span style=\"color: #ff0000;\">&#8211;<\/span><\/strong><span style=\"font-weight: 400;\">127140001<\/span><\/td>\n<\/tr>\n<tr>\n<td><strong>Command:<\/strong><\/td>\n<td><span style=\"font-weight: 400;\">liftOver <\/span><strong><span style=\"color: #ff0000;\">-positions<\/span><\/strong><span style=\"font-weight: 400;\"> panTro3.txt liftOver\/panTro3ToHg19.over.chain.gz mapped unMapped<\/span><\/td>\n<\/tr>\n<tr>\n<td><strong>Output:<\/strong><\/td>\n<td>chr1<strong><span style=\"color: #ff0000;\">:<\/span><\/strong>11025531<strong><span style=\"color: #ff0000;\">3<\/span><span style=\"color: #ff0000;\">&#8211;<\/span><\/strong>110255313<br \/>\n<span style=\"font-weight: 400;\">via \u201c<\/span><i><span style=\"font-weight: 400;\">mapped<\/span><\/i><span style=\"font-weight: 400;\">\u201d file for hg19<\/span><\/td>\n<\/tr>\n<tr>\n<td><strong>Notes:<\/strong><\/td>\n<td><i><span style=\"font-weight: 400;\">Note: Must specify \u201c-positions\u201d for 1-start \u201cposition\u201d format in command-line liftOver<\/span><\/i><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5><span style=\"color: #666699;\"><b>Table 6. UCSC Genome Browser <\/b><b><i>command-line<\/i><\/b><b> liftOver and &#8220;BED&#8221; coordinate formatting<br \/>\n<\/b><\/span><\/h5>\n<table style=\"height: 118px;\" width=\"624\">\n<tbody>\n<tr>\n<td><b><b>Input:<br \/>\n<\/b><\/b><em>(panTro3.bed)<\/em><b><br \/>\n<\/b><\/td>\n<td>chr1 12714000<span style=\"color: #ff0000;\"><strong>0<\/strong> <\/span>127140001<\/td>\n<\/tr>\n<tr>\n<td><strong>Command:<\/strong><\/td>\n<td>liftOver panTro3.bed liftOver\/panTro3ToHg19.over.chain.gz mapped unMapped<\/td>\n<\/tr>\n<tr>\n<td><strong>Output:<\/strong><\/td>\n<td>chr1 11025531<strong><span style=\"color: #ff0000;\">2<\/span><\/strong> 110255313<br \/>\n<span style=\"font-weight: 400;\">via \u201c<\/span><i><span style=\"font-weight: 400;\">mapped<\/span><\/i><span style=\"font-weight: 400;\">\u201d file for hg19<\/span><\/td>\n<\/tr>\n<tr>\n<td><strong>Notes:<\/strong><\/td>\n<td><i><span style=\"font-weight: 400;\">Note: No special argument needed, 0-start \u201cBED\u201d formatted coordinates are default.&nbsp;<\/span><\/i><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><span style=\"font-weight: 400;\"><span style=\"color: #4a86e8;\"><strong>Wiggle Files<br \/>\n<\/strong><\/span><\/span><\/h3>\n<p>The <a href=\"http:\/\/genome.ucsc.edu\/goldenPath\/help\/wiggle.html\"><span style=\"font-weight: 400;\">wiggle (WIG) format<\/span><\/a><span style=\"font-weight: 400;\"> is used for dense, continuous data where graphing is represented in the browser. Wiggle files of variableStep or fixedStep data use \u201c1-start, fully-closed\u201d coordinates.&nbsp;<\/span><span style=\"font-weight: 400;\">Like all other UCSC Genome Browser data, these coordinates are positioned in the browser as &#8220;1-start, fully-closed.&#8221;<\/span><\/p>\n<p><strong>Note:<\/strong>&nbsp;Many other&nbsp;formats outside of the UCSC Genome Browser use 1-start coordinate systems, such as GTF\/GFF.<\/p>\n<h5><span style=\"color: #666699;\"><b>Table 7. UCSC Genome Browser wiggle files &amp; coordinate systems<\/b><\/span><\/h5>\n<table>\n<tbody>\n<tr>\n<td><b>File Type<\/b><\/td>\n<td><b>Wiggle file<\/b><\/td>\n<td><b>Coordinate system as positioned<br \/>\nin UCSC Genome Browser<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">bedGraph -&gt; bigWig<\/span><\/td>\n<td><span style=\"font-weight: 400;\">0-start, half-open<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1-start, fully-closed<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">wiggle variableStep -&gt; bigWig<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1-start, fully-closed<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1-start, fully-closed<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">wiggle fixedStep -&gt; bigWig<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1-start, fully-closed<\/span><\/td>\n<td><span style=\"font-weight: 400;\">1-start, fully-closed<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1><span style=\"color: #ff6600;\">&nbsp;Section 5: Resources<\/span><\/h1>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Sequence Coordinates: 0- vs 1-base, Bob Milius, PhD <\/span><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"http:\/\/ihiws.org\/wp-content\/uploads\/2016\/10\/20160925_SequenceCoordinates_ASHI2016.pdf\"><span style=\"font-weight: 400;\">[pdf]<\/span><\/a><\/span><\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Cheat Sheet For One-Based Vs Zero-Based Coordinate Systems <\/span><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/www.biostars.org\/p\/84686\/\"><span style=\"font-weight: 400;\">[Biostars Forum]<\/span><\/a><\/span><\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Database\/browser start coordinates differ by 1 base <\/span><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/genome.ucsc.edu\/FAQ\/FAQtracks#tracks1\"><span style=\"font-weight: 400;\">[UCSC Genome Browser, FAQ]<\/span><\/a><\/span><\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Genome wiki: Coordinate Transforms <\/span><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"http:\/\/genomewiki.ucsc.edu\/index.php\/Coordinate_Transforms\"><span style=\"font-weight: 400;\">[UCSC Genome Browser Wiki: \u201cgenomewiki\u201d]<\/span><\/a><\/span><\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">UCSC Genome Browser: <\/span><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/genome.ucsc.edu\/goldenpath\/help\/wiggle.html\"><span style=\"font-weight: 400;\">wiggle format help page<\/span><\/a><\/span><\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"color: #000000;\"><span style=\"font-weight: 400;\">Kent WJ, Zweig AS, Barber G, Hinrichs AS, Karolchik D. <\/span><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"http:\/\/bioinformatics.oxfordjournals.org\/content\/26\/17\/2204.long\"><span style=\"font-weight: 400;\">BigWig and BigBed: enabling browsing of large distributed data sets<\/span><\/a><\/span><span style=\"font-weight: 400;\">. <\/span><i><span style=\"font-weight: 400;\">Bioinformatics.<\/span><\/i><span style=\"font-weight: 400;\"> 2010 Sep 1;26(17):2204-7. Epub 2010 Jul 17.<\/span><\/span><\/li>\n<\/ul>\n<hr>\n<p>If after reading this blog post you have any public questions, please email <a href=\"mailto:genome@soe.ucsc.edu\" target=\"_blank\" rel=\"noopener\">genome@soe.ucsc.edu<\/a>. All messages sent to that address are archived on a <a href=\"https:\/\/groups.google.com\/a\/soe.ucsc.edu\/forum\/#!forum\/genome\">publicly accessible forum<\/a>. If your question includes sensitive data, you may send it instead to&nbsp;<a href=\"mailto:genome-www@soe.ucsc.edu\" target=\"_blank\" rel=\"noopener\">genome-www@soe.ucsc.edu<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you think dogs can&#8217;t count, try putting three dog biscuits in your pocket and then giving Fido only two of them. &nbsp; ~Phil Pastoret \u201cCounting is easy. Right?\u201d I say this with my hand out, my thumb and 4 fingers spread out. With my other hand&#8217;s pointer finger, I simply count each digit, &#8220;one, [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-333","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/posts\/333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/comments?post=333"}],"version-history":[{"count":115,"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/posts\/333\/revisions"}],"predecessor-version":[{"id":945,"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/posts\/333\/revisions\/945"}],"wp:attachment":[{"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/media?parent=333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/categories?post=333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genome-blog.gi.ucsc.edu\/blog\/wp-json\/wp\/v2\/tags?post=333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}