genome / bam-readcount

Count bases in BAM/CRAM files
MIT License
298 stars 95 forks source link

how to get a region file #90

Closed stroke1989 closed 2 years ago

stroke1989 commented 2 years ago

excuse me: when I use bam-readcount, I wonder how I can get the region required by bam-readcount? what does this region look like? is it the targeted-region bed file that is provided by vendor?

chrisamiller commented 2 years ago

That depends entirely upon the question that you are asking. One common use case is to call variants, then use bam-readcount to pull information from those sites. Another might be to take a list of common mutations and query a large number of samples. Running it on every site in a targeted-region bed file (i.e. from an exome capture) would be an unusual case.

stroke1989 commented 2 years ago

That depends entirely upon the question that you are asking. One common use case is to call variants, then use bam-readcount to pull information from those sites. Another might be to take a list of common mutations and query a large number of samples. Running it on every site in a targeted-region bed file (i.e. from an exome capture) would be an unusual case.

excuse me: I'm sorry to have failed to make myself clear. I'm trying to use VarScan2 v2.3.9 to call tumor somatic mutation, the authors advised using the fpfilter.pl accessory script for advanced variants filtering which required a readcount file, and more, the authors advised using bam-readcount to get readcount file. So, for this case, how I can get the readcount file. I search this question on biostar, https://www.biostars.org/p/9469488/, that author also tried to use VarScan2 to call somatic mutation, the following is the steps how he get readcount file: create indexed bam files samtools index bqsr_output.bam

create bed file for sample.varScan.snp.filter vcf2bed --snvs sample.varScan.snp.filter > sample.varScan.snp.filter.bed

run bam-read-count bam-readcount -q 1 -b 20 -f hg38_genome.fa -l sample.varScan.snp.filter.bed bqsr_output.bam > snp_varScan.variants.readcounts

Is the above-mentioned steps he used right? Hope your response! Appreciate!

chrisamiller commented 2 years ago

There's a full protocol written up here that may be of help: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4278659/