extract fasta sequence with the help of bedtools getfasta
Can I download the reverse strand by bedtools getfasta. If I have reverse strand coordinates.
X 154401758 154402841 ENST00000014935 ENSE00001200781 9
X 154402942 154403190 ENST00000014935 ENSE00000678409 8
X 154403269 154403381 ENST00000014935 ENSE00003549633 7
X 154403522 154403622 ENST00000014935 ENSE00000678413 6
X 154404828 154404914 ENST00000014935 ENSE00003790806 5
X 154404995 154405083 ENST00000014935 ENSE00000678418 4
X 154405434 154405655 ENST00000014935 ENSE00001450968 3
X 154409112 154409196 ENST00000014935 ENSE00001050508 2
X 154409418 154410039 ENST00000014935 ENSE00001050512 1
I just want to extract the sequence in reverse orientation like when i used bedtools getfasta then it gives fasta sequence in reverse direction :
X 154402841 154401758 ENST00000014935 ENSE00001200781 9
X 154403190 154402942 ENST00000014935 ENSE00000678409 8
X 154403381 154403269 ENST00000014935 ENSE00003549633 7
X 154403622 154403522 ENST00000014935 ENSE00000678413 6
X 154404914 154404828 ENST00000014935 ENSE00003790806 5
X 154405083 154404995 ENST00000014935 ENSE00000678418 4
X 154405655 154405434 ENST00000014935 ENSE00001450968 3
X 154409196 154409112 ENST00000014935 ENSE00001050508 2
X 154410039 154409418 ENST00000014935 ENSE00001050512 1
There is any way to get fasta sequence like this bed file. THanks in advance
• 306 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hello harry!
Questions similar to yours can already be found at:
We have closed your question to allow us to keep similar content in the same thread.
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
Cheers!
Just get the fasta file with bedtools getfasta and then apply any of the solutions of that previous thread.
See below the command : There is for loop command in that I send you one which is bedtools get fasta command so in this, I used you reverse fasta command but it does not reverse at all, as you see I used reverse fast command in the pipe (|) so I thought it in continuation of previous commands then it give me reverse sequence but it didn't happen. So can I wrong anything?
seq=
bedtools getfasta -fi /Drive1/human_index/Homo_sapiens.GRCh38.dna.toplevel.fa -bed coords.bed -tab| bioawk -c fastx '{print ">"$name;print reverse($seq)}' |cut -f 2thanks in advance