Skip to content

Main content

BED Zero To Start

Convert one nonempty zero-based half-open BED interval to one-based inclusive coordinates; empty intervals are outside this conversion.

Loading tool…

Description

Convert a nonempty zero-based half-open BED interval to one-based endpoints.

Sequence formats distinguish coordinate origins, included endpoints, allele separators and identifier grammars. A genomic interbase position differs from a base number, and a parsed optional-field value may still violate its declared type. Local token checks preserve representation without validating a complete file, sequence, reference assembly or biological interpretation.

Convert a nonempty zero-based half-open BED interval to one-based endpoints.

When to use this tool

Use BED Zero To Start when you already have bedStart, bedEndExclusive and need to convert a nonempty zero-based half-open BED interval to one-based endpoints.

How to use the tool and how it works

  1. Enter bedStart, bedEndExclusive. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read oneBasedStart, oneBasedEndInclusive, length. Use the output convention below.

Require safe whole bedStart>=0 and bedEndExclusive>=bedStart+1; return start+1, end unchanged as inclusive end, and end-start length.1

BED starts are zero-based and its end coordinate is excluded. Converting the start by one preserves the interval length when expressing the same nonempty interval with one-based inclusive endpoints.2

Input fieldMeaning and unitsAccepted input
bedStartBed StartRequired. Safe integer; minimum 0.
bedEndExclusiveExcluded BED end, required greater than bedStart; numerically equal to one-based inclusive end.Required. Safe integer.
Output fieldInterpretationReturned shape
oneBasedStartOne Based StartRequired. Safe integer.
oneBasedEndInclusiveOne Based End InclusiveRequired. Safe integer.
lengthLengthRequired. Safe integer.
json
{
  "input": {
    "bedStart": 99,
    "bedEndExclusive": 120
  },
  "output": {
    "oneBasedStart": 100,
    "oneBasedEndInclusive": 120,
    "length": 21
  }
}

Limitations and assumptions

  • This rejects empty intervals. No chromosome, assembly, feature strand, contig bounds or full BED record is verified.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use the complete applicable file specification and a full format validator for conformance. Verify reference assembly, sequence bounds, annotation and database context before interpreting local fields or coordinate transformations.

References

  1. Calculation and input contract: bioinformatics/bed-zero-to-start — tool.io

  2. Genome Browser: BED format — UCSC Genome Browser

Similar or alternative tools