Hi,
I would like to convert the wiggle file from hg18 to hg19 version. LifeOver can do that conversation for BED but not wiggle file. Could you pls let me know if any tools can do that conversion? Many thanks!
Chan
Hi,
I would like to convert the wiggle file from hg18 to hg19 version. LifeOver can do that conversation for BED but not wiggle file. Could you pls let me know if any tools can do that conversion? Many thanks!
Chan
Using the ucsc tools:http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/
wig2bed
will do the work of steps 1 and 2: http://code.google.com/p/bedops/wiki/wig2bed
I am currently doing the similar task (liftover a bigwig file from mm9 to mm10). The above answers are helpful, but I think they are not comprehensive enough for beginners to work with. So, I listed my pipeline below. Hopefully, it can help some people.
# My task: liftover from mm9 to mm10 for a big wig file.
# All tools used below can be found @ https://genome.ucsc.edu/util.html
# 0) If you start with the wiggle file, you will need "wigToBigWig" to convert wig to bigwig;
e.g. wigToBigWig in.wig chrom.sizes out.bw
# 1) Convert bigwig to bedGraph
bigWigToBedGraph H3K27ac.mm9.bw H3K27ac.mm9.bedGraph
# 2) Liftover from mm9 to mm10
liftOver H3K27ac.mm9.bedGraph mm9ToMm10.over.chain H3K27ac.mm10.bedGraph unMapped
# 3) Sort the bed file
sort -k1,1 -k2,2n H3K27ac.mm10.bedGraph > H3K27ac.mm10.sort.bedGraph
# 4) Fix the overlapping intervals
# The bed file from liftover might have overlapping intervals. You will hit error if directly using bedGraphToBigWig for file conversion. In this case, you need to split the overlapping intervals and assign mean signal to a new bed file.
awk -vOFS="\t" '{ print $1, $2, $3, ".", $4 }' H3K27ac.mm10.sort.bedGraph > tmp.bed
bedops --partition tmp.bed | bedmap --echo --mean --delim '\t' - tmp.bed > H3K27ac.mm10.split.bedGraph
# 5) Convert bedGraph to bigwig
bedGraphToBigWig H3K27ac.mm10.split.bedGraph mm10.sizes.genome H3K27ac.mm10.bw
Done! Have fun!
hg38bwTohg19bw.pl
use strict;
use Cwd;
use POSIX;
my $dir = getcwd;
my @file=glob("*.hg38.bw");
foreach my $file(@file){
open OUT,">$file.job";
my ($fn)=split/.hg38.bw/,$file;
print OUT "#PBS -N $fn\n";
print OUT "#PBS -l nodes=1:ppn=1\n";
print OUT "cd /gpfs/home/run/blueprint\n";
#print OUT "bigWigToBedGraph $file $fn.hg38.bedgraph\n";
#print OUT "liftOver $fn.hg38.bedgraph hg38ToHg19.over.chain.gz $fn.hg19.bedgraph unmap\n";
print OUT "bedtools sort -i $fn.hg19.bedgraph > $fn.hg19.bedgraph.sort\n";
print OUT "bedGraphToBigWig $fn.hg19.bedgraph.sort hg19.chrom.sizes $fn.hg19.bw\n";
}
close OUT;
Possible problem:
This is an old question, but if you're using UCSC liftOver, you may want to do a lift-over (map) operation in both directions, to get those intervals that map between genomes in a consistent manner:
bedmap --exact
to filter for intervals that started in genome A and mapped back to the same location in genome A.The wig2bed
tool can be used to convert wiggle files to BED format.
For the record Cistrome.org have tool for doing this via a GALAXY like interface. However, their site is not working at the time of writing this.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
it's called LiftOver btw, much less dramatic than LifeOver ;)