This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to add gene description to .bed file generated from segemehl software

Hello everyone, I am a beginner in bioinformatics, and asking for help. I got a .bed file generated from segemehl software, there is chr name and splice site (two coordinates) and other information, now I want to add gene description (or just gene name) to each splice event (back-splice), is there any software or command can I use to achieve the goal? many thanks!

bed segemehl annotation

Have a look at bedtools intersect (or maybe bedtools closest), there's likely an option to have it print the whole line when you intersect the BED file with the GFF/GTF file describing your organism.

thanks for your help, I will try to learn the usage of bedtools:)

1 answer

One option is to use BEDOPS bedmap and convert2bed to map annotations to mapped reads.

Here is one command demonstrating how to do just that with GFF-formatted annotations:

$ bedmap --echo --echo-map-id-uniq your_mapped_reads.bed <(gff2bed < your_annotations.gff) > answer.bed

The file answer.bed contains each read along with the ID values ("name") of any overlapping annotations.

It really works! thanks a lot for your kind help:)

Log in to answer this question.