bedtools2 icon indicating copy to clipboard operation
bedtools2 copied to clipboard

Feature request: getfasta extract name or ID from GFF3 attributes field

Open colindaven opened this issue 9 years ago • 4 comments

Hi,

thanks for a great package.

With the getfasta tool, the -name option appears to only refer to the name column from an input BED file. It would be great if the GFF3 attributes ID or Name could be used alternatively to get nicely named fasta headers. (ID="myId";Name="myName")

Usage: bedtools getfasta [OPTIONS] -fi -bed <bed/gff/vcf> -fo

    -name   Use the name field for the FASTA header

Thanks a lot, Colin

colindaven avatar Jan 29 '15 10:01 colindaven

:+1: Yes, please!

sjackman avatar May 27 '15 21:05 sjackman

Agree this would be nice!

erg55 avatar Jun 07 '22 03:06 erg55

I'm not sure this is possible without breaking downstream tools, see https://github.com/arq5x/bedtools2/issues/406

colindaven avatar Jun 07 '22 06:06 colindaven

Hmm. Well if anyone else encounters this was my simple workaround to get the name info into the right field:

cut -f 1,2 example.gff > in1.tmp
cut -f 4-9 example.gff > in2.tmp
cut -f 9  example.gff | cut -f 1 -d ";" | cut -f 2 -d "=" | paste in1.tmp - in2.tmp  >  fixed.gff

erg55 avatar Jun 07 '22 13:06 erg55