Extract sequences from fasta EXCEPT regions given in the bed file
2
0
Entering edit mode
5.2 years ago

I want to extract sequences from a genome.fasta, EXCLUDING the regions listed in the Bed file. So I need an output fasta file that does not contain the regions present in the Bed file. See For example:

cat genome.fasta

chr1

ATCGGAGTCGAATTCAATCTT

cat bed.txt

chr1 6 17

cat my_ouput.fasta

chr1

ATCGGA

chr1

TCTT

I tried Bedtools getfasta and intersect commands, but it seems they do not have any option to fulfill my need. I would appreciate any suggestion or a script. Thank you.

genome sequence • 2.0k views
ADD COMMENT
3
Entering edit mode
5.2 years ago

perhaps combine bedtools complement with bedtools getfasta?

ADD COMMENT
0
Entering edit mode
5.2 years ago

Thanks so much ! The bedtools complement worked. Amazing..

ADD COMMENT

Login before adding your answer.

Traffic: 1787 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6