Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
CoNekT/conekt/controllers/admin/controls/blast.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25 lines (20 sloc)
769 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import flash, url_for | |
from conekt.extensions import admin_required | |
from werkzeug.utils import redirect | |
from conekt.controllers.admin.controls import admin_controls | |
from conekt.models.blast_db import BlastDB | |
@admin_controls.route('/build_blast_db') | |
@admin_required | |
def build_blast_db(): | |
""" | |
Touching this endpoint will export cds and protein fasta files and build a database using those files. Paths | |
and commands specified in the config file are used. | |
:return: Redirect to admin controls | |
""" | |
try: | |
BlastDB.create_db() | |
except Exception as e: | |
flash('An error occurred while building the Blast DB', 'danger') | |
else: | |
flash('Blast DB build', 'success') | |
return redirect(url_for('admin.controls.index')) |