예제 #1
0
def build_pmt_seq_data(bp_size=None):
    # Insert into database
    dbManager = dbm.DBManagerPG(settings.conn_string)
    if bp_size is None:
        dbManager.import_pmt_seq_data()
    elif bp_size == '1k':
        dbManager.import_pmt_seq_data(seq_type='m1', pmt_fasta_file_path=settings.seq_pmt_1k)
    elif bp_size == '5k':
        dbManager.import_pmt_seq_data(seq_type='m5', pmt_fasta_file_path=settings.seq_pmt_5k)
예제 #2
0
def build_walley_data():
    # Read data from csv and build data set into list
    fm = fManager.FileManager()
    ld_prot = fm.csv2list(settings.walley_prot)
    ld_gene = fm.csv2list(settings.walley_gene)
    print (len(ld_prot), len(ld_prot[0]))
    print (len(ld_gene), len(ld_gene[0]))

    # Insert into database
    dbManager = dbm.DBManagerPG(settings.conn_string)
    dbManager.build_walley_data(ld_prot, 'p')
    dbManager.build_walley_data(ld_gene, 'g')
예제 #3
0
def build_kmers():
    """ Build kmers dataset for pepide sequence

        Args:
            None

        Return:
            None
    """
    dbManager = dbm.DBManagerPG(settings.conn_string)
    dbManager.build_kmers(3)
    dbManager.build_kmers(2)
예제 #4
0
def build_kmers(is_promoter=False, bp_size=None):
    dbManager = dbm.DBManagerPG(settings.conn_string)
    if is_promoter:
        for k in range(7, 0, -1):
            print('{}-mer creating...'.format(k))
            if bp_size is None or bp_size == '1k':
                dbManager.build_promoter_kmers(k=k)
            elif bp_size == '5k':
                dbManager.build_promoter_kmers(k=k, bp_size='5k')
            else:
                dbManager.build_promoter_kmers(k=k)
    else:
        #dbManager.build_kmers(3)
        #dbManager.build_kmers(2)
        dbManager.build_kmers(1)
예제 #5
0
def build_dna_seq_data():
    # Insert into database
    dbManager = dbm.DBManagerPG(settings.conn_string)
    dbManager.import_dna_seq_data()
예제 #6
0
def build_kmers_pm():
    dbManager = dbm.DBManagerPG(settings.conn_string)
    dbManager.build_kmers(3)
예제 #7
0
from flask import Flask, request, render_template, session, redirect
from utils import DBManager
from datetime import datetime

app = Flask(__name__)
app.secret_key = "rexrexrex"
dbm = DBManager('root', '')


def get_current_sem():
    now = datetime.now()
    if now.month >= 6:
        semester = 'Fall {}'.format(now.year)
    else:
        semester = 'Spring {}'.format(now.year)
    return semester


def get_next_sem():
    now = datetime.now()
    if now.month >= 6:
        semester = 'Spring {}'.format(now.year + 1)
    else:
        semester = 'Fall {}'.format(now.year)
    return semester


@app.route("/")
@app.route("/home")
def home():
    if 'access' in session:
예제 #8
0
def get_sample_code():
    dbManager = dbm.DBManagerPG(settings.conn_string)
    sample_code = dbManager.get_sample_code()
    return sample_code
예제 #9
0
def build_ra_mapping_table():
    dbManager = dbm.DBManagerPG(settings.conn_string)
    dbManager.build_ra_mapping_table()