Question: fixedStep or variableStep Smoothening wig file
gravatar for kashifalikhan007
9 months ago by
kashifalikhan00740 wrote:

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 • 407 views
ADD COMMENTlink modified 9 months ago by Alex Reynolds24k • written 9 months ago by kashifalikhan00740
gravatar for Alex Reynolds
9 months ago by
Alex Reynolds24k
Seattle, WA USA
Alex Reynolds24k wrote:

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 COMMENTlink modified 9 months ago • written 9 months ago by Alex Reynolds24k
gravatar for genecats.ucsc
9 months ago by
genecats.ucsc500 wrote:

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:

  • for general questions (public list)
  • for question concerning private data (private list)
  • for questions concerning the setup and running of your own UCSC Genome Browser installation

ChrisL from the UCSC Genome Browser

ADD COMMENTlink written 9 months ago by genecats.ucsc500
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 914 users visited in the last hour