Thank you for your suggestion. I tried it and it seems the result is different from what I expect. The bam result converted to fastq doesn't give me what I need. So, I want an output which will consist of the sequence corresponds to the BED. For example for BED with line:
7 127591299 127591705 ENSG00000004059 0 +
I want to get string of ACGT between those region. So, probably the output is like this :
7 127591299 127591705 ENSG00000004059 0 + ACTGACAGT..
Is it possible?
The result I want is like if I use
bedtools getfasta -fi fasta.in -bed bed.in -fo csv.out -tab -s -fullHeader
I don't have the fasta.in and all I have is bam file.
It looks like you are trying to make consensus sequence out of a bam file.