Question: Error when uploading Wig file to UCSC
1
gravatar for tamadomi
3.2 years ago by
tamadomi10
tamadomi10 wrote:

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 • 1.1k views
ADD COMMENTlink modified 3.2 years ago • written 3.2 years ago by tamadomi10

Do you mean USCS or UCSC?

ADD REPLYlink written 3.2 years ago by Giovanni M Dall'Olio26k

Apologies, I meant UCSC

ADD REPLYlink written 3.2 years ago by tamadomi10
1
gravatar for Satyajeet Khare
3.2 years ago by
Satyajeet Khare1.5k
Pune, India
Satyajeet Khare1.5k wrote:

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

ADD COMMENTlink written 3.2 years ago by Satyajeet Khare1.5k
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: 1265 users visited in the last hour