Hi Jian,
At this point we don't do density plots for BAM files. You can get a rough
approximation by setting the track's display mode to "squish".
BAM files are often so large that the http request may time out before UCSC has
been able to download an entire chromosome's items from the remote BAM file. So
depending on the size of your BAM file, it may not be possible to view an
entire chromosome in "squish" mode.
We have a different custom track format that works better for density displays.
The format is the fixedStep variant of the wiggle format, and here is a little
perl that translates the output of "samtools pileup" into fixedStep wiggle:
samtools pileup my.reverse.bam \
| 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);' \
> my.reverse.fixedStep.txt
The wiggle text formats are described here:
http://genome.ucsc.edu/goldenPath/help/wiggle.html
We recommend processing wiggle text into the bigWig format for custom tracks --
instructions are here: http://genome.ucsc.edu/goldenPath/help/bigWig.html
Hope that helps,
Angie
----- "Yuan Jian" <[email protected]> wrote:
> From: "Yuan Jian" <[email protected]>
> To: "Angie Hinrichs" <[email protected]>
> Sent: Monday, August 16, 2010 4:29:43 PM GMT -08:00 US/Canada Pacific
> Subject: Re: [Genome] custom track for bam file
>
>
hi Angie,
I uploaded my bam file into UCSC genome browser. I want to see density for each
position.
something like mountains across all chromosome. but I just see boxes.
> what should I do?
thanks
Jian
>
> --- On Mon, 16/8/10, Angie Hinrichs <[email protected]> wrote:
>
> From: Angie Hinrichs <[email protected]>
> Subject: Re: [Genome] custom track for bam file
> To: "Yuan Jian" <[email protected]>
> Cc: [email protected]
> Received: Monday, 16 August, 2010, 9:08 PM
>
>
> Hi Jian,
>
> A bit more about splitting + and - strand items from one BAM file into two
> custom tracks... firstly, the default BAM coloring mode uses different colors
> for the two strands, and sorts items by strand before by position, so if you
> haven't already given it a try, a single BAM custom track might be adequate
> for visually distinguishing + vs -.
>
> If not, then you will need to split your BAM file into two BAM files in order
> to make two custom tracks. You can do this with samtools
> (samtools.sourceforge.net) like this:
>
> samtools view -b -h -f 0x10 my.bam > my.reverse.bam
>
> samtools view -b -h -F 0x10 my.bam > my.forward.bam
>
> (then samtools index the new bam files)
>
> The first command uses "-f 0x10" which means "include an item only if the bit
> for reverse (16 = 0x10) is set in the flag field". The second command uses
> "-F 0x10" which excludes items with that bit. Try "samtools --help" for more
> detailed description of options. For help with downloading, installing or
> using samtools, there is [email protected] .
>
> Hope that helps,
> Angie
>
>
> ----- "Jennifer Jackson" < [email protected] > wrote:
>
> > From: "Jennifer Jackson" < [email protected] >
> > To: "Yuan Jian" < [email protected] >
> > Cc: [email protected]
> > Sent: Monday, August 16, 2010 12:38:18 PM GMT -08:00 US/Canada Pacific
> > Subject: Re: [Genome] custom track for bam file
> >
> > Hello Jian,
> >
> > Creating/loading two tracks is certainly possible. Load each one
> > following the BAM custom track instructions here:
> > http://genome.ucsc.edu/goldenPath/help/bam.html
> >
> > If you would like more assistance, please feel free to contact the
> > mailing list support team again.
> >
> > Regards,
> >
> > Jen
> > UCSC Genome Browser Support
> >
> > On 8/16/10 5:21 AM, Yuan Jian wrote:
> > > Hi good UCSC genome people,
> > >
> > > I have generated a BAM file. now I try to make custom tracks for the BAM
> > > file.
> > >
> > > my question is
> > > can I put + strand and - strand in two different custom tracks? and how
> > > to do?
> > >
> > > thanks
> > > jian
> > >
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Genome maillist - [email protected]
> > > https://lists.soe.ucsc.edu/mailman/listinfo/genome
> > _______________________________________________
> > Genome maillist - [email protected]
> > https://lists.soe.ucsc.edu/mailman/listinfo/genome
>
>
_______________________________________________
Genome maillist - [email protected]
https://lists.soe.ucsc.edu/mailman/listinfo/genome