Notebook source
Rendered from notebooks/getting_started/2_Exploring_the_SeqRepo_DataProxy.ipynb.
2. Exploring the SeqRepo DataProxy
The SeqRepo DataProxy has sequence related functionality that may be of use.
Step 1 - Setup Data Proxy Access
The DataProxy provides access to sequence references.
from ga4gh.vrs.dataproxy import create_dataproxy
seqrepo_rest_service_url = "seqrepo+https://services.genomicmedlab.org/seqrepo"
seqrepo_dataproxy = create_dataproxy(uri=seqrepo_rest_service_url)
Step 2 - Information on refseq accessions
It is often necessary when building SequenceLocation objects, to obtain the refget accession from a public accession identifier. The DataProxy method derive_refget_accession can do this for you.
Output:
The DataProxy get_metadata method provides metadata information on the accession including: the date the accession was added, aliases for the accession and reference length.
Output:
{'added': '2016-08-24T05:03:11Z',
'aliases': ['MD5:215137b1973c1a5afcf86be7d999574a',
'NCBI:NM_000551.3',
'refseq:NM_000551.3',
'SEGUID:T12L0p2X5E8DbnL0+SwI4Wc1S6g',
'SHA1:4f5d8bd29d97e44f036e72f4f92c08e167354ba8',
'VMC:GS_v_QTc1p-MUYdgrRv4LMT6ByXIOsdw3C_',
'sha512t24u:v_QTc1p-MUYdgrRv4LMT6ByXIOsdw3C_',
'ga4gh:SQ.v_QTc1p-MUYdgrRv4LMT6ByXIOsdw3C_'],
'alphabet': 'ACGT',
'length': 4560}
DataProxy get_sequence returns actual sequence for given identifier, optionally limited to interbase
identifier = "ga4gh:SQ.v_QTc1p-MUYdgrRv4LMT6ByXIOsdw3C_"
seqrepo_dataproxy.get_sequence(identifier, start=0, end=51)
Output:
DataProxy translate_sequence_identifier returns a list of equivalent identifiers in the given namespace.
Output:
seqrepo_dataproxy.translate_sequence_identifier("ga4gh:SQ.IIB53T8CNeJJdUqzn9V_JnRtQadwWCbl", "GRCh38")
Output: