I'm working with two gene tables (the UCSC knowngene table and the RefSeq refGene table) - the user of my program will choose which data to use.
For both table I want to execute the same process: for each gene find the minimal start and the maximal end position of its transcripts Thusm for example, if the two transcripts are
chr1 + 100 200 mygene
chr1 + 150 300 mygene
the required output should be "chr1 + 100 300" - although no such stranscript exists - this is like a merging of transcripts to form the "maximal transcript".
I added to the both tables an additional column of the kg_x_ref.geneSymbol.
My analysis assume that geneSymbol should be unique (for my needs I need it to be unique at least on the same chromosome and strand so this solves part of the problem of having the same gene name in different places on the genome).
However, I found a few examples of gene with the same gene symbol residing on distant places in the same chr & strand, in the knownGene table (maybe this happens in the refGene as well).
1) chr9, +, ANKRD20A3. Has several transcripts, among them we can find the following non overlapping ranges that define their locations:
a. 42368302 - 42411863
b.67926760 - 67970293
2) chr17, -, LRRC37A3.Among the non overlapping transcripts we can find:
a. 43592714 - 43625261
b. 62850487 - 62915586
Is this a bug that is going to be fixed or should I find a way of working with this?
For the two examples above my tool returns (42368302 - 67970293) and (43592714 - 62915586) respectively which is obviously a wrong result since it merges two different genes, but it the source of the confusion is the raw data. The required result in this case is two separate lines for the two different gene locations on the matching chr and strand.
I found the UCSC knownCanonical table that at first glance seems to fit my needs. However, for the 2nd example above it didn't match what I expected to see. In the knownCanonical table the LRRC37A3 indeed appears twice:
I) 43596707 43625261
II) 62850487 62914988
but the minimal position of (I) is not he minimal position found in the knownGene table and the same goes for the maximal position of (II).
Another disadvantage of using the knownCanonical is that I didn't find the matching table for refGene and I prefer to apply the same algorithm to both tables.
I'd love to hear any ideas.
Thanks in advance!