scout/commands/load/exons.py
def exons(context, build):
    """Load exons into the scout database"""
    
    adapter = context.obj['adapter']
    
    start = datetime.now()
    # Test if there are any exons loaded
    
    nr_exons = adapter.exons(build=build).count()
    if nr_exons:
        LOG.warning("Dropping all exons ")
        adapter.drop_exons(build=build)
        LOG.info("Exons dropped")
    
    # Load the exons
    ensembl_exons = fetch_ensembl_exons(build=build)
    load_exons(adapter, ensembl_exons, build)

    adapter.update_indexes()
    
    LOG.info("Time to load exons: {0}".format(datetime.now() - start))
def exons(context, build):
    """Load exons into the scout database"""
    
    adapter = context.obj['adapter']
    
    start = datetime.now()
    # Test if there are any exons loaded
    
    nr_exons = adapter.exons(build=build).count()
    if nr_exons:
        LOG.warning("Dropping all exons ")
        adapter.drop_exons(build=build)
        LOG.info("Exons dropped")
    
    # Load the exons
    ensembl_exons = fetch_ensembl_exons(build=build)
    load_exons(adapter, ensembl_exons, build)

    adapter.update_indexes()
    
    LOG.info("Time to load exons: {0}".format(datetime.now() - start))
Load exons into the scout database