Esempio n. 1
0
    def __init__(self, dbname, f):
        """
        f = given VCF input file
        GetDesign imports the test design and matches rs values to
        positions
        Import imports the input vcf
        GetIDs finds changed positions and matches them to the design.
        """

        print 'Initiating patient...'

        Database.__init__(self, dbname)

        self.f = f

        self.reader = vcf.Reader(open(f, 'r'))

        self.genes = {}

        self.haplotypes = []

        self.starhaps = {}

        print "Loading patient data..."

        self.Load()
Esempio n. 2
0
    def __init__(self, use_test_db):

        Database.__init__(self, use_test_db)
                
        self.packets = []
        
        logging.basicConfig(level=logging.DEBUG)
        
        self.logger = logging.getLogger("LocalDB")
Esempio n. 3
0
    def __init__(self, use_test_db):

        Database.__init__(self, use_test_db)

        self.packets = []

        logging.basicConfig(level=logging.DEBUG)

        self.logger = logging.getLogger("LocalDB")
Esempio n. 4
0
    def __init__(self,
                 host=None,
                 port=None,
                 username='',
                 password='',
                 dbname='test',
                 mode=TRANSACTION_MODE.DEFAULT):
        if port is None:
            port = 5432

        if host is None:
            host = '127.0.0.1'

        db = psycopg2.connect("host=%s port=%d user=%s password=%s dbname=%s" %
                              (host, port, username, password, dbname))

        Database.__init__(self, db)
Esempio n. 5
0
 def __init__(self, host='127.0.0.1', port=3306, username='', password='',
              dbname='test', mode=TRANSACTION_MODE.DEFAULT):
     db = MySQLdb.Connect(host=host, port=port, user=username,
                                 passwd=password, db=dbname)
     Database.__init__(self, db)
Esempio n. 6
0
 def __init__(self, file_path=None):
     if file_path is None: file_path = ":memory:"
     db = sqlite3.connect(file_path)
     Database.__init__(self, db)
Esempio n. 7
0
    def __init__(self, dbname):
        """
		takes database object to work on!
		"""
        Database.__init__(self, dbname)