Getting Started With SolveBio and ClinVar

This demo will demonstrate how to use SolveBio to programmatically access ClinVar records and pull out individual submission details and pubmed IDs where available. To get started with SolveBio, just sign up https://www.solvebio.com/signup (it's free), and install our Python and/or Ruby clients docs.solvebio.com/v1.0/docs/installation.

In [19]:
from solvebio import Dataset, Filter

See https://www.solvebio.com/library/ClinVar for documentation for each of these datasets. The clinvar and submissions dataset comes from the ClinVar XML, the variants dataset comes from the ClinVar VCF. There are occasionally slight differences in genomic coordinates for variants between these two formats (in the source data).

In [22]:
clinvar = Dataset.retrieve('Clinvar/Clinvar')
variants = Dataset.retrieve('Clinvar/Variants')
submissions = Dataset.retrieve('Clinvar/Submissions')

You can query all of our datasets with genomic_coordinates by range. See http://docs.solvebio.com/v1.0/docs/tutorial for documentation. GRCh37/hg19 is the default genome build when none is specificed. GRCh38/hg38 and NCBI36/hg18 are also supported when documented in the Data Library https://www.solvebio.com/library.

In [23]:
clinvar.query(genome_build='GRCh37').range(1,156104629,156104629, exact=True)
Out[23]:
|                   Fields | Data                                              |
|--------------------------+---------------------------------------------------|
|             age_of_onset |                                                   |
|            allele_origin | germline                                          |
|           assertion_type | variation to disease                              |
|    clinical_significance | Pathogenic                                        |
|     cytogenetic_location | 1q22                                              |
|             date_created | 2013-09-30                                        |
|      date_evaluated_last | 2013-09-19                                        |
|             date_updated | 2015-03-23                                        |
|      disease_description | LMNA-related dilated cardiomyopathy (DCM) is  ... |
|        disease_mechanism |                                                   |
|             disease_name | Dilated cardiomyopathy 1A                         |
|   disease_name_alternate | [u'CARDIOMYOPATHY, CONGESTIVE', u'CARDIOMYOPATHY, |
|       disease_prevalence |                                                   |
|           disease_symbol | CMD1A                                             |
| disease_symbol_alternate | [u'IDC', u'CDCD1', u'DCM']                        |
|           entrez_id_gene | [u'4000']                                         |
|              gene_symbol | [u'LMNA']                                         |
|      genomic_coordinates | {u'start': 156104629, u'stop': 156104629, u'build'|
|                     hgvs | [u'p.Arg225X', u'NM_170707.2:c.673C>T', u'LRG_254p|
|              hgvs_refseq | NM_005572.3:c.673C>T                              |
|         location_genbank | NM_170707.2:EXON 4                                |
|      mode_of_inheritance | [u'Autosomal dominant inheritance']               |
|    molecular_consequence | nonsense                                          |
|                  omim_id |                                                   |
|                pubmed_id |                                                   |
|            rcv_accession | RCV000056001                                      |
|       rcv_accession_full | RCV000056001.3                                    |
|    rcv_accession_version | 3                                                 |
|            record_status | current                                           |
|            review_status | classified by multiple submitters                 |
|       review_status_star | 2                                                 |
|                    rs_id | [u'rs60682848']                                   |
|            scv_accession | [u'SCV000065052', u'SCV000087057']                |
|        sequence_ontology | SO:0001587                                        |
|                    title | NM_005572.3(LMNA):c.673C>T (p.Arg225Ter) AND Dilat|
|             variant_type | single nucleotide variant                         |

... 1 more results.

Now we're going to demonstrate, for one specific ClinVar record (the first one in the query list), how to get the scv accessions and then open those details up.

In [33]:
scvs = clinvar.query(genome_build='GRCh37').range(1,156104629,156104629, exact=True)[0].get('scv_accession')
print scvs
[u'SCV000065052', u'SCV000087057']
In [26]:
submissions.query().filter(scv_accession__in=scvs)
Out[26]:
|                        Fields | Data                                         |
|-------------------------------+----------------------------------------------|
|                assertion_type | variation to disease                         |
|         clinical_significance | Pathogenic                                   |
| clinical_significance_comment | The Arg225X variant in LMNA leads to a p ... |
|           date_evaluated_last | 2012-08-15                                   |
|                date_submitted | 2015-01-29                                   |
|                  date_updated | 2015-02-28                                   |
|                  disease_name | Cardiomyopathy, dilated, 1A                  |
|                      evidence | [{u'origin': u'germline', u'species': u'human|
|                          hgvs | [u'NC_000001.10:g.156104629C>T']             |
|                     pubmed_id |                                              |
|                 record_status | current                                      |
|                 review_status | classified by single submitter               |
|                 scv_accession | SCV000065052                                 |
|            scv_accession_full | SCV000065052.2                               |
|         scv_accession_version | 2                                            |
|                     submitter | Laboratory for Molecular Medicine,Partners He|
|                  submitter_id | 21766                                        |
|                         title |                                              |

... 1 more results.
In [32]:
pubmed_ids = [submission_record.get('pubmed_id') for submission_record in submissions.query().filter(scv_accession__in=scvs)
              if submission_record.get('pubmed_id') is not None]
print pubmed_ids
[]

These particular records did not have any pubmed ids associated with it, but you can see how you can easily and programmatically get those details. There's lots you can do with SolveBio! Contact us - [email protected] for more info.