This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Macs/Peaksplitter Output - Not Recognized By Igv Browser

I ran MACS with the --call-subpeaks option on my BAM files. I got three BED files, one of them is the subpeaks file. However, when I open this file in IGV, I cannot see any peaks in that track. The other two BED files work well. I looked at them in vim and the subpeak one does not seem to be a valid BED file, it has five columns, no (peak) name column at all.

But maybe I am doing something wrong. How should I view the subpeak file in the genome browser (IGV)?

EDIT: IGV actually does not accept the file at all since it is not a valid BED file (it throws an error: Error parsing line at byte position: org.broad.tribble.readers.LineIteratorImpl@5ec4b942). Only after renaming to .bed.narrowpeak, it accepts the file but does not show any peaks. (The file is not valid narrowpeak BED file either.)

peak-calling macs igv

1 answer

OK, the output of PeakSplitter is not meant to be in BED file (so it is not).

How to transform it into BED format retaining the scores:

  1. Copy the first 4 columns to a new file:

    cut -f 1-4 old_file.bed > new_file.bed

  2. Delete the first line (header).

  3. Insert an empty name column, in vim:

    :%s/\(\t\d*\)$/\t\.\1/g

Log in to answer this question.