def setup(self, f):
     self.assembly = self.input_assembly
     if self.assembly == 'hg19':
         self.wgs = get_wgs_reader(assembly='hg19')
         self.refversion = 'hg19'
     elif self.assembly == 'hg38':
         self.wgs = get_wgs_reader(assembly='hg38')
         self.refversion = 'hg38'
예제 #2
0
 def __init__(self, args=None, status_writer=None):
     args = args if args else sys.argv
     self.status_writer = status_writer
     self.input_paths = []
     self.input_files = []
     self.input_format = None
     self.logger = None
     self.crv_writer = None
     self.crs_writer = None
     self.crm_writer = None
     self.crl_writer = None
     self.primary_converter = None
     self.converters = {}
     self.possible_formats = []
     self.ready_to_convert = False
     self.cmd_args = None
     self.output_dir = None
     self.output_base_fname = None
     self.pipeinput = False
     self.chromdict = {
         'chrx': 'chrX',
         'chry': 'chrY',
         'chrMT': 'chrM',
         'chrMt': 'chrM',
         'chr23': 'chrX',
         'chr24': 'chrY'
     }
     self._parse_cmd_args(args)
     self._setup_logger()
     self.vtracker = VTracker(deduplicate=not (self.unique_variants))
     self.wgsreader = cravat.get_wgs_reader(assembly='hg38')
 def setup (self):
     self.filenames = []
     self.filename = None
     self.filename_prefix = None
     if self.savepath == None:
         self.filename_prefix = "cravat_result"
     else:
         self.filename_prefix = self.savepath
     self.headers = {}
     self.dataframe_cols = {}
     self.dataframe_colnos = {}
     self.dataframe_headers = {}
     self.colno_to_colname = {}
     self.levels_to_write = self.get_standardized_module_option(self.confs.get('pages',['variant']))
     self.filename_postfix = 'RData'
     self.data = {}
     self.wgs_reader = cravat.get_wgs_reader('hg38')
예제 #4
0
 def __init__(self, *inargs, **inkwargs):
     self._parse_cmd_args(inargs, inkwargs)
     self.logger = None
     self.crv_writer = None
     self.crs_writer = None
     self.crm_writer = None
     self.crl_writer = None
     self.primary_converter = None
     self.converters = {}
     self.possible_formats = []
     self.ready_to_convert = False
     self.chromdict = {
         'chrx': 'chrX',
         'chry': 'chrY',
         'chrMT': 'chrM',
         'chrMt': 'chrM',
         'chr23': 'chrX',
         'chr24': 'chrY'
     }
     self._setup_logger()
     self.vtracker = VTracker(deduplicate=not (self.unique_variants))
     self.wgsreader = cravat.get_wgs_reader(assembly='hg38')
예제 #5
0
 def __init__(self, *inargs, **inkwargs):
     self._parse_cmd_args(inargs, inkwargs)
     self.logger = None
     self.crv_writer = None
     self.crs_writer = None
     self.crm_writer = None
     self.crl_writer = None
     self.primary_converter = None
     self.converters = {}
     self.possible_formats = []
     self.ready_to_convert = False
     self.chromdict = {
         "chrx": "chrX",
         "chry": "chrY",
         "chrMT": "chrM",
         "chrMt": "chrM",
         "chr23": "chrX",
         "chr24": "chrY",
     }
     self._setup_logger()
     self.vtracker = VTracker(deduplicate=not (self.unique_variants))
     self.wgsreader = cravat.get_wgs_reader(assembly="hg38")
     self.crs_def = constants.crs_def.copy()
예제 #6
0
 def setup(self, f):
     self.wgs = get_wgs_reader(assembly='hg19')
     self.good_vars = set(['T', 'C', 'G', 'A'])
import time
from concurrent.futures import ProcessPoolExecutor
from cravat import get_live_annotator, get_live_mapper
from cravat.config_loader import ConfigLoader
import requests
import oyaml
import datetime
from pyliftover import LiftOver
import cravat

live_modules = {}
live_mapper = None
module_confs = {}
modules_to_run_ordered = []
oncokb_cache = {}
wgsreader = cravat.get_wgs_reader(assembly='hg38')


async def test(request):
    return web.json_response({'result': 'success'})


async def get_live_annotation_post(request):
    queries = await request.post()
    response = await get_live_annotation(queries)
    return web.json_response(response)


async def get_live_annotation_get(request):
    queries = request.rel_url.query
    response = await get_live_annotation(queries)
예제 #8
0
import aiosqlite
import os
import cravat
import cravat.admin_util as au

info = au.get_local_module_info('go')
path = info.directory
wgr = cravat.get_wgs_reader()

async def get_data (queries):
    response = {}
    dbpath = queries['dbpath']

    conn = await aiosqlite.connect(dbpath)
    cursor = await conn.cursor()

    table = 'variant'
    query = 'select name from sqlite_master where type="table" and name="' + table + '"'
    await cursor.execute(query)
    r = await cursor.fetchone()

    from_str = ' from variant '
        
    query = 'select base__chrom, base__pos, base__ref_base, base__alt_base '
    query += from_str
    await cursor.execute(query)

    # get all triplets with 'A' in the middle
    tripletDataA = [a + 'A' + c for a in ['A', 'T', 'G', 'C'] for c in ['A', 'T', 'G', 'C']]

    # get all triplets with 'G' in the middle