How can I define the genomic context (so what are the genes in the neighbourhood) based on position ( like a bed file ).
The informations I want to know is :
- Is the position in an intron of a gene ? If yes, which intron (and the distance from the exons)
- If the position is intergenic : which gene are upstream and downstream (and distances)
- If there are several genes that are overlapping the position, report them and where it is (which intro or exon)
Edit > I add a little picture to explain the expected results :
So the expected results for position 1 ( I omit the position and gene real coordinates but they have to be in the results also )
Position1 Gene_A exon1 50 intronPosition Position1 Gene_B exon2 -100 intronPosition
Position2 Gene_A exon3 200 intergenicPosition Position2 Gene_C exon1 -100 intergenicPosition
I konw that bedops closes-feature is a good start but I'm stuck with the overlapping genes and to check if the position is intergenic or not ?
Anyone can give me ideas and/or advices to solve this problem
Thanks a lot,