4c3de02785367e3178c78cfb3cb2e9d3bee383e9 mspeir Thu Feb 27 08:18:17 2025 -0800 adding note about file sorting and gzipping, refs #31612 diff --git src/hg/htdocs/goldenPath/help/bigBed.html src/hg/htdocs/goldenPath/help/bigBed.html index 1af394d52e8..606806aa4e6 100755 --- src/hg/htdocs/goldenPath/help/bigBed.html +++ src/hg/htdocs/goldenPath/help/bigBed.html @@ -51,36 +51,43 @@ The last step assumes that your ~/public_html/ directory is accessible from the internet. This may not be the case on your server. You may have to copy the file to another server and web-accessible location at your University. Once you know the URL to the file myBigBed.bb, you can paste this URL into the <a href="../../cgi-bin/hgCustom">custom track</a> box on the UCSC Genome Browser to display the file. <a name=overview></a> <h2>Creating a bigBed track</h2> <p> To create a bigBed track, follow these steps (for concrete Unix commands, see the examples below on this page):<p> <p> <strong>Step 1.</strong> Create a BED format file following the directions <a href="../../FAQ/FAQformat.html#format1">here</a>. When converting a BED file to a bigBed file, you are limited to one track of data in your input file; therefore, you must create a separate BED -file for each data track. Your BED file must be sorted. +file for each data track.</p> <p> If your BED file was originally a custom track, remove any existing "track" or "browser" lines from your BED file so that it -contains only data. Also the input BED must be sorted, performed with this command: -<code>sort -k1,1 -k2,2n unsorted.bed > input.bed</code> +contains only data. +<p> +Your file does not need to be sorted by chromosome name, but all entries for a +single chromosome must be together and sorted by chromosome start position. If you're not +sure if this is true for your BED file, it may be easiest to sort the file +using the "-sort" option for <code>bedToBigBed</code>.</p> +<p> +Finally, if your BED files are large, they can be compressed using gzip (e.g. <code>myTrack.bed.gz</code>) and still read +by <code>bedToBigBed</code>. </p> <p> <strong>Step 2.</strong> Download the <code>bedToBigBed</code> program from the <a href="http://hgdownload.soe.ucsc.edu/admin/exe/">binary utilities directory</a>. Example #2 below shows the exact Unix command. </p> <p> The <code>bedToBigBed</code> program can be run with several additional options. Some of these, such as the <code>-as</code> and <code>-type</code> options, are used in examples below. The <code>-type</code> option, describes the size of the bigBed file, <code>-type=bedN[+[P]]</code>, where <code>N</code> is an integer between 3 and 12 and the optional <code>+[P]</code> parameter specifies the number of extra fields, not required, but preferred. Describing the size of the bigBed file