waldronlab / cBioPortalData

Integrate the cancer genomics portal, cBioPortal, using MultiAssayExperiment
https://waldronlab.io/cBioPortalData/
30 stars 12 forks source link

molecularData with hugoGeneSymbol? #30

Closed xinwei-sher closed 4 years ago

xinwei-sher commented 4 years ago

Is it possible to retrieve molecular data with hugoGeneSymbol? It looks only entreGeneIds can be used for now:

Molecular Profile Data

The data for a molecular profile can be obtained with prior knowledge of available entrezGeneIds:

molecularData(cbio, molecularProfileId = "acc_tcga_rna_seq_v2_mrna", entrezGeneIds = c(1, 2), sampleIds = c("TCGA-OR-A5J1-01", "TCGA-OR-A5J2-01") )

jebard commented 4 years ago

I wrote a quick function to help me with this since most of the time i work in symbol space as opposed to entrez id -- hope it helps! It takes in one or more symbols and returns the entrez id

get_entrez_from_gene_names <- function(x){ returnList = NULL for (gene in x){ get <- cbio$getGeneUsingGET(gene) ret <- httr::content(get) print(ret$entrezGeneId) returnList <- rbind(returnList,ret$entrezGeneId) } return(returnList) }

Example :: get_entrez_from_gene_names(c("HIST1H1E","HIST1H1E"))

LiNk-NY commented 4 years ago

@xinwei-sher @jebard Please use the cBioPortalData function and specify the by argument to "hugoGeneSymbol". https://waldronlab.io/cBioPortalData/reference/cBioPortalData.html

LiNk-NY commented 4 years ago

Also see AnnotationHub and the mapIdsfunction (if you really need to use the molecularData function) https://www.bioconductor.org/help/course-materials/2019/BSS2019/05_Annotations.html#mapping-between-symbols

xinwei-sher commented 4 years ago

@xinwei-sher @jebard Please use the cBioPortalData function and specify the by argument to "hugoGeneSymbol". https://waldronlab.io/cBioPortalData/reference/cBioPortalData.html

Thanks for your response. However, cBioPortalData only supports hugoGeneSymbol in predefined genePanel. There's no parameter for individual hugoGeneSymbols. It also does not support customized genePanel.

xinwei-sher commented 4 years ago

I wrote a quick function to help me with this since most of the time i work in symbol space as opposed to entrez id -- hope it helps! It takes in one or more symbols and returns the entrez id

get_entrez_from_gene_names <- function(x){ returnList = NULL for (gene in x){ get <- cbio$getGeneUsingGET(gene) ret <- httr::content(get) print(ret$entrezGeneId) returnList <- rbind(returnList,ret$entrezGeneId) } return(returnList) }

Example :: get_entrez_from_gene_names(c("HIST1H1E","HIST1H1E"))

Thanks for the trick, @jebard. Go Bulls!

LiNk-NY commented 4 years ago

This is an open issue, see https://github.com/waldronlab/cBioPortalData/issues/24