示例#1
0
文件: base.py 项目: J35P312/PuzzleWin
def base(ctx, verbose):
    """Puzzle: manage DNA variant resources."""
    # configure root logger to print to STDERR
    loglevel = LEVELS.get(min(verbose, 3))
    configure_stream(level=loglevel)

    # launch the command line interface
    logger.debug('Booting up command line interface')
    
    ctx.obj = {}
示例#2
0
文件: base.py 项目: stjmonde/puzzle-2
def base(ctx, verbose, config):
    """Puzzle: manage DNA variant resources."""
    # configure root logger to print to STDERR
    loglevel = LEVELS.get(min(verbose, 3))
    configure_stream(level=loglevel)
    ctx.obj = {}
    if config and os.path.exists(config):
        ctx.obj = yaml.load(open(config, 'r')) or {}
        ctx.obj['config_path'] = config
    # launch the command line interface
    logger.debug('Booting up command line interface')
示例#3
0
import logging

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

# from puzzle.factory import create_app
from puzzle.models import (Variant, DotDict, Individual)
from puzzle.models.sql import BASE
from puzzle.models.sql import Case as SqlCase
from puzzle.plugins import VcfPlugin, SqlStore
from puzzle.utils import (get_cases, get_header)
# from puzzle.settings import TestConfig

from puzzle.log import configure_stream

root_logger = configure_stream()
logger = logging.getLogger(__name__)


@pytest.fixture
def vcf():
    db = VcfPlugin()
    return db


@pytest.fixture(scope='function')
def puzzle_dir(request, dir_path):
    """Return a puzzle dir with a database initialized"""
    db_path = os.path.join(dir_path, 'puzzle_db.sqlite3')
    logger.debug("db path is: {}".format(db_path))
示例#4
0
import pytest
import logging

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

# from puzzle.factory import create_app
from puzzle.models import Variant
from puzzle.models.sql import BASE
from puzzle.plugins import VcfPlugin, SqlStore
from puzzle.utils import get_case
# from puzzle.settings import TestConfig

from puzzle.log import configure_stream

root_logger = configure_stream()
logger = logging.getLogger(__name__)


@pytest.fixture
def vcf():
    db = VcfPlugin()
    return db


@pytest.fixture
def variant():
    """Return a variant dictionary"""
    data = dict(CHROM='1', POS='100', ID='rs01', REF='A', ALT='T', QUAL='100',
                FILTER='PASS')
    variant = Variant(**data)