I have been using the bedtools to extract fasta sequences based on genomic positions mentioned in a bed file. The command that I usually use os the following:
bedtools getfasta -fi input.fa -bed input.bed -fo out.fa
Now I want to implement the same command line from a python program. This is mainly because I will be doing some downstream analysis using the "bedtools getfasta" output and that part has been entirely written in python. Both the input and the output can be pandas dataframes. I am aware of the "pybedtools" module but my question also extends to integration of other command line tools as well.