Difference between revisions of "BedGraph"

From wubrowse wiki
Jump to: navigation, search
(Created page with "bedGraph track is used for showing numerical values along the genomic coordinate. In the track, the genome is separated into a set of intervals and each interval is assigned t...")
 
Line 20: Line 20:
 
  tabix -p bed new_file.gz
 
  tabix -p bed new_file.gz
 
4. move files "new_file.gz" and "new_file.gz.tbi" to a web server. The two files must be in the same directory. Obtain the URL to "new_file.gz" for submission.
 
4. move files "new_file.gz" and "new_file.gz.tbi" to a web server. The two files must be in the same directory. Obtain the URL to "new_file.gz" for submission.
 +
 +
=Converting bigWig to bedGraph=
 +
* if you have compiled the UCSC kent source utilies, you would get an utility called '''bigWigToBedGraph''':
 +
<pre>
 +
$ bigWigToBedGraph
 +
bigWigToBedGraph - Convert from bigWig to bedGraph format.
 +
usage:
 +
  bigWigToBedGraph in.bigWig out.bedGraph
 +
options:
 +
  -chrom=chr1 - if set restrict output to given chromosome
 +
  -start=N - if set, restrict output to only that over start
 +
  -end=N - if set, restict output to only that under end
 +
  -udcDir=/dir/to/cache - place to put cache for remote bigBed/bigWigs
 +
 +
</pre>
 +
* You could use this tool to convert bigWig files to bedGraph, and then tabix it as above.
 +
 +
* You could also download this utility (compiled by UCSC) from UCSC website: http://hgdownload.soe.ucsc.edu/admin/exe/

Revision as of 16:45, 10 September 2014

bedGraph track is used for showing numerical values along the genomic coordinate. In the track, the genome is separated into a set of intervals and each interval is assigned to a specific numerical value.

Each line of a bedGraph track file contains four fields:

  1. chromosome name
  2. start, 0-based
  3. stop
  4. numerical value

Take following steps to prepare a bedGraph track for browser display.

1. sort the track file using "sort" command:

sort -k1,1 -k2,2n old_file > new_file

2. compress file

bgzip new_file

3. index file

tabix -p bed new_file.gz

4. move files "new_file.gz" and "new_file.gz.tbi" to a web server. The two files must be in the same directory. Obtain the URL to "new_file.gz" for submission.

Converting bigWig to bedGraph

  • if you have compiled the UCSC kent source utilies, you would get an utility called bigWigToBedGraph:
$ bigWigToBedGraph 
bigWigToBedGraph - Convert from bigWig to bedGraph format.
usage:
   bigWigToBedGraph in.bigWig out.bedGraph
options:
   -chrom=chr1 - if set restrict output to given chromosome
   -start=N - if set, restrict output to only that over start
   -end=N - if set, restict output to only that under end
   -udcDir=/dir/to/cache - place to put cache for remote bigBed/bigWigs

  • You could use this tool to convert bigWig files to bedGraph, and then tabix it as above.