Question: Extract sequences from fasta EXCEPT regions given in the bed file
0
gravatar for farhan.phd.unesp
3 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 • 163 views
ADD COMMENTlink modified 11 weeks ago • written 3 months ago by farhan.phd.unesp0
3
gravatar for Friederike
3 months ago by
Friederike4.1k
United States
Friederike4.1k wrote:

perhaps combine bedtools complement with bedtools getfasta?

ADD COMMENTlink written 3 months ago by Friederike4.1k
0
gravatar for farhan.phd.unesp
11 weeks ago by
Brazil
farhan.phd.unesp0 wrote:

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

ADD COMMENTlink written 11 weeks 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: 2229 users visited in the last hour