Ejemplo n.º 1
0
def map_ensembl_ids(ensembl_ids):
    """Return references based on a list of Ensembl IDs."""
    refs = []
    for ensembl_id in ensembl_ids:
        ref = {'ENSEMBL': ensembl_id}
        ensembl_id = ensembl_id.split('.', maxsplit=1)[0]
        hgnc_id = hgnc_client.get_hgnc_from_ensembl(ensembl_id)
        if not hgnc_id:
            logger.warning('Could not get HGNC ID for ENSEMBL ID %s' %
                           ensembl_id)
            continue
        hgnc_ref = _refs_from_hgnc_id(hgnc_id)
        if hgnc_ref is None:
            continue
        ref.update(hgnc_ref)
        refs.append(ref)
    return refs
Ejemplo n.º 2
0
def test_ensembl_hgnc():
    ensembl_id = 'ENSG00000006071'
    hgnc_id = hgnc_client.get_hgnc_from_ensembl(ensembl_id)
    assert hgnc_id == '59', hgnc_id
    assert hgnc_client.get_ensembl_id(hgnc_id) == ensembl_id