Exemple #1
0
 def test_chr12(self, config):
     config["snpcheck"]["used"] = ["common", "all", 0.001]
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     name_to_dump = "DNM1L"
     results = zippy.zippyPrimerQuery(config,
                                      "12:32895523-32895682",
                                      True,
                                      None,
                                      db,
                                      None, [0],
                                      name_to_dump=name_to_dump,
                                      noncoding=False,
                                      combine=True,
                                      getgenes=None)
     assert len(results[0]) == 0, results
     config["snpcheck"]["used"] = ["common", "all", 0.08]
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     results = zippy.zippyPrimerQuery(config,
                                      "12:32895523-32895682",
                                      True,
                                      None,
                                      db,
                                      None, [0],
                                      name_to_dump=name_to_dump,
                                      noncoding=False,
                                      combine=True,
                                      getgenes=None)
     assert len(results[0]) > 0, results
Exemple #2
0
 def test_chrX(self, config):
     config["snpcheck"]["used"] = ["common", "all", 0.1]
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     name_to_dump = "RBM10"
     results = zippy.zippyPrimerQuery(config,
                                      "X:47045555-47045786",
                                      True,
                                      None,
                                      db,
                                      None, [
                                          0,
                                      ],
                                      name_to_dump=name_to_dump,
                                      noncoding=False,
                                      combine=True,
                                      getgenes=None)
     assert len(results[0]) > 0, results
     config["snpcheck"]["used"] = ["common", "all"]
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     name_to_dump = "RBM10"
     results = zippy.zippyPrimerQuery(config,
                                      "X:47045555-47045786",
                                      True,
                                      None,
                                      db,
                                      None, [
                                          0,
                                      ],
                                      name_to_dump=name_to_dump,
                                      noncoding=False,
                                      combine=True,
                                      getgenes=None)
     assert len(results[0]) > 0, results
Exemple #3
0
 def test_chr6(self, config):
     config["snpcheck"]["used"] = ["common", "all", 0.000001]
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     results = zippy.zippyPrimerQuery(config,
                                      "6:26092913-26093188",
                                      True,
                                      None,
                                      db,
                                      None, [0],
                                      name_to_dump=None)
     exon_number = 1 + config["exon_numbering_base"]
     logger.debug(f"ress {results}")
     assert len(results[0]) == 0, results
     config["snpcheck"]["used"] = ["common", "all", 0.007]
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     results = zippy.zippyPrimerQuery(config,
                                      "6:26092913-26093188",
                                      True,
                                      None,
                                      db,
                                      None, [0],
                                      name_to_dump=None)
     exon_number = 1 + config["exon_numbering_base"]
     logger.debug(f"ress {results}")
     assert len(results[0]) > 0, results
Exemple #4
0
 def test_chr22(self, config):
     config["snpcheck"]["used"] = ["common", "all", 0.000001]
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     name_to_dump = "HFE"
     results = zippy.zippyPrimerQuery(config,
                                      "22:41568503-41568667",
                                      True,
                                      None,
                                      db,
                                      None, [0],
                                      name_to_dump=name_to_dump,
                                      noncoding=False,
                                      combine=True,
                                      getgenes=None)
     assert len(results[0]) == 0, results
     config["snpcheck"]["used"] = ["common", "all", 0.1]
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     name_to_dump = "HFE"
     results = zippy.zippyPrimerQuery(config,
                                      "22:41568503-41568667",
                                      True,
                                      None,
                                      db,
                                      None, [0],
                                      name_to_dump=name_to_dump,
                                      noncoding=False,
                                      combine=True,
                                      getgenes=None)
     assert len(results[0]) > 0, results
Exemple #5
0
 def test_base0_vs_base1(self, config):
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     zippy.gplist = None
     name_to_dump = "DNM1L"
     config["exon_numbering_base"] = 0
     results0 = zippy.zippyPrimerQuery(config,
                                       "12:32895523-32895682",
                                       True,
                                       None,
                                       db,
                                       None, [0],
                                       name_to_dump=name_to_dump,
                                       noncoding=False,
                                       combine=True,
                                       getgenes=None)
     zippy.gplist = None
     config["exon_numbering_base"] = 1
     results1 = zippy.zippyPrimerQuery(config,
                                       "12:32895523-32895682",
                                       True,
                                       None,
                                       db,
                                       None, [0],
                                       name_to_dump=name_to_dump,
                                       noncoding=False,
                                       combine=True,
                                       getgenes=None)
     logger.info("ress0 {}".format(results0))
     logger.info("ress1 {}".format(results1))
     zippy.gplist = None
Exemple #6
0
 def test_primerexonname6(self, config):
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     zippy.gplist = None
     results = zippy.zippyPrimerQuery(config,
                                      "6:26091069-26091332",
                                      True,
                                      None,
                                      db,
                                      None, [0, 1, 2],
                                      name_to_dump=None)
     assert 0, results
Exemple #7
0
 def test_primerexonname3(self, config):
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     zippy.gplist = None
     results = zippy.zippyPrimerQuery(config,
                                      "12:32895351-32895785",
                                      True,
                                      None,
                                      db,
                                      None, [0, 1, 2],
                                      name_to_dump="DNM1L")
     assert 0, results
Exemple #8
0
 def test_chr12_2missing(self, config):
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     zippy.gplist = None
     results = zippy.zippyPrimerQuery(config,
                                      "12:115115461-115116484",
                                      True,
                                      None,
                                      db,
                                      None, [0, 1, 2],
                                      name_to_dump=None)
     assert len(results[0]) == 0, results
Exemple #9
0
 def test_primerexonname2(self, config):
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     name_to_dump = "DNM1L"
     results = zippy.zippyPrimerQuery(config,
                                      "12:32895523-32895682",
                                      True,
                                      None,
                                      db,
                                      None, [0],
                                      name_to_dump=name_to_dump,
                                      noncoding=False,
                                      combine=True,
                                      getgenes=None)
Exemple #10
0
 def test_chr11(self, config):
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     zippy.gplist = None
     results = zippy.zippyPrimerQuery(config,
                                      "11:118343121-118343321",
                                      True,
                                      None,
                                      db,
                                      None, [0, 1, 2],
                                      name_to_dump=None)
     logging.info(f"chr11 {results}")
     exon_number = 2 + config["exon_numbering_base"]
     assert results[0][0][0:2] == ['11:118343121-118343321', f'KMT2A_{exon_number}_2-3'],\
         results
Exemple #11
0
 def test_primerexonname208(self, config):
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     zippy.gplist = None
     results = zippy.zippyPrimerQuery(config,
                                      "12:25398208-25398318",
                                      True,
                                      None,
                                      db,
                                      None, [0, 1, 2],
                                      name_to_dump="KRAS")
     exon_number = 1 + config["exon_numbering_base"]
     assert results[0][0][0:2] == [
         '12:25398208-25398318', f'KRAS_{exon_number}'
     ], results
Exemple #12
0
 def test_snplimits(self, config):
     db = PrimerDB(config['database'], dump=config['ampliconbed'])
     zippy.gplist = None
     config["designlimits"]["criticalsnp"] == 20
     config["designlimits"]["snpcount"] == 20
     results = zippy.zippyPrimerQuery(config,
                                      "uploads/NEB_S2.smCounter.anno.vcf",
                                      True,
                                      None,
                                      db,
                                      None, [0, 1, 2],
                                      name_to_dump=None)
     zippy.gplist = None
     config["designlimits"]["criticalsnp"] == 0
     config["designlimits"]["snpcount"] == 0
     results2 = zippy.zippyPrimerQuery(config,
                                       "uploads/NEB_S2.smCounter.anno.vcf",
                                       True,
                                       None,
                                       db,
                                       None, [0, 1, 2],
                                       name_to_dump=None)
     zippy.gplist = None
     assert results == results2, (results, results2)
Exemple #13
0
#!/usr/bin/env python

import unittest, pysam, json, sys
from zippy import zippy
from zippy.zippylib import range_string
from zippy.zippylib.database import PrimerDB

with open("zippy/zippy.json") as conf:
    config = json.load(conf)
    db = PrimerDB(config['database'],dump=config['ampliconbed'])
    zippy.gplist = None
    results = zippy.zippyPrimerQuery(config, sys.argv[1], True, None, db,
        None, [0, 1, 2], name_to_dump=sys.argv[2])