5884b9f213c7d339352dda9c40a6466ce3e12a1c gperez2 Wed Jul 16 11:58:33 2025 -0700 Updating the bedMethyl/bigMethyl Track Format page, refs #36002 diff --git src/hg/htdocs/goldenPath/help/bedMethyl.html src/hg/htdocs/goldenPath/help/bedMethyl.html index 2b70c9ebc3f..491b668a7a5 100755 --- src/hg/htdocs/goldenPath/help/bedMethyl.html +++ src/hg/htdocs/goldenPath/help/bedMethyl.html @@ -1,51 +1,180 @@ -

BedMethyl Track Format

+

bedMethyl and bigMethyl Track Format

-The bedMethyl format allows display of methylation sites. +The bedMethyl +format is an extension of the standard BED 9 format used +to display DNA methylation site data in a genome browser. This format is useful for base-resolution +methylation data generated by bisulfite sequencing or direct methylation detection methods such as +long-read sequencing. By including both methylation level and support (coverage), bedMethyl +provides a detailed view of methylation across the genome.

-

General Structure

-

-The bedMethyl format is line-oriented. BedMethyl data are preceded by a -track definition line, which adds a number of options for -controlling the default display of this track.

+

The bedMethyl format includes the information of a BED 9 along with additional fields:

+ + +

+ +

+ +

The items are colored from 0% +methylated modified (blue) to +100% (red). Hovering over an item or +clicking it shows the additional details found in bedMethyl.

+ + +

Creating a bedMethyl custom track

+ +

Example #1

-Following the track definition line are the track data in 18 column BED format:

+In this example, you will create a bedMethyl custom track using bedMethyl data for the hg38 assembly.

+
    +
  1. Paste the following track line into the + custom track management + page for the human assembly hg38. + +
    
    +
    +track type=bedMethyl name="bedmethyl example" description="bedMethyl custom track" visibility="pack"
    +chr21 5010053 5010054 h 0 + 5010053 5010054 255,0,0 1 0.00 0 0 1 0 0 0 0
    +chr21 5010053 5010054 m 0 + 5010053 5010054 255,0,0 1 0.00 1 0 0 0 0 0 0
    +chr21 5010215 5010216 h 0 + 5010215 5010216 255,0,0 1 30.00 0 0 1 0 0 0 0
    +chr21 5010215 5010216 m 0 + 5010215 5010216 255,0,0 1 30.00 1 0 0 0 0 0 0
    +chr21 5010331 5010332 h 0 + 5010331 5010332 255,0,0 1 70.00 0 0 1 0 0 0 0
    +chr21 5010331 5010332 m 0 + 5010331 5010332 255,0,0 1 70.00 1 0 0 0 0 0 0
    +chr21 5010335 5010336 h 0 + 5010335 5010336 255,0,0 1 100.00 0 0 1 0 0 0 0
    +chr21 5010335 5010336 m 0 + 5010335 5010336 255,0,0 1 100.00 1 0 0 0 0 0 0
    +   
  2. + +
  3. Click the "submit" button.
  4. +
  5. Go to chr21:5,010,030-5,010,408 to see the data.
  6. +
+

+ -
chromA  chromStartA  chromEndA  dataValueA
-chromB  chromStartB  chromEndB  dataValueB
+ +

bigMethyl Format

+

The bigMethyl format is the indexed version of bedMethyl using bedToBigBed. +See bigBed format. The bigMethyl format is more efficient to display in +the Genome Browser, and it offers more trackDb options, which will allow for customization. The +following autoSql definition is an example on how to specify bigMethyl files. -

Parameters for bedMethyl track definition lines

+This definition, contained in the file +bigMethyl.as, +is pulled in when the bedToBigBed utility is run with the +-as=bigMethyl.as option.

+

+table bigMethyl
+"bigMethyl bedMethyl"
+(
+    string   chrom;            "Reference sequence chromosome or scaffold"
+    uint     chromStart;       "Start position in chrom"
+    uint     chromEnd;         "End position in chrom"
+    string   name;             "dbSNP Reference SNP (rs) identifier or :"
+    uint     score;            "Score from 0-1000, derived from p-value"
+    char[1]  strand;           "Unused.  Always '.'"
+    uint     thickStart;       "Start position in chrom"
+    uint     thickEnd;         "End position in chrom"
+    uint     color;            "Red (positive effect) or blue (negative). Brightness reflects pvalue"
+    string   nValidCov;        "Valid Coverage"
+    double   percMod;          "Percent Modified"
+    uint     nMod;             "Number of calls with a modified base"
+    uint     nCanon;           "Number of calls with a canonical base"
+    uint     nOther;           "Number of calls with a modified base, other modification"
+    uint     nDelete;          "Number of reads with a deletion at this reference position"
+    uint     nFail;            "Number of calls where the probability of the call was below the threshold"
+    uint     nDiff;            "Number of reads with a base other than the canonical base for this modification"
+    uint     nNoCall;          "Number of reads aligned to this reference position, with the correct canonical base, but without a base modification call"
+)   
+

The first 9 fields of this bigMethyl format are the same as the first 9 fields of the standard +BED format.

+ + +

Creating a bigMethyl custom track

+ +

Example #2

-All options are placed in a single line separated by spaces:

-
track type=bedMethyl name=track_label description=center_label
-    
+In this example, you will create a bigMethyl file to display as a custom track.

+
    +
  1. + Save this bedMethyl file to your + computer.
  2. +
  3. + Save the autoSql files bigMethyl.as to your computer.
  4. +
  5. + Download the bedToBigBed + utility.
  6. +
  7. + Save the hg38.chrom.sizes text file to your computer. This + file contains the chrom.sizes for the human hg38 assembly.
  8. +
  9. +Use the bedToBigBed utility to create a bigMethyl file from your sorted bedMethyl file, using +the bedMethyl.bed file and chrom.sizes files created above.

    +
    bedToBigBed -as=bigMethyl.as -type=bed9+9 bedMethyl.bed hg38.chrom.sizes bigMethyl.bb
  10. -Note: if you copy/paste the above example, you must remove the line breaks.

    +
  11. +Move the newly created bigMethyl file (bigMethyl.bb) to a web-accessible http, https, or +ftp location. At this point you should have a URL to your data, such as "https://institution.edu/bigMethyl.bb", and the file should be accessible outside of your institution/hosting providers network. For more information on where to host your data, please see the Hosting section of the Track Hub Help documentation. Construct a custom track line with a bigDataUrl parameter pointing to the newly created bigMethyl file.

    +
    track type=bigMethyl name="bigMethyl Example" description="A bigMethyl file" bigDataUrl=http://genome.ucsc.edu/goldenPath/help/examples/bigMethyl.bb visibility=pack
  12. +
  13. + Go to chr21:5,010,030-5,010,408 to see the data.
  14. +
+ + + +

Sharing your data with others

-The track type is REQUIRED, and must be bedMethyl:

-
type=bedMethyl
+Custom tracks can also be loaded via one URL line. +This link loads the same bigMethyl.bb track and sets additional display parameters from Example 2 in the URL:

+
http://genome.ucsc.edu/cgi-bin/hgTracks?ignoreCookie=1&db=hg38&position=chr21:5,010,030-5,010,408&hgct_customText=track%20type=bigMethyl%20name=Example %20bigDataUrl=http://genome.ucsc.edu/goldenPath/help/examples/bigMethyl.bb %20visibility=pack
+

+If you would like to share your bigMethyl data track with a colleague, learn how to create a URL +link to your data by looking at Example #6 on the +custom track help page.

-

Data Values

+ +

Extracting data from the bigMethyl format

-BedMethyl track data values can be integer or real, positive or negative values. The -chromosome coordinates are zero-based, half-open. -This means that the first chromosome position is 0, and the last position in a chromosome -of length N would be N - 1. The positions listed in the input data must be in -numerical order, and only the specified positions will be graphed. bedMethyl format has eighteen -columns of data:

chrom chromStart chromEnd dataValue

+Because the bigMethyl files are an extension of bigBed files, which are indexed binary files, it can +be difficult to extract data from them. UCSC has developed the following programs to assist +in working with bigBed formats, available from the +binary utilities directory.

+

-

Example

+As with all UCSC Genome Browser programs, simply type the program name (with no parameters) at the +command line to view the usage statement.

+ + +

Troubleshooting

-Note: -The above example is a custom track that includes a track type= line that is -specific for loading the data in the browser. This line will cause a raw bedMethyl data file to fail -validation by other tools, such as validateFiles, outside of the browser.

+If you encounter an error when you run the bedToBigBed program, check your input +file for data coordinates that extend past the the end of the chromosome. If these are present, run +the bedClip program +(available here) to remove the problematic +row(s) in your input file before running the bedToBigBed program.

+