This is a test version of Biostars. For the public version, visit https://www.biostars.org.
removing decimal from ENSEMBL gene ID

I want to remove the decimal from the ensembl gene transcript ID. It contains the decimal point ans becomes difficult when I try to map the same to gene's transcript names in R.

Ensembl gives me "ENST00000265620.11", "ENST00000371081.5". But I want "ENST00000265620" and "ENST00000371081".

r genome assembly
$ echo ENST00000265620.11 | cut -f1 -d .
ENST00000265620

$ echo ENST00000265620.11 | sed 's/\..*//g'
ENST00000265620

2 answers

To learn what those numbers mean, please see here: https://www.ensembl.org/Help/Faq?id=488

Different types of 'regexes' (regular expressions) will do the job for you:

ens <- c('ENST00000265620.11', 'ENST00000371081.5')

sub('\\.[0-9]*$', '', ens)
[1] "ENST00000265620" "ENST00000371081"

Kevin

gsub("\\..*","", transcript.list)

like in https://stackoverflow.com/questions/10617702/remove-part-of-string-after

Log in to answer this question.