Entering edit mode
9.8 years ago
GouthamAtla
12k
I am trying to use pybedtools
getfasta
functionality. Here is an example given in the docs:
>>> a = pybedtools.BedTool("""
... chr1 1 10
... chr1 50 55""", from_string=True)
>>> fasta = pybedtools.example_filename('test.fa')
>>> a = a.sequence(fi=fasta)
>>> print open(a.seqfn).read()
>chr1:1-10
GATGAGTCT
>chr1:50-55
CCATC
This works fine. But I am wondering how can we pass the options here? I want to use -s
option to force strandedness
Yes. its
s=True
. The name of thegetfasta
wrappersequence
is little bit confusing.I have printed the command that would be executed.
But its not printing the reverse compliment. I will look into it. Thanks.
Glad you figured it out!
I appreciate this question and answer. It's been helpful as I try to learn how to use pybedtools.
However, I'm having the same problem. The extracted sequences are not being reverse complemented. How was this resolved? My code is as follows:
GENOME
andQUERY
are variables within a loop in the overall script.Please ignore this question. I found my problem. The strand information (+ or -) was in the wrong column of my bed file.