Author Topic: smoothing  (Read 6203 times)

Udi

  • Newbie
  • *
  • Posts: 1
smoothing
« on: February 06, 2016, 11:17:35 PM »
Hi,

I have a basic question (noob..)

How can i use the smooth option?. couldn't figure it out from here http://bedops.readthedocs.org/en/latest/content/usage-examples/smoothing-tags.html

I have a bed file of reads and I would like to get a bigwig file with smoothed peaks.

Thanks

AlexReynolds

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: smoothing
« Reply #1 on: February 08, 2016, 03:30:39 AM »
The script at http://bedops.readthedocs.org/en/latest/content/usage-examples/smoothing-tags.html glues together various Unix command-line tools with BEDOPS tools like bam2bed, sort-bed, bedmap and starch.

What you could do is use the script, specifying the options you want, which depend on your experiment:

1. <bam-file> - a BAM file containing reads
2. <out-file> - the filename used for the smoothed output (in BEDOPS Starch format, a compressed form of BED)
3. <window-size> - the size of a genomic interval over which signal (counts of reads) is measured
4. <step-size> - the number of bases that each window is shifted or "stepped" over
5. <chromosome-file> - the filename for a BED file containing each of your genome build's chromosome names, and start and stop fields of 0 and the chromosome size for each chromosome (for example, https://gist.github.com/alexpreynolds/6126993 )

Some modifications may be needed, depending on your inputs and outputs.

For example, if you have a BED file of reads, and not BAM, then you can edit the script to remove the bam2bed conversion step, but modify the first awk block to call your BED file directly. Just make sure the BED file is sorted with sort-bed.

If you want to make a bigwig from the output, you can remove the last line of the second awk block that calls the starch binary, and just write the data to a Bedgraph file (a four-column form of BED, where the fourth column is the score value; to write Bedgraph, you can use cut or awk to write the columns you need). Then use UCSC bedGraphToBigWig to convert the Bedgraph file to bigWig.