示例#1
0
def sqlite_enabled():
    """
    Detects whether sqlite3 is functional on the current system
    """
    from pygr.sqlgraph import import_sqlite
    try:
        sqlite = import_sqlite()  # from 2.5+ stdlib, or pysqlite2
    except ImportError, exc:
        msg = 'sqlite3 error: %s' % exc
        warn(msg)
        return False
示例#2
0
def sqlite_enabled():
    """
    Detects whether sqlite3 is functional on the current system
    """
    from pygr.sqlgraph import import_sqlite
    try:
        sqlite = import_sqlite() # from 2.5+ stdlib, or pysqlite2
    except ImportError, exc:
        msg = 'sqlite3 error: %s' % exc
        warn(msg)
        return False
示例#3
0
文件: annotations.py 项目: ctb/bags
import os
from pygr import sqlgraph, annotation as anno
sqlite = sqlgraph.import_sqlite()

CREATE_SCHEMA = '''CREATE TABLE annotations
    (syn TEXT PRIMARY KEY,
     name TEXT,
     seq_id TEXT,
     start INT,
     stop INT,
     orientation INT,
     description TEXT,
     type TEXT DEFAULT 'gene');
'''

CREATE_SCHEMA_IG = '''CREATE TABLE ig_annotations
    (k INTEGER PRIMARY KEY,
     prev_gene_id INT,
     next_gene_id INT,
     name TEXT,
     seq_id TEXT,
     start INT,
     stop INT,
     type TEXT DEFAULT 'intergenic');
'''


class BagsAnnotationMaker(object):

    def __init__(self, filename, initialize=True):
        if initialize: