How to retrieve COSMIC variations using Ensembl REST API?
Entering edit mode
4.8 years ago

I'm failing to retrieve Cosmic variations for some human genes using Ensembl API.

Using a web browser with this link:;g=ENSG00000141510;r=17:7661779-7687550;t=ENST00000617185

illustrates that Cosmic variations are available for gene TP53 (ensembl id=ENSG00000141510); in the above URL, I actually retrieved variations for one on the many TP53 transcripts, ENST00000617185.

Ok, now, if I use one of these URLs (Ensembl API based) :

I can retrieve Clinvar, PhenCode, etc. mutations but no Cosmic ones.

Any idea of what I did wrong?

An optional question: to which kind of Ensembl objects (gene, transcript, protein) are attached the many variation features available from Ensembl? I could not find a documentation about that.

variation ensembl api cosmic • 1.8k views
Entering edit mode
4.8 years ago
Ben_Ensembl ★ 1.8k

Hi Patrick,

We seperate somatic data from germline, so the query should be: curl -H 'Content-type:text/xml' ''

<data id="COSM5493517" assembly_name="GRCh38" consequence_type="splice_region_variant" end="7662020" feature_type="somatic_variation" seq_region_name="17" source="COSMIC" start="766201 9" strand="1"> <alleles>COSMIC_MUTATION</alleles> </data> <data id="COSM18654" assembly_name="GRCh38" consequence_type="transcript_ablation" end="7676594" feature_type="somatic_variation" seq_region_name="17" source="COSMIC" start="7669609" s="" trand="1">

See: for the list of feature types.

For the optional question: the genomic locations of variants are stored in our database, and are not linked to objects per se. The variant consequence(s)/effect(s) on gene(s) is inferred from the variant location in relation to the gene model.

Best wishes

Ben Ensembl Helpdesk

Entering edit mode

Hi Ben,

ok, got it, thanks. By the way, do you have any documentation that gives more insights on how to combine feature types with variant_set. E.g. if I use "feature=variation", what are the appropriate values for "variant_set" ? I cannot find that information from the "overlap" service web page, neither from this page.


Entering edit mode

The 'variant_set' filter only works with the 'variation' feature type. We will change the text to clarify this for e!88, though.


Login before adding your answer.

Traffic: 2168 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6