Question: Extract sequences from fasta EXCEPT regions given in the bed file
0
gravatar for farhan.phd.unesp
15 months ago by
Brazil
farhan.phd.unesp0 wrote:

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.

sequence genome • 571 views
ADD COMMENTlink modified 15 months ago • written 15 months ago by farhan.phd.unesp0
3
gravatar for Friederike
15 months ago by
Friederike5.7k
United States
Friederike5.7k wrote:

perhaps combine bedtools complement with bedtools getfasta?

ADD COMMENTlink written 15 months ago by Friederike5.7k
0
gravatar for farhan.phd.unesp
15 months ago by
Brazil
farhan.phd.unesp0 wrote:

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

ADD COMMENTlink written 15 months ago by farhan.phd.unesp0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1534 users visited in the last hour