fixedStep or variableStep Smoothening wig file
2
3
Entering edit mode
7.2 years ago
kashiff007 ★ 1.9k

Is there any tools available for smoothing the wig file (fixed or variable) with different span (wig file can have with any spanned data) ? Although, DANPOS has a function for smoothing the resultant wig file, but it does not have any separate function for smoothing the wig file.

Here I am showing an example of before and after smoothing: enter image description here

Green: After smoothing Black: Before smoothing Note: both files are different

wig file wiggle smoothing • 2.8k views
ADD COMMENT
3
Entering edit mode
7.2 years ago

Here's a way to do things on the command line, which gives quantitative control over the inputs and outputs.

1) Convert your fixed- or variable-step WIG to BED with BEDOPS wig2bed:

$ wig2bed < signal.wig > signal.bed

2) Fetch chromosomes for your genome of interest using Kent Utilities fetchChromSizes and create a sorted BED file with BEDOPS sort-bed:

$ fetchChromSizes hg38 | awk -v OFS="\t" '($1!~/_/){ print $1, "0", $2 }' | sort-bed - > hg38.bed

3) Use BEDOPS bedops with the --chop option to generate bins of the desired width.

For example, we can generate disjoint windows that are 100kbases wide:

$ bedops --chop 100000 hg38.bed > hg38.100k.bins.bed

4) Finally, smooth the signal in the BED file with BEDOPS bedmap, using the signal BED file from step 1, the bins made from the chromosomes acquired from step 3, and some range that collects signal upstream and downstream of the window.

For example, for each bin, we can calculate the mean signal that lies over the window, as well as 50kbases outside the window:

$ bedmap --echo --mean --range 50000 hg38.100k.bins.bed signal.bed > answer.bed

The answer.bed file will contain the coordinates of the bin and the average signal over the bin and 50kbases around its sides.

The smaller the window and the wider the range, the smoother the resulting post-processed signal. Like using coarse sandpaper on a fine hardwood, you could sand away too much. You could use a chromosome as sample input to see how tuning the different parameters changes the smoothing.

ADD COMMENT
2
Entering edit mode
7.2 years ago
genecats.ucsc ▴ 580

You can smooth the display of your wiggle files via the wiggle track user interface on the UCSC Genome Browser:

  1. Upload your wiggle
  2. Once the track is displayed, right click on the track
  3. Find the text "Smoothing window" and in the dropdown list next to it, select the number of pixels to smooth
  4. Click the apply button to preview the ui changes
  5. Click ok once you are satisfied

Unfortunately this won't change the underlying wiggle data at all, if that's what you're interested in.

If you have further questions about the UCSC Genome Browser or our utilites or data, feel free to send an email to one of mailing lists below:

  • genome@soe.ucsc.edu for general questions (public list)
  • genome-www@soe.ucsc.edu for question concerning private data (private list)
  • genome-mirror@soe.ucsc.edu for questions concerning the setup and running of your own UCSC Genome Browser installation

ChrisL from the UCSC Genome Browser

ADD COMMENT

Login before adding your answer.

Traffic: 2303 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6