| 109 | == Get read counts and statistics at desired sites == |
| 110 | |
| 111 | Sometimes one may have an interesting set of genome locations that may not turn up in a variant output file (if they are variants in that sample, for example). |
| 112 | |
| 113 | If you need variant-type metrics for those sites, you can use a command like |
| 114 | |
| 115 | {{{ |
| 116 | samtools mpileup -uv -t DP,DPR,DV,DP4,INFO/DPR,SP -l Desired_sites.bed -f refGenome.fa Sample.bam | bcftools call -c - > Desired_sites_info.vcf |
| 117 | }}} |
| 118 | |
| 119 | If you want counts for all 4 nucleotides (not just reference and alternate alleles), one way is with [https://github.com/genome/bam-readcount bam-readcount]: |
| 120 | {{{ |
| 121 | bam-readcount -l Desired_sites.bed -f refGenome.fa Sample.bam > Desired_sites.nt_counts.txt |
| 122 | }}} |
| 123 | |
| 124 | |