Exemplo n.º 1
0
Arquivo: cli.py Projeto: kvarq/kvarq
def main(argv=None):
    if argv is None:
        argv = sys.argv[1:]
    args = parser.parse_args(argv)

    assert not (args.debug and args.quiet), \
            'make up your mind: debug OR normal OR quiet'

    if args.debug:
        set_debug()
    if args.quiet:
        set_warning()
    if args.log:
        appendlog(args.log)
    if args.excepthook:
        sys.excepthook = traceit

    args.func(args)
Exemplo n.º 2
0
import unittest

from kvarq.log import set_debug
set_debug()

import os.path
import sys
sys.path.insert(0, os.path.dirname(__file__))

from bacillus_anthracis import bacillus_anthracis
from yersinia_pestis import yersinia_pestis
from coxiella_burnetii import coxiella_burnetii 

def create_coverages(tests, snps):
    coverages = dict([(test, False) for test in tests])
    for test in tests:
        if test.genotype.identifier in snps:
            coverages[test] = True
    return coverages

class GenesCanSNPer(unittest.TestCase):

    def test_bacillus_anthracis(self):

        # patch tests
        for test in bacillus_anthracis.tests:
            test.template.validate = lambda x: x

        # child / parent nodes must not be included
        coverages = create_coverages(bacillus_anthracis.tests, 'A/B.Br.001;B.Br.003'.split(';'))