I have an R dataframe with a column of ENSG IDs.
I believe it contains non-protein coding IDs that I do not want
I only want to keep the rows that correspond to protein coding mRNAs
I am looking for a source of ENSG IDs (list or similar) that only contains IDs corresponding to protein coding mRNA.
I don't really need help with the coding, I just am looking for the data source.
The best thing I can think to do is scrape gencode's "Protein-coding transcript sequences" fasta, but there is hopefully a better way.
Thank you.
2 answers
this is what I ended up with if anyone is curious:
library(biomaRt)
ensembl = useMart(biomart="ensembl", dataset="hsapiens_gene_ensembl")
example_ids = c("ENSG00000172927", "ENSG00000224713", "ENSG00000135269", "ENSG00000272555", "ENSG00000013588")
res <- getBM(attributes=c("ensembl_gene_id","gene_biotype"),filters = c("ensembl_gene_id","biotype"), values=list(example_ids,"protein_coding"), mart=ensembl)
res
Use the biomaRt BioConductor package to query Ensembl directly. See Ensembl: Protein coding transcript ids for pointers.
Log in to answer this question.