Exemplo n.º 1
0
                default=False,
                action="store_true",
                help="Run in parallel mode")
    return parser

if __name__ == '__main__':
    parser = getOptions()
    (options, args) = parser.parse_args()
    if not options.dbname or not options.fasta_file:
        parser.print_help()
        sys.exit(1)
    if not options.output_path:
        options.output_path = options.dbname
    if not os.path.exists(options.output_path):
        os.mkdir(options.output_path)

    if options.parallel:
        options.parallel = pp.Server()

    united = UnitiedDB(options.dbname + '.db')
    meme_slv = shelve.open(options.dbname + ".slv")
    meme_ids = loadMEME_ID(eval(options.subset, {}, {}))
    meme_ids = list(set(united.getMEME_ID({})) & set(meme_ids))
    print len(meme_ids), "to be scanned"
    timestamp = time.time()
    if options.parallel:
        scanMotifsParallel(options, united, meme_slv, meme_ids)
    else:
        scanMotifs(options, united, meme_slv, meme_ids)
    print time.time() - timestamp
Exemplo n.º 2
0
parser.add_option("-c", "--plantcare", dest="plantcare", help="Import PlantCARE", default=False, action="store_true")
parser.add_option("-p", "--place", dest="place", help="Import PLACE", default=False, action="store_true")
parser.add_option("-d", "--denovo", dest="denovo_path", help="Import Denovo Motifs(MEME format only)", metavar="DIR")

(options, args) = parser.parse_args()

if not options.dbname:
    parser.print_help()
    sys.exit(1)

jaspar_path = './databases/jaspar.db'
plantcare_path = './databases/plantcare.db'
place_path = './databases/place.db'

meme_slv = shelve.open(options.dbname + ".slv")
united = UnitiedDB(options.dbname + ".db")
#initialize databases
if options.jaspar:
    if not os.path.exists(jaspar_path):
        jaspar = JasparDB(jaspar_path)
        jaspar.importTables('./databases/jaspar/')
    else:
        jaspar = JasparDB(jaspar_path)
    meme_motifs = jaspar2meme('./databases/jaspar_pfm/')
    meme_slv.update(split_meme(meme_motifs))
    united.importDB('Jaspar', jaspar_path)

if options.plantcare:
    if not os.path.exists(plantcare_path):
        plantcare = PlantCARE(plantcare_path)
        plantcare.importMotifs('./databases/plantcare.txt')