Exemple #1
0
    def setUp(self):
        reference_db = pymongo.MongoClient()['xbrowse_reference']
        self.reference = Reference(reference_db, ensembl_db_port=3001, ensembl_db_user="******")

        annotator_db = pymongo.MongoClient()['xbrowse_annotator']
        self.annotator = VariantAnnotator(annotator_db, self.reference)

        self.populations = ['g1k_all', 'esp_ea', 'esp_aa', 'atgu_controls']
Exemple #2
0
    def setUp(self):
        reference_db = pymongo.Connection().xbrowse_reference
        self.reference = Reference(reference_db, ensembl_db_port=3001, ensembl_db_user="******")

        annotator_db = pymongo.Connection().xbrowse_annotator
        self.annotator = VariantAnnotator(annotator_db, self.reference)

        self.populations = ['g1k_all', 'esp_ea', 'esp_aa', 'atgu_controls']
Exemple #3
0
def get_annotator():
    global _annotator
    if _annotator is None:
        _annotator = VariantAnnotator(
            settings_module=settings.ANNOTATOR_SETTINGS,
            custom_annotator=get_custom_annotator(),
        )
    return _annotator
Exemple #4
0
class AnnotatorTests(unittest.TestCase):

    def setUp(self):
        reference_db = pymongo.Connection().xbrowse_reference
        self.reference = Reference(reference_db, ensembl_db_port=3001, ensembl_db_user="******")

        annotator_db = pymongo.Connection().xbrowse_annotator
        self.annotator = VariantAnnotator(annotator_db, self.reference)

        self.populations = ['g1k_all', 'esp_ea', 'esp_aa', 'atgu_controls']

    def test_actn3(self):
        annotation = self.annotator.get_annotation_for_variant(11e9+66328095, 'T', 'C', self.populations)
        print annotation

    def test_103807450(self):
        annotation = self.annotator.get_annotation_for_variant(1e9+3807450, 'C', 'A', self.populations)
        print annotation
Exemple #5
0
class AnnotatorTests(unittest.TestCase):

    def setUp(self):
        reference_db = pymongo.MongoClient()['xbrowse_reference']
        self.reference = Reference(reference_db, ensembl_db_port=3001, ensembl_db_user="******")

        annotator_db = pymongo.MongoClient()['xbrowse_annotator']
        self.annotator = VariantAnnotator(annotator_db, self.reference)

        self.populations = ['g1k_all', 'esp_ea', 'esp_aa', 'atgu_controls']

    def test_actn3(self):
        annotation = self.annotator.get_annotation_for_variant(11e9+66328095, 'T', 'C', self.populations)
        print annotation

    def test_103807450(self):
        annotation = self.annotator.get_annotation_for_variant(1e9+3807450, 'C', 'A', self.populations)
        print annotation
Exemple #6
0
#!/usr/bin/env python

from xbrowse.reference import Reference
from xbrowse.annotation import VariantAnnotator
from xbrowse.coverage import CoverageDatastore
from xbrowse.datastore import MongoDatastore

import pymongo

reference_db = pymongo.Connection()['xbrowse_reference']
reference = Reference(reference_db, ensembl_db_host='useastdb.ensembl.org', ensembl_db_user="******")

annotator_db = pymongo.Connection()['xbrowse_annotator']
annotator = VariantAnnotator(annotator_db, reference)
annotator.ensure_indices()

coverage_db = pymongo.Connection()['xbrowse_coverage']
coverage_store = CoverageDatastore(coverage_db, reference)

datastore_db = pymongo.Connection()['xbrowse_datastore']
datastore = MongoDatastore(datastore_db, annotator)

user_ns = {
    'reference': reference,
    'annotator': annotator, 
    'coverage_store': coverage_store,
    'datastore': datastore,
}

import IPython
IPython.embed(user_ns=user_ns)
Exemple #7
0
import django
django.setup()

import pymongo
from xbrowse.reference import Reference
from xbrowse.annotation import VariantAnnotator
from xbrowse.coverage import CoverageDatastore
from xbrowse.datastore import MongoDatastore
import reference_settings
import annotator_settings
from xbrowse_server.base.models import Project, Family, Individual
reference_db = pymongo.MongoClient('xbrowse_reference')
reference = Reference(reference_settings)

annotator_db = pymongo.MongoClient('xbrowse_annotator')
annotator = VariantAnnotator(annotator_settings, reference)
annotator._ensure_indices()

datastore_db = pymongo.MongoClient('xbrowse_datastore')
datastore = MongoDatastore(datastore_db, annotator)

user_ns = {
    'annotator': annotator,
    'datastore': datastore,
    'Project': Project,
    'Family': Family,
    'Individual': Individual,
}

import IPython
IPython.embed(user_ns=user_ns)
Exemple #8
0
#!/usr/bin/env python

import pymongo

from xbrowse.reference import Reference
from xbrowse.annotation import VariantAnnotator
from xbrowse.coverage import CoverageDatastore
from xbrowse.datastore import MongoDatastore

reference_db = pymongo.Connection()['xbrowse_reference']
reference = Reference(reference_db,
                      ensembl_db_host='useastdb.ensembl.org',
                      ensembl_db_user="******")

annotator_db = pymongo.Connection()['xbrowse_annotator']
annotator = VariantAnnotator(annotator_db, reference)
annotator._ensure_indices()

coverage_db = pymongo.Connection()['xbrowse_coverage']
coverage_store = CoverageDatastore(coverage_db, reference)

datastore_db = pymongo.Connection()['xbrowse_datastore']
datastore = MongoDatastore(datastore_db, annotator)

user_ns = {
    'reference': reference,
    'annotator': annotator,
    'coverage_store': coverage_store,
    'datastore': datastore,
}
REFERENCE = Reference(reference_settings)

population_frequency_store_settings = imp.load_source(
    'popfreq_store_settings', SETTINGS_DIR + 'popfreq_store_settings.py')
POPULATION_FREQUENCY_STORE = PopulationFrequencyStore(
    population_frequency_store_settings)

vep_settings = imp.load_source('vep_settings',
                               SETTINGS_DIR + 'vep_settings.py')
VEP_ANNOTATOR = HackedVEPAnnotator(vep_settings)

annotator_settings = imp.load_source('annotator_settings',
                                     SETTINGS_DIR + 'annotator_settings.py')
ANNOTATOR = VariantAnnotator(
    settings_module=annotator_settings,
    reference=REFERENCE,
    population_frequency_store=POPULATION_FREQUENCY_STORE,
    vep_annotator=VEP_ANNOTATOR,
)

_conn = pymongo.Connection()
datastore_db = _conn['xbrowse_datastore']
population_datastore_db = _conn['xbrowse_pop_datastore']

DATASTORE = MongoDatastore(datastore_db, ANNOTATOR)
POPULATION_DATASTORE = PopulationDatastore(population_datastore_db, ANNOTATOR)

coverage_db = _conn['xbrowse_coverage']
COVERAGE_STORE = CoverageDatastore(coverage_db, REFERENCE)

project_datastore_db = _conn['xbrowse_proj_store']
PROJECT_DATASTORE = ProjectDatastore(project_datastore_db, ANNOTATOR)
REFERENCEDATA_DIR = os.path.dirname(os.path.realpath(__file__)) + '/'
HGMD_OMIM_FILE = '/vagrant/xbrowse-laptop-downloads/hgmd_omim_genes.txt'

reference_settings = imp.load_source(
    'reference_settings',
    os.path.dirname(os.path.realpath(__file__)) + '/reference_settings.py')
REFERENCE = Reference(reference_settings)

CUSTOM_ANNOTATOR = None

annotator_settings = imp.load_source(
    'annotator_settings',
    os.path.dirname(os.path.realpath(__file__)) + '/annotator_settings.py')
ANNOTATOR = VariantAnnotator(
    settings_module=annotator_settings,
    custom_annotator=CUSTOM_ANNOTATOR,
)

_conn = pymongo.Connection()
datastore_db = _conn['xbrowse_datastore']
population_datastore_db = _conn['xbrowse_pop_datastore']

# datastore_settings = imp.load_source(
#     'datastore_settings',
#     os.path.dirname(os.path.realpath(__file__)) + '/datastore_settings.py'
# )
DATASTORE = MongoDatastore(datastore_db, ANNOTATOR)

POPULATION_DATASTORE = PopulationDatastore(population_datastore_db, ANNOTATOR)

coverage_db = _conn['xbrowse_coverage']
Exemple #11
0
def get_annotator():
    global _annotator
    if _annotator is None:
        _annotator = VariantAnnotator(
            custom_annotator=get_custom_annotator(), )
    return _annotator