<p>I think you might have changed the separator (or at least have some kind of inconsistency from the <a href="https://genome.ucsc.edu/FAQ/FAQformat.html" rel="nofollow noreferrer">required format</a>) for your file. Note that peak output files from MACS2 are variants of BED files.</p>

<p>It seems you <strong>need to have a <em>tab</em> separator for this type of file.</strong></p>

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

CC BY-SA 4.0
2020-02-12T21:47:12.257Z
Strangely if you simply **add** ".bed" to your file it should work (i.e. testONE_peaks_NEW2.narrowPeak.bed)
story
CC BY-SA 4.0
2020-02-13T10:23:52.340Z
Can we do this in R?
StupidWolf
CC BY-SA 4.0
2020-02-18T16:49:48.457Z
Oh. Thank you very much.
MudithMMBc
CC BY-SA 4.0
2020-02-12T21:34:53.253Z
2020-02-12T21:51:33.843Z
2020-02-12T21:51:33.843Z
story
<p>I have called peaks using MACS2. Then I got a narrowPeak file like this.</p>

<pre><code>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
</code></pre>

<p>Then I tried to visualize it in UCSC Genome browser and I got following error.</p>

<pre><code>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')
</code></pre>

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

<pre><code>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
</code></pre>

<p>When I tried to load the file again I got following error.</p>

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

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

<pre><code>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
</code></pre>

<p>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?</p>

CC BY-SA 4.0
2020-10-26T07:53:27.043Z
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
Libby Kosolapov
CC BY-SA 4.0
2020-10-30T19:27:13.607Z
You can run this command in a command line or terminal
MudithMMBc
<rna-seq><chip-seq><ucsc><igv><macs2>
How to visualize called narrowPeak files in UCSC Genome browser or IGV?
# How to visualize called narrowPeak files in UCSC Genome browser or IGV?

(Asked by: username_0 on 2020-02-12)

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?

**Tags:** rna-seq, chip-seq, ucsc, igv, macs2
> **Comments:**
> **username_1**: 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  
> **username_0**: You can run this command in a command line or terminal  

---

## 1 answers

### Answer by username_2 on 2020-02-12. Score: 2 | Accepted answer

I think you might have changed the separator (or at least have some kind of inconsistency from the [required format](https://genome.ucsc.edu/FAQ/FAQformat.html)) 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.

> **Comments:**
> **username_2**: Strangely if you simply **add** ".bed" to your file it should work (i.e. testONE_peaks_NEW2.narrowPeak.bed)  
> **username_3**: Can we do this in R?  
> **username_0**: Oh. Thank you very much.  

---

