From Genome Analysis Wiki
Jump to navigationJump to search
1,374 bytes added
, 14:16, 15 June 2014
Line 337: |
Line 337: |
| [[File:GcalignOutBAMm.png|600px]] | | [[File:GcalignOutBAMm.png|600px]] |
| | | |
− | Let's examine at the first 5 lines of the BAM file: | + | Let's examine at the first 5 lines of the BAM file using [http://samtools.sourceforge.net/samtools.shtml#3 samtools view]: |
| ${GC}/bin/samtools view -h ${OUT}/bams/HG00551.recal.bam|head -n 5 | | ${GC}/bin/samtools view -h ${OUT}/bams/HG00551.recal.bam|head -n 5 |
| | | |
Line 352: |
Line 352: |
| </div> | | </div> |
| </ul> | | </ul> |
| + | |
| + | ==== Accessing BAMs by Position ==== |
| + | BAM's are so big, what if we want to see a position part way through the file? |
| + | :[http://samtools.sourceforge.net/samtools.shtml#3 samtools] has an option for that. |
| + | |
| + | Add a region to the view command we used above. Let's find all reads that overlap positions 36907000-36907005: |
| + | ${GC}/bin/samtools view -h ${OUT}/bams/HG00551.recal.bam 22:36907000-36907005 |
| + | * Just a few reads. |
| + | |
| + | Let's visualize what reads in that area look like using samtools tview: |
| + | ${GC}/bin/samtools tview ${OUT}/bams/HG00551.recal.bam ${REF}/human.g1k.v37.chr22.fa |
| + | * Type ‘g’ |
| + | ** Type 22:36907000 |
| + | * Type ‘n’ to color by nucleotide |
| + | * Use the arrow keys to move around and look at the area. |
| + | |
| + | Understanding the syntax: |
| + | * '.' : match to the reference on the forward strand |
| + | * ',' : match to the reference on the reverse strand |
| + | * ACGTN : mismatch to reference on the forward strand |
| + | * acgtn : mismatch to reference on the reverse strand |
| + | |
| + | ; Do you see anything interesting? |
| + | <div class="mw-collapsible mw-collapsed" style="width:200px"> |
| + | *Screenshot |
| + | <div class="mw-collapsible-content"> |
| + | <ul> |
| + | <li>We will have to remember this region when we run snpcall to see what it says.</li> |
| + | </ul> |
| + | [[File:tview.png|750px]] |
| + | </div> |
| + | </div> |
| + | |
| + | Other commands: |
| + | * Type '?' for a help screen |
| + | * Type 'q' to quit tview |
| | | |
| == Logging Off == | | == Logging Off == |