How to create a fasta file from a merged bed file?
0
0
Entering edit mode
2.0 years ago
zhousun21 ▴ 40

Hi all,

I used the bedtools merge function to make a bed format file with merged ranges. What I'd like to do now is convert that to a fasta file.

The bedtools getfasta function will only extract from the original fasta and not make the merges from the merged.bed file.

Any suggestions as to how to get a fasta from the merged.bed file?

I've checked all the samtools and other bedtools functions but it doesn't seem like any of them will do this.

fasta bedtools • 589 views
ADD COMMENT
0
Entering edit mode

The bedtools getfasta function will only extract from the original fasta and not make the merges from the merged.bed file.

please, explain this. Give us an example.

ADD REPLY
0
Entering edit mode

Imagine a simple case where a fasta file contains two contigs. These overlap, and a BAM file contains this information.

bedtools merge reads the BAM file and correctly generates a bedfile with a single contig with coordinates that span both the originals.

I would now like to get a fasta file with the two contigs merged into one, per the bedfile. bedtools getfasta throws an error because the coordinates are not compatible with the originals. (the combined length is greater than the original length).

bedtools fasta was designed to extract subsequences, but not to make merged fasta from merged.bedfile data.

My question is: is there any tool that can produce a fasta that is described in the merged bedfile?

ADD REPLY

Login before adding your answer.

Traffic: 1879 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