I would like to transform a net file format to a non-redundant bed file format. I know there exists the netToBed executable, but it only gives chromosome - start - end besides of including all parents and children thus being redundant (Since lines overlap).
I would like to have chromosome - start - end - target chromosome in the other species - strand. For that, I used
egrep "^ fill|^net" netfile | awk '{if ($0~/^net/) {chr=$2 ; next} ; print chr"\t"$2"\t"$2+$3"\t"$4"\t"$5}' | sed 's/+//g' > alignment.bed
but this is incorrect as I do not consider children. How would you do that?
Thank you.