Bed to BigWig

4,503 views
Skip to first unread message

Aravind TALLAM

unread,
Jun 27, 2013, 9:16:01 AM6/27/13
to gen...@soe.ucsc.edu

Hello All,

 

Could someone advise me how to convert BED files to Bigwig files.

 

Thanks for your help.

 

Regards

Aravind

 

………………………………………

Aravind Tallam

PhD Student

 

UNIVERSITÉ DU LUXEMBOURG

 

LUXEMBOURG CENTRE FOR SYSTEMS BIOMEDICINE

Campus Belval | House of Biomedicine

7, avenue des Hauts-Fourneaux

L-4362 Esch-sur-Alzette

T +352 46 66 44 6161

F +352 46 66 44 6949

Mobile: +352 661626369

aravind...@uni.lu     http://lcsb.uni.lu

 

 

-----

This message is confidential and may contain privileged information. It is intended for the named recipient only. If you receive it in error please notify me and permanently delete the original message and any copies.

-----

P Before printing this e-mail care about what you consume, where it comes from, where it will go. Live sustainably !

 

 

Pauline Fujita

unread,
Jun 27, 2013, 8:05:08 PM6/27/13
to Aravind TALLAM, gen...@soe.ucsc.edu
Hello Aravind,

Depending on what you are trying to do you may find one of these 3
utilities useful:

bedGraphToBigWig - to convert a bedGraph file to a bigWig file.
bedItemOverlapCount - to convert the number of bed items in a region
to a wiggle file.
bedToBigBed - to convert a BED file to a bigBed file.

You can read more about downloading and using our utilities here:

http://hgdownload.cse.ucsc.edu/downloads.html#source_downloads

If you run any of the utilities with no arguments you can see its
usage statement:

bedGraphToBigWig v 4 - Convert a bedGraph file to bigWig format.
usage:
bedGraphToBigWig in.bedGraph chrom.sizes out.bw
where in.bedGraph is a four column file in the format:
<chrom> <start> <end> <value>
and chrom.sizes is two column: <chromosome name> <size in bases>
and out.bw is the output indexed big wig file.
Use the script: fetchChromSizes to obtain the actual chrom.sizes information
from UCSC, please do not make up a chrom sizes from your own information.
The input bedGraph file must be sorted, use the unix sort command:
sort -k1,1 -k2,2n unsorted.bedGraph > sorted.bedGraph
options:
-blockSize=N - Number of items to bundle in r-tree. Default 256
-itemsPerSlot=N - Number of data points bundled at lowest level. Default 1024
-unc - If set, do not use compression.

bedItemOverlapCount - count number of times a base is overlapped by the
items in a bed file. Output is bedGraph 4 to stdout.
usage:
sort bedFile.bed | bedItemOverlapCount [options] <database> stdin
To create a bigWig file from this data to use in a custom track:
sort -k1,1 bedFile.bed | bedItemOverlapCount [options] <database> stdin \
> bedFile.bedGraph
bedGraphToBigWig bedFile.bedGraph chrom.sizes bedFile.bw
where the chrom.sizes is obtained with the script: fetchChromSizes
See also:
http://genome-test.cse.ucsc.edu/~kent/src/unzipped/utils/userApps/fetchChromSizes
options:
-zero add blocks with zero count, normally these are ommitted
-bed12 expect bed12 and count based on blocks
Without this option, only the first three fields are used.
-max if counts per base overflows set to max (4294967295) instead of exiting
-outBounds output min/max to stderr
-chromSize=sizefile Read chrom sizes from file instead of database
sizefile contains two white space separated fields per line:
chrom name and size
-host=hostname mysql host used to get chrom sizes
-user=username mysql user
-password=password mysql password

Notes: * You may want to separate your + and - strand
items before sending into this program as it only looks at
the chrom, start and end columns of the bed file. * Program requires a
<database> connection to lookup chrom sizes for a sanity
check of the incoming data. Even when the -chromSize argument is used
the <database> must be present, but it will not be used.

The bed file must be sorted by chrom
Maximum count per base is 4294967295. Recompile with new unitSize to
increase this

bedToBigBed v. 2.5 - Convert bed file to bigBed. (BigBed version: 4)
usage:
bedToBigBed in.bed chrom.sizes out.bb
Where in.bed is in one of the ascii bed formats, but not including track lines
and chrom.sizes is two column: <chromosome name> <size in bases>
and out.bb is the output indexed big bed file.
Use the script: fetchChromSizes to obtain the actual chrom.sizes information
from UCSC, please do not make up a chrom sizes from your own information.
The in.bed file must be sorted by chromosome,start,
to sort a bed file, use the unix sort command:
sort -k1,1 -k2,2n unsorted.bed > sorted.bed

options:
-type=bedN[+[P]] :
N is between 3 and 15,
optional () if extra "bedPlus" fields,
optional P specifies the number of extra fields. Not required, but preferred.
Examples: -type=bed6 or -type=bed6 or -type=bed6+3
(see http://genome.ucsc.edu/FAQ/FAQformat.html#format1)
-as=fields.as - If you have non-standard "bedPlus" fields, it's great
to put a definition
of each field in a row in AutoSql format here.
-blockSize=N - Number of items to bundle in r-tree. Default 256
-itemsPerSlot=N - Number of data points bundled at lowest level. Default 512
-unc - If set, do not use compression.
-tab - If set, expect fields to be tab separated, normally
expects white space separator.
-extraIndex=fieldList - If set, make an index on each field in a comma
separated list
extraIndex=name and extraIndex=name,id are commonly used.


Best regards,

Pauline Fujita
UCSC Genome Bioinformatics Group
http://genome.ucsc.edu
> --
>
>
>
Reply all
Reply to author
Forward
0 new messages