Hi Daniel,
Thank you for the suggestion -- it is on our radar as a feature enhancement. I
can't predict when it will be done unfortunately, and in the meantime, samtools
pileup to wiggle (possibly piped to bedGraphToBigWig) is the only way to get a
proper coverage graph from BAM.
In case it helps, here is a little perl that does the translation to fixedStep,
a more compact format than bedGraph when long runs of consecutive bases are
covered:
samtools pileup $bamFile \
| perl -pe '($c, $start, undef, $depth) = split; \
if ($c ne $lastC || $start != $lastStart+1) { \
print "fixedStep chrom=chr$c start=$start step=1
span=1\n"; \
} \
$_ = "$depth\n"; \
($lastC, $lastStart) = ($c, $start);' \
> $wigFile
Or, instead of "> $wigFile", pipe: "| wigToBigWig stdin hg18.sizes
$bigWigFile". Like BAM, bigWig is a binary indexed format so only the
displayed portions of the file are fetched. If you are loading these as custom
tracks, here is doc on wig and bigWig:
http://genome.ucsc.edu/goldenPath/help/wiggle.html
http://genome.ucsc.edu/goldenPath/help/bigWig.html
hg18.sizes can be fetched using fetchChromSizes as described in the second
link. If you are loading local database tracks, use the hgLoadWiggle program
for fixedStep wiggle, or hgBbiDbLink for bigWig.
Hope that helps, and sorry we don't have an easier answer at this point.
Please contact the list again if you have any more questions.
Angie
----- "Daniel Klevebring" <[email protected]> wrote:
> From: "Daniel Klevebring" <[email protected]>
> To: [email protected]
> Sent: Friday, September 3, 2010 7:32:33 AM GMT -08:00 US/Canada Pacific
> Subject: [Genome] BAM coverage support
>
> Hi,
>
> I'm currently setting up a local mirror of a genome browser in order
> to visualize NGS data internally. The main type of data is human exome
> data, where we have now ≈50 exomes sequenced.
>
> I have been following the progress of BAM support in UCSC GB and it
> looks very promising. One thing that I however miss is to be able to
> display density plots directly from BAM files, either as 1) a plot
> with coverage along the y-axis, or 2) as a density with a color
> indicating coverage. I attached a screendump where my suggestion 1)
> would be similar to the Enhancer H3K4 track and the suggestion 2)
> would be similar to the CRG Align tracks (ie scale from white to black
> if coverage is 0-50, otherwise black).
>
> It would also be awesome if it would be possible to pick custom colors
> in the settings for each track, instead of being locked to black and
> gray.
>
> If I understand correctly, samtools-c is able to create pileups, which
> could then be used to create a bedgraph on the fly. I really don't
> want to create a separate set of bedgraph files for each sample.
>
> Thanks a lot,
>
> Daniel Klevebring
>
>
>
>
>
>
>
>
> --
>
> Contact information:
>
> Daniel Klevebring, Ph. D.
> Department of Medical Epidemiology and Biostatistics
> Karolinska Institute
> Nobels Väg 12A, P. O. Box 281
> SE-17 177 Solna
> Sweden
>
> Phone: +46 704 71 65 91 (Mobile)
>
>
> _______________________________________________
> Genome maillist - [email protected]
> https://lists.soe.ucsc.edu/mailman/listinfo/genome
_______________________________________________
Genome maillist - [email protected]
https://lists.soe.ucsc.edu/mailman/listinfo/genome