b4354dab1ce9929f4cd6b81628b545a3b0bd9840 dschmelt Wed Feb 26 14:43:22 2020 -0800 Adding note about bigDataIndex keyword #25018 diff --git src/hg/htdocs/goldenPath/help/bam.html src/hg/htdocs/goldenPath/help/bam.html index 1d86685..c65f6bc 100755 --- src/hg/htdocs/goldenPath/help/bam.html +++ src/hg/htdocs/goldenPath/help/bam.html @@ -39,45 +39,53 @@ Convert SAM to BAM using the samtools program:
    samtools view -S -b -o my.bam my.sam
If converting a SAM file that does not have a proper header, the -t or -T option is necessary. For more information about the command, run samtools view with no other arguments.
  • Sort and create an index for the BAM:
        samtools sort my.bam my.sorted 
         samtools index my.sorted.bam
    The sort command appends .bam to my.sorted, creating a BAM file of alignments ordered by leftmost position on the reference assembly. The index command generates a new file, my.sorted.bam.bai, with which genomic coordinates can quickly be translated into file offsets in my.sorted.bam.
  • Move both the BAM file and index file (my.sorted.bam and - my.sorted.bam.bai) to an http, https, or ftp location.
  • + my.sorted.bam.bai) to an http, https, or ftp location. Note that the Genome Browser + looks for an index file with the same URL as the BAM file with the .bai suffix added. If your + hosting site does not use the filename as the URL link, you will have to specifically + call the location of this .bam.bai index file with the bigDataIndex keyword. + This keyword is relevant in Custom Tracks + and Track Hubs. You can read more about bigDataIndex in + the TrackDb Database Definition page.
  • - If the file URL ends with .bam, you can paste the URL directly into the - custom track management page, click submit and view in the - Genome Browser. The track name will then be the name of the file. If you want to configure the - track name and descriptions, you will need to create a track - line, as shown below in step 7.
  • + If the file URL ends with .bam and the BAM index file URL ends with .bam.bai, you can paste the + URL directly into the custom track management page, + click submit and view in the Genome Browser. The track name will then be the name of the file. + If you want to configure the track name and descriptions or the URLs are not as described, you + will need to create a track line, as shown below in + step 7.
  • Construct a custom track using a single track line. The most basic version of the "track" line will look something like this:
        track type=bam name="My BAM" bigDataUrl=http://myorg.edu/mylab/my.sorted.bam
    Again, in addition to http://myorg.edu/mylab/my.sorted.bam, the associated index file http://myorg.edu/mylab/my.sorted.bam.bai must also be available at the same - location.
  • + location. If not, you can specify the URL with the + bigDataUrl=http://myorg.edu/mylab/my.sorted.bam.bai
  • Paste the custom track line into the text box in the custom track management page, click submit and view in the Genome Browser.
  • Parameters for BAM custom track definition lines

    All options are placed in a single line separated by spaces. In the example below, the lines are broken only for readability. If you copy/paste this example, you must remove the line breaks. Click here for a text version that you can paste without editing.

        track type=bam bigDataUrl=http://...
             pairEndsByName=. 
             pairSearchRange=N
    @@ -101,30 +109,31 @@
     
     
        pairEndsByName  any value                   # presence indicates paired-end alignments
         pairSearchRange N                           # max distance between paired alignments, default 20,000 bases
         bamColorMode    strand|gray|tag|off         # coloring method, default is strand
         bamGrayMode     aliQual|baseQual|unpaired   # grayscale metric, default is aliQual
         bamColorTag     XX                          # optional tag for RGB color, default is "YC"
         minAliQual      N                           # display only items with alignment quality at least N, default 0
         showNames       on|off                      # if off, don't display query names, default is on
     
    Other optional settings are not specific to BAM, but relevant:
    
         name            track label                 # default is "User Track"
         description     center label                # default is "User Supplied Track"
         visibility      squish|pack|full|dense|hide # default is hide (will also take numeric values 4|3|2|1|0)
    +    bigDataUrl      https://your.bam.bai.com    # default is the bigDataUrl with .bai added to the end
         priority        N                           # default is 100
         db              genome database             # e.g. hg18 for Human Mar. 2006
         maxWindowToDraw N                           # don't display track when viewing more than N bases
         chromosomes     chr1,chr2,...               # track contains data only on listed reference assembly sequences
         doWiggle        on|off                      # if on, show data as density graph, default is off
     

    The BAM track configuration help page describes the BAM track configuration page options corresponding to pairEndsByName, minAliQual, bamColorMode, bamGrayMode and bamColorTag in more detail.

    pairSearchRange applies only when pairEndsByName is given. It allows for a tradeoff of display speed vs. completeness of pairing the paired-end alignments. When paired ends