title: Python: Extract DNA sequence from FASTA file using Bed file
body: <p>May I know how can I extract dna sequence from fasta file? I tried bedtools and samtools. Bedtools getfasta did well but for some of my file return "warning: chromosome was not found in fasta file" but the fact is the chromosome name in bed file and fasta are exactly the same. I'm looking for other alternative that python can do this task for me.<br><br>Bed file:<br> chr1:117223140-117223856  3   7<br>
  chr1:117223140-117223856    5   9<br><br>Fasta file:<br>>chr1:117223140-117223856<br>CGCGTGGGCTAGGGGCTAGCCCC<br><br>Desired output:<br>>chr1:117223140-117223856<br>CGTGG<br>>chr1:117223140-117223856<br>TGGGC</p>