right genomic coordinate of each gene
1
0
Entering edit mode
6.0 years ago
alireza346 ▴ 10

I have got the genomic coordinates from UCSC and here is a small example of the file.

small example:

chr10   +   126490353   126525239   FAM175B
chr10   +   126628971   126676005   ZRANB1
chr10   +   126630691   126676005   ZRANB1
chr10   -   126676417   126694582   CTBP2
chr10   -   126676417   126716453   CTBP2
chr10   -   126676417   126847285   CTBP2
chr10   -   126676417   126849103   CTBP2
chr10   -   126676417   126849624   CTBP2
chr10   -   126721351   126721439   MIR4296

I need only one coordinate. do you know how I can select the right coordinate for each gene?

next-gen gene • 1.1k views
ADD COMMENT
1
Entering edit mode

right coordinate for each gene

All of these co-ordinates are "right" for that gene. The question is, what do you need exactly, and are you aware of how these co-ordinates map to the genes (genes are more a concept and less an actual implementation)?

ADD REPLY
0
Entering edit mode

I assume OP means the 5' or 3' end, as in left - right coordinate, not in correct-false

ADD REPLY
2
Entering edit mode

Oh, I think OP doesn't know that a gene has multiple transcripts and these are all correct coordinates :-)

ADD REPLY
0
Entering edit mode

aha, indeed, very well possible too ;)

ADD REPLY
0
Entering edit mode

Your solution looks alright too.

ADD REPLY
0
Entering edit mode

Since you indicate you want the 'right' coordinate, I assume it's 3' end/coordinate of each gene you're looking for

ADD REPLY
0
Entering edit mode
6.0 years ago

not sure what you want to output, but with awk you will get there:

 cat <your file> | awk '{if ($2 == "+") print $4,$NF; else print $3,$NF} '

the above cmdline will print the 3' coordinate ($4 or $3 ) followed by the gene name ( $NF) for each line

This is all in the assumption you want the 3' end coordinate for each of the lines in your file. If that is not the cause and you want for each 'gene name' the correct end coordinate, then RamRS and WouterDeCoster are right (no pun intended)

ADD COMMENT

Login before adding your answer.

Traffic: 1779 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6