All you need is
<script src="https://ibl.github.io/cbio/cbio.js"></script>
Live at: https://ibl.github.io/cbio/
Experimenting with the possibility of having cBioPortal Web API as a client side JavaScript library. Since the API is not CORS enabled, a Google Script was implemented as a middle layer. The basic idea is to mimic the query syntax with objects constructed as
cbio.\( callbackFunction , { argumenti : valuei , ... } );Many thanks to MSKCC's cBioPortal team - this is a great public service !
cbio.get=function(cmd,fun,parms)All commands below are a type of bio.get, sy submitting command cmd to cbio WebAPI and process it through callback function fun with option parameters parms. For example
cbio.getTypesOfCanceriscbio.get('getTypesOfCancer')and
cbio.getProteinArrayData({case_set_id:"coadread_tcga_RPPA",array_info:1},function(x){console.log(cbio.table(x))})is the same as
cbio.get("getProteinArrayData",{case_set_id:"coadread_tcga_RPPA",array_info:1},function(x){console.log(cbio.table(x))})or
cbio.get("getProteinArrayData",function(x){console.log(cbio.table(x))},{case_set_id:"coadread_tcga_RPPA",array_info:1})(note the code will check for switch over vars fun and parms)
cbio.getTypesOfCancer(callbackFunction);example:
cbio.getTypesOfCancer()cbio.getCancerStudies(callbackFunction);example:
cbio.getCancerStudies()cbio.getGeneticProfiles("cancer study ID (required)",callbackFunction)example:
cbio.getGeneticProfiles("gbm_tcga")cbio.getCaseLists(cancer_study_id)example:
cbio.getCaseLists("gbm_tcga")cbio.getProfileData({case_set_id: "case set ID (required)",genetic_profile_id: "one or more genetic profile IDs (required)",gene_list: "one or more HUGO Gene Symbols or Entrez Gene IDs (required)"})examples:
cbio.getProfileData({case_set_id:"gbm_tcga_all",genetic_profile_id:"gbm_tcga_mutations",gene_list:["BRCA1","BRCA2","TP53"]})cbio.getProfileData({case_set_id:"gbm_tcga_all",genetic_profile_id:["gbm_tcga_log2CNA","gbm_tcga_gistic"],gene_list:"EGFR"})cbio.getMutationData({genetic_profile_id: "one or more mutation profile IDs (required)",case_set_id: "case set ID (optional)",gene_list: "one or more HUGO Gene Symbols or Entrez Gene IDs (required)"})examples:
cbio.getMutationData({case_set_id:"gbm_tcga_all",genetic_profile_id:"gbm_tcga_mutations",gene_list:["EGFR","PTEN"]})cbio.getMutationData({genetic_profile_id:["ov_tcga_mutations","ucec_tcga_mutations"],gene_list:"BRCA1"})cbio.getClinicalData("case set ID (required)")
example:
cbio.getClinicalData("ov_tcga_all")cbio.getProteinArrayInfo({cancer_study_id: "cancer study ID (required)",protein_array_type:"protein_level or phosphorylation",gene_list:["one or more HUGO Gene Symbols or Entrez Gene IDs"]})examples:
cbio.getProteinArrayInfo({cancer_study_id:"coadread_tcga"})cbio.getProteinArrayInfo({cancer_study_id:"coadread_tcga",protein_array_type:"phosphorylation"})cbio.getProteinArrayInfo({cancer_study_id:"coadread_tcga",protein_array_type:"protein_level",gene_list:["ERBB2","TP53"]})cbio.getProteinArrayData({case_set_id: "case set ID (required)",array_info: “[1or0].If1,antibodyinformationwillalsobe exported”
})examples:
cbio.getProteinArrayData("coadread_tcga_RPPA")cbio.getProteinArrayData({case_set_id:"coadread_tcga_RPPA"})cbio.getProteinArrayData({case_set_id:"coadread_tcga_RPPA",array_info:1})cbio.getLinkStudy(parms)example:
cbio.getLinkStudy({cancer_study_id:"gbm_tcga",gene_list:["EGFR","NF1"]})// returns URLcbio.getLinkStudy({cancer_study_id:"gbm_tcga",gene_list:["EGFR","NF1"]})// opens URLcbio.getLinkCase(parms)
examples:
cbio.getLinkCase({case_id:"TCGA-81-5910",cancer_study_id:"gbm_tcga"})// returns URLcbio.getLinkCase({case_id:"TCGA-81-5910",cancer_study_id:"gbm_tcga"},'cbio')// opens URL...