I have multiple .bam files(aligned RNA-Seq data) and I have a set of regions from all the files (chr str stp) in a bed format. I would like to check for variants only in these regions rather through out the genome. Specifically, I want the allele counts for Ref and Alt at all of the positions in my .bed file. I am trying to use samtools mpileup for the same but I am getting an empty output file. I have been trying to set the correct parameters for my task but every time there is some error. Any help is greatly appreciated. Thankyou.
I have tried using the following command. samtools mpileup -l file.bed -f hg38.fa file1.sorted.bam | bcftools view > file1.vcf
This command is giving a vcf file but the positions in my target .bed file and this output vcf file don't match. Also, is it necessary to provide a reference file, rather in what scenario can I use the --no-reference option?