This is a test version of Biostars. For the public version, visit https://www.biostars.org.
conversion of gff to bed file

Hello,

I want to convert a gff file to a bed file. I used:

gff2bed < sample.gff > sample.bed

I want to keep four columns in the output file in the order of gene_name chromosome start_position end_position However, after the conversion and some manual steps to keep first four columns and reordering the columns, I am getting same names multiple times with same positions such as:

V_06g024400.1   Vch06   21881   22007
V_06g024400.1.1 Vch06   21881   22007
V_06g024400.1.1:cds Vch06   21881   22007
V_06g024400.1.1:exon:2  Vch06   21881   22007

I also want to add column names as gene_name chromosome start_position end_position. Is there any way to keep unique positions only and to avoid these manual changes to the file in order to get the desired output. Thank you!

sequencing

However, after the conversion and some manual steps to keep first four columns and reordering the columns

Can you describe in detail what you did?

I used:

gff2bed < sample.gff > sample.bed
cut -f 1-4 sample.bed > sample_1.bed
awk 'BEGIN {FS="\t"; OFS=","} {print $4, $1, $2, $3}' sample_1.bed > sample_2.bed

0 answers

No answers yet.

Log in to answer this question.