Question: bam file to bed fie
0
You won't know the exact boundaries since some reads will extend beyond the targeted region(s). But you should get a rough idea.
You can parse the BAM file and look at the POS/TLEN fields. If this is a common genome, with a BED annotation file available, then you could use coverageBED from BEDTools to get a rough idea of what regions are covered.