right genomic coordinate of each gene
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?
• 1,628 views
•
link
1 answer
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)
• 0 views
•
link
Log in to answer this question.
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)?
I assume OP means the 5' or 3' end, as in left - right coordinate, not in correct-false
Oh, I think OP doesn't know that a gene has multiple transcripts and these are all correct coordinates :-)
aha, indeed, very well possible too ;)
Your solution looks alright too.
Since you indicate you want the 'right' coordinate, I assume it's 3' end/coordinate of each gene you're looking for