<p>There's no equivalent to the wiggle header in bigWig (or bigBed) files, which is why UCSC uses the file name. This is actually the reason for the track line stuff that you linked to, since you can then specify a name and just point to where the bigWig (or other format) file is on the internet.</p>

<p>BTW, you can certainly convert your bigWig to wiggle, add the track line, and convert it back with UCSC tools (e.g., <code>bigWigToWig</code> and <code>wigToBigWig</code>). It shouldn't change the track name when you display it in UCSC (though if it does, then let me know, since I'll modify pyBigWig and libBigWig to support that then).</p>

CC BY-SA 3.0
2017-06-14T12:49:50.997Z
Using `bigWigToWig`, I can indeed obtain a wig file from the bigwig and add a custom track name that is displayed in IGV. Then, rebuilding a bigwig using `wigToBigWig` indeed looses the track name and I get the file name instead in IGV. This is for biwig files obtained directly with `bamCoverage`. I failed at reconverting wig to bigwig when the initial bigwig file was "manually" generated using `pyBigWig`. `wigToBigWig` complained as follows: `line 1507430 of tests/tmp.wig: chromosome I has 15072434 bases, but item ends at 15072440`. I guess I should post another question regarding this issue.
bli
CC BY-SA 3.0
2017-06-14T12:51:50.103Z
Thanks for the update, at least my understanding of bigWig headers was correct :)
Devon Ryan
CC BY-SA 3.0
2017-06-13T17:41:31.517Z
2017-06-13T17:41:31.517Z
Devon Ryan
<p>I generate bigWig files using <code>bamCoverage</code> from deeptools, in part for my colleagues to visualize their mapped libraries in the IGV viewer.</p>

<p>A problem is that the displayed track name is apparently the file name, which is not convenient because some files for different libraries have the same name. The reason is that the files are organized with one directory per library. I would prefer to avoid changing the way I name and organize the files.</p>

<p><strong>Is there a way to edit my bigWig files in order to have control of the track name independently from the file name?</strong></p>

<p>As far as I understand, bigWig format derives from wiggle format, which have a track definition line that can contain a <code>name</code> and a <code>definition</code> attribute: <a href="https://genome.ucsc.edu/goldenpath/help/customTrack.html#TRACK" rel="noreferrer">https://genome.ucsc.edu/goldenpath/help/customTrack.html#TRACK</a>.</p>

<p>Maybe there is a way to convert a bigWig file back to wiggle, edit the track definition, and then rebuild an updated bigWig file.</p>

<file-formats><format-conversion><bigwig><visualization><genome-browser>
Customizing bigWig file
# Customizing bigWig file

(Asked by: username_0 on 2017-06-13)

I generate bigWig files using `bamCoverage` from deeptools, in part for my colleagues to visualize their mapped libraries in the IGV viewer.

A problem is that the displayed track name is apparently the file name, which is not convenient because some files for different libraries have the same name. The reason is that the files are organized with one directory per library. I would prefer to avoid changing the way I name and organize the files.

**Is there a way to edit my bigWig files in order to have control of the track name independently from the file name?**

As far as I understand, bigWig format derives from wiggle format, which have a track definition line that can contain a `name` and a `definition` attribute: <https://genome.ucsc.edu/goldenpath/help/customTrack.html#TRACK>.

Maybe there is a way to convert a bigWig file back to wiggle, edit the track definition, and then rebuild an updated bigWig file.

**Tags:** file-formats, format-conversion, bigwig, visualization, genome-browser

---

## 1 answers

### Answer by username_1 on 2017-06-13. Score: 4 | Accepted answer

There's no equivalent to the wiggle header in bigWig (or bigBed) files, which is why UCSC uses the file name. This is actually the reason for the track line stuff that you linked to, since you can then specify a name and just point to where the bigWig (or other format) file is on the internet.

BTW, you can certainly convert your bigWig to wiggle, add the track line, and convert it back with UCSC tools (e.g., `bigWigToWig` and `wigToBigWig`). It shouldn't change the track name when you display it in UCSC (though if it does, then let me know, since I'll modify pyBigWig and libBigWig to support that then).

> **Comments:**
> **username_0**: Using `bigWigToWig`, I can indeed obtain a wig file from the bigwig and add a custom track name that is displayed in IGV. Then, rebuilding a bigwig using `wigToBigWig` indeed looses the track name and I get the file name instead in IGV. This is for biwig files obtained directly with `bamCoverage`. I failed at reconverting wig to bigwig when the initial bigwig file was "manually" generated using `pyBigWig`. `wigToBigWig` complained as follows: `line 1507430 of tests/tmp.wig: chromosome I has 15072434 bases, but item ends at 15072440`. I guess I should post another question regarding this issue.  
> **username_1**: Thanks for the update, at least my understanding of bigWig headers was correct :)  

---

