I want to extract some base pairs from a FASTA file. There is a given sequence, say marker sequence. Every time this marker sequence occurs in the FASTA file, I want to extract n base pairs to the left of it (before it). Is it possible to do so using biopython? If so, please tell.
Thank you.
PS - I know it seems quite simple. But I am very new to python. And I have to do this using biopython only. So finding it very difficult to understand from the cookbook.
Why not just use regex capture groups? I believe this would be much more efficient.
OP wishes to use BioPython. Come to think of it, the way OP has phrased the question makes me think this could possibly be an assignment question.
Agreed.
Biopython is the only package that I am acquainted with. That`s why the special emphasis on using that one.
But now, as it turns out I'll have to learn regex too.. Thank you for your help.. :)