Question: How To Combine Multiple Wig/Bigwig Files Into One
5
gravatar for Yuan
8.4 years ago by
Yuan50
Yuan50 wrote:

Hi,

I have wiggle files for each chromosome generated from MACS peak calling. Instead create a custom track for each chromosome from these wiggle files, is there a way to combine them into a single wig/bigwig so that I can look at them on UCSC genome browser? Thanks in advance!

ADD COMMENTlink modified 8.4 years ago by Anders Haakonsson60 • written 8.4 years ago by Yuan50

Please accept one of the many good answers to your question.

ADD REPLYlink written 8.3 years ago by Biomed4.5k
6
gravatar for Anders Haakonsson
8.4 years ago by
Anders Haakonsson60 wrote:

Thanks alot, this was very helpfull to me aswell. To remove heades and combine the wig files in a bigwig file i used:

zcat *.wig.gz | grep -v ^track | wigToBigWig -clip stdin genome.table output.bigwig

Mvh Anders

ADD COMMENTlink written 8.4 years ago by Anders Haakonsson60

What is genome.table exactly, please?

ADD REPLYlink written 7.3 years ago by Student90

that would be a list of chromosome names and lengths (two columns, tab separated, often called chrom.sizes at ucsc)

ADD REPLYlink written 23 months ago by cmdcolin1.2k
3
gravatar for Pierre Lindenbaum
8.4 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum119k wrote:

If there is only one chromosome per file, you can just concatenate those wig:

cat chr*.wig > genome.wig
ADD COMMENTlink modified 8.4 years ago by Neilfws48k • written 8.4 years ago by Pierre Lindenbaum119k

I was wondering why they were using -clip. But your answer seems to suggest that -clip is not necessary

ADD REPLYlink written 3.3 years ago by brianpenghe20
3
gravatar for Dawe
8.4 years ago by
Dawe270
Milan
Dawe270 wrote:

If you have multiple wig files (and MACS wig are gzipped) you should concatenate:

zcat *.wig.gz | wigToBigWig -clip stdin chromsizes.tab output.bigwig

If you have only one file (and macs14 allows this) you can directly go with

wigToBigWig -clip stdin chromsizes.tab output.bigwig

As recent wigToBigWig support gziped input.

ADD COMMENTlink written 8.4 years ago by Dawe270

Where do I get chromsizes.tab, please?

ADD REPLYlink written 7.3 years ago by Student90
1
gravatar for Ian
8.4 years ago by
Ian5.4k
University of Manchester, UK
Ian5.4k wrote:

In case you didn't already know MACS 1.4 beta has a function to create a single WIG file, use '--wig --single-wig'.

The important point is that you MUST remove the track header from the top of each WIG file before you merge them and convert them to bigWig. I like to keep a copy of the header.

Keep header: head -n 1 *chr1.wig > header

Remove first line (track header): sed -i '1d' *wig

Hope this helps!

ADD COMMENTlink written 8.4 years ago by Ian5.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1286 users visited in the last hour