Hello I m trying to convert bed12 to sorted gtf but output file 'Precapture_uniq.gff' is empty i m very new for this work if you can help me to solve this i appreciate it.
awk -f bed12togff Postcapture_uniq_chr.bed12 | sort -k1,1 -k4,4n -k5,5n "$@" > Precapture_uniq.gff
and my bed12togff is like that:
#! /bin/awk -f
# converts BED12 input into GFF
{
split($11,sz,",");
split($12,st,",");
for(i=1; i<=$10; i++)
{
line[i]=$1"\thts\texon\t"($2+st[i]+1)"\t"($2+st[i]+sz[i])"\t.\t"$6"\t.\tgene_id \""$4"\"; transcri$
}
if(rev==""||rev==0)
{
for(i=1; i<=$10; i++)
{
print line[i];
}
}
else
{
for(i=$10; i>=1; i--)
{
print line[i];
}
}
}
You might prefer to use existing tools like agat_convert_bed2gff.pl from AGAT