Error when uploading Wig file to UCSC
1
1
Entering edit mode
7.6 years ago
tamadomi ▴ 10

I used this script (found in the forum) to convert a sorted BAM with uniquely mapped reads to wig format:

samtools mpileup -BQ0 run.sorted.bam | perl -pe '($c, $start, undef, $depth) = split;if ($c ne $lastC || $start != $lastStart+1) {print "fixedStep chrom=$c start=$start step=1 span=1\n";}$_ = $depth."\n";($lastC, $lastStart) = ($c, $start);' | gzip -c > run.wig.gz

However, when trying to upload to USCS I get an error saying:

Unrecognized format line 1 "fixedStep chrom=chr1 start=9957 step=1 span=1" (note: chrom names are case sensitive, e.g.: correct: 'chr1', incorrect: 'Chr1', incorrect: '1')

What is causing the error? Format seems to be Ok...

Thanks

EDIT: Trying to convert to bigWig with wigtoBigwig yields:

invalid unsigned integer: "chrom=chr1"

uscs upload wig • 2.3k views
ADD COMMENT
0
Entering edit mode

Do you mean USCS or UCSC?

ADD REPLY
0
Entering edit mode

Apologies, I meant UCSC

ADD REPLY
1
Entering edit mode
7.6 years ago
Satyajeet Khare ★ 1.6k

According to this post samtools depth works better. Latest edit suggest bedtools coverage followed by bedGraphToBigWig.

ADD COMMENT

Login before adding your answer.

Traffic: 2020 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6