示例#1
0
def main():

    
    no_threads = 1
    
    db_name =  "exolocator_db"
    db      = connect_to_mysql(user="******", passwd="tooiram")
    cursor  = db.cursor()
    switch_to_db (cursor, db_name)

    cfg      = ConfigurationReader(user="******", passwd="tooiram", check=False)
    # afs is killing me here ...
    in_path  = cfg.get_path('afs_dumps')+"/exons"
    if (not os.path.exists(in_path)):
        print in_path, "not found"


    
    cursor.close()
    db    .close()
    
    ###############
    os.chdir(in_path)
    filenames = glob.glob("*exon_dump.txt")
    
    parallelize (no_threads, load_from_infiles, filenames, in_path)
def main():

    no_threads = 1

    db = connect_to_mysql()
    cursor = db.cursor()

    [all_species, ensembl_db_name] = get_species (cursor)

    parallelize (no_threads, dump_orthos, all_species, [local_db, ensembl_db_name])
def main():

    special = 'test'
    no_threads = 10
    method = 'usearch'

    if len(sys.argv) > 1 and len(sys.argv) < 4:
        print("usage: %s <set name> <number of threads> <method>" %
              sys.argv[0])
        exit(1)
    elif len(sys.argv) == 4:

        special = sys.argv[1]
        special = special.lower()
        if special == 'none': special = None

        no_threads = int(sys.argv[2])

        method = sys.argv[3]
        if not (method == 'usearch' or method == 'sw_sharp'):
            print("unrecognized method: ", method)
            exit(1)

    # sw_sharps chokes if there is only one graphics card
    if method == 'sw_sharp': no_threads = 1

    db = connect_to_mysql()
    cfg = ConfigurationReader()
    cursor = db.cursor()

    [all_species, ensembl_db_name] = get_species(cursor)

    print('=======================================')
    print(sys.argv[0])
    if special:
        print("using", special, "set")
        if special == 'complement':
            gene_list = get_complement_ids(cursor, ensembl_db_name, cfg)
        else:
            gene_list = get_theme_ids(cursor, ensembl_db_name, cfg, special)

    else:
        print("using all protein coding genes")
        switch_to_db(cursor, ensembl_db_name['homo_sapiens'])
        gene_list = get_gene_ids(cursor, biotype='protein_coding', is_known=1)

    cursor.close()
    db.close()

    parallelize(no_threads, find_missing_exons, gene_list,
                [local_db, ensembl_db_name, method])

    return True
def main():
    
    special    = 'test'
    no_threads = 10
    method     = 'usearch'


    if len(sys.argv) > 1 and  len(sys.argv)<4:
        print "usage: %s <set name> <number of threads> <method>" % sys.argv[0]
        exit(1)
    elif len(sys.argv)==4:

        special = sys.argv[1]
        special = special.lower()
        if special == 'none': special = None

        no_threads = int(sys.argv[2])
        
        method = sys.argv[3]
        if not (method =='usearch' or method=='sw_sharp'):
            print "unrecognized method: ", method
            exit(1)

    # sw_sharps chokes if there is only one graphics card
    if method=='sw_sharp': no_threads = 1

    db  = connect_to_mysql()
    cfg = ConfigurationReader()
    cursor = db.cursor()

    [all_species, ensembl_db_name] = get_species (cursor)


    print '======================================='
    print sys.argv[0]
    if special:
        print "using", special, "set"
        if special == 'complement':
            gene_list = get_complement_ids(cursor, ensembl_db_name, cfg)
        else:
            gene_list = get_theme_ids (cursor,  ensembl_db_name, cfg, special )

    else:
        print "using all protein coding genes"
        switch_to_db (cursor,  ensembl_db_name['homo_sapiens'])
        gene_list = get_gene_ids (cursor, biotype='protein_coding', is_known=1)

    cursor.close()
    db.close()

    parallelize (no_threads, find_missing_exons, gene_list, [local_db, ensembl_db_name, method])
    
    return True
def main():
    no_threads = 10

    db = connect_to_mysql()
    cursor = db.cursor()

    [all_species, ensembl_db_name] = get_species (cursor)
    cursor.close()
    db    .close()

    parallelize (no_threads, multiple_exon_alnmt, all_species, [local_db, ensembl_db_name])
    
    return True
示例#6
0
def main():
    
    no_threads = 10
    db     = connect_to_mysql()
    cursor = db.cursor()

    [all_species, ensembl_db_name] = get_species (cursor)
    species                        = 'homo_sapiens'
    switch_to_db (cursor, ensembl_db_name[species])
    gene_list                      = get_gene_ids (cursor, biotype='protein_coding', is_known=1)
    cursor.close()
    db.close()

    parallelize (no_threads, collect_orthologues, gene_list, [local_db, ensembl_db_name])
    
    return True
示例#7
0
def main():

    no_threads = 1
    local_db = False

    db = connect_to_mysql()
    cfg = ConfigurationReader()

    cursor = db.cursor()
    [all_species, ensembl_db_name] = get_species(cursor)

    outdir = "{0}/para_dump".format(cfg.dir_path['afs_dumps'])
    print outdir
    if not os.path.exists(outdir):
        print outdir, "not found"
        exit(1)  # exit after dir existence check
    cursor.close()
    db.close()

    parallelize(no_threads, dump_paralogues, all_species,
                [local_db, ensembl_db_name, outdir])

    return True
def main():
    
    no_threads = 1
    local_db = False

    db  = connect_to_mysql()
    cfg = ConfigurationReader()

    cursor = db.cursor()
    [all_species, ensembl_db_name] = get_species (cursor)


    outdir  = "{0}/para_dump".format(cfg.dir_path['afs_dumps'])
    print outdir
    if not os.path.exists(outdir):
        print outdir, "not found"
        exit(1) # exit after dir existence check
    cursor.close()
    db    .close()

    parallelize (no_threads, dump_paralogues, all_species, [local_db, ensembl_db_name, outdir])

    
    return True