1
$\begingroup$

I have called peaks using MACS2. Then I got a narrowPeak file like this.

1   4491713 4491913 testONE_peak_1  37  .   2.86003 3.72580 1.66717 80
1   4492782 4493153 testONE_peak_2  27  .   2.22933 2.71107 0.82442 242
1   4571554 4572026 testONE_peak_3  72  .   4.16005 7.21000 4.85200 282
1   4739486 4739879 testONE_peak_4  64  .   3.63128 6.42948 4.14394 275
1   4784848 4785061 testONE_peak_5  31  .   2.24218 3.19160 1.21569 133

Then I tried to visualize it in UCSC Genome browser and I got following error.

Error File 'testONE_peaks.narrowPeak' - Unrecognized format line 1 of file: 1 4491713 4491913 testONE_peak_1  37  .   2.86003 3.72580 1.66717 80 (note: chrom names are case sensitive, e.g.: correct: 'chr1', incorrect: 'Chr1', incorrect: '1')

So I added chr to the chromosome column instead of 1 (Chromosome number).

chr1    4491713 4491913 testONE_peak_1  37  .   2.86003 3.7258  1.66717 80
chr1    4492782 4493153 testONE_peak_2  27  .   2.22933 2.71107 0.82442 242
chr1    4571554 4572026 testONE_peak_3  72  .   4.16005 7.21    4.852   282
chr1    4739486 4739879 testONE_peak_4  64  .   3.63128 6.42948 4.14394 275
chr1    4784848 4785061 testONE_peak_5  31  .   2.24218 3.1916  1.21569 133

When I tried to load the file again I got following error.

Error File 'testONE_peaks_NEW2.narrowPeak' - Error line 1 of custom track: thickStart out of range (chromStart to chromEnd, or 0 if no CDS)

Then I added following line to the top and I could load the file to UCSC Genome browser.

track type=narrowPeak name="Somite narrowPeak"
chr1    4491713 4491913 testONE_peak_1  37  .   2.86003 3.7258  1.66717 80
chr1    4492782 4493153 testONE_peak_2  27  .   2.22933 2.71107 0.82442 242
chr1    4571554 4572026 testONE_peak_3  72  .   4.16005 7.21    4.852   282
chr1    4739486 4739879 testONE_peak_4  64  .   3.63128 6.42948 4.14394 275
chr1    4784848 4785061 testONE_peak_5  31  .   2.24218 3.1916  1.21569 133

But the problem is I can not see anything in the Genome browser. Only the name is there. But nothing else. Do you know what I should do?

$\endgroup$
3
  • $\begingroup$ Please show a screenshot. $\endgroup$
    – user3051
    Feb 12, 2020 at 22:48
  • $\begingroup$ I am struggling with the same problem, where did you add this line of code? awk -v OFS="\t" '$1=$1' your_peaks.narrowPeaks > fixed_your_peaks.narrowPeaks $\endgroup$ Oct 26, 2020 at 7:53
  • $\begingroup$ You can run this command in a command line or terminal $\endgroup$
    – MudithMMBc
    Oct 30, 2020 at 19:27

1 Answer 1

2
$\begingroup$

I think you might have changed the separator (or at least have some kind of inconsistency from the required format) for your file. Note that peak output files from MACS2 are variants of BED files.

It seems you need to have a tab separator for this type of file.

I copied your example file and then ran awk -v OFS="\t" '$1=$1' your_peaks.narrowPeaks > fixed_your_peaks.narrowPeaks on it. This produced a result that I was able to see in both the UCSC genome browser and IGV.

$\endgroup$
3
  • 3
    $\begingroup$ Strangely if you simply add ".bed" to your file it should work (i.e. testONE_peaks_NEW2.narrowPeak.bed) $\endgroup$
    – story
    Feb 12, 2020 at 21:47
  • $\begingroup$ Can we do this in R? $\endgroup$
    – StupidWolf
    Feb 13, 2020 at 10:23
  • $\begingroup$ Oh. Thank you very much. $\endgroup$
    – MudithMMBc
    Feb 18, 2020 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.