I have a gene annotation with: Left-End-Direction, Right-End-Direction and Transcription Direction. To get the coordinate of the gene, I would take the Left- or Right-End-Direction based on the Transcription Direction. So I have the transcription start as the coordinate.
But I canĀ“t simply subtract the coordinate and take the absolute value, because the chromosome is circular and the coordinates go from 0 to 4641628. The gene distance of a gene close to the end and a gene close to the start needs a different calculation than two genes in the middle.
Are there already tools for that calculation, or do I have to write the code by myself?