megaqc package

Submodules

megaqc.app module

MegaQC: A web-based tool to collect and visualise data from multiple MultiQC reports.

This file contains the app module, with the app factory function.

megaqc.app.create_app(config_object)[source]

An application factory, as explained here: http://flask.pocoo.org/docs/patterns/appfactories/.

Parameters

config_object – The configuration object to use.

megaqc.app.register_blueprints(app)[source]

Register Flask blueprints.

megaqc.app.register_commands(app)[source]

Register Click commands.

megaqc.app.register_errorhandlers(app)[source]

Register error handlers.

megaqc.app.register_extensions(app)[source]

Register Flask extensions.

megaqc.app.register_shellcontext(app)[source]

Register shell context objects.

megaqc.cli module

MegaQC: a web application that collects results from multiple runs of MultiQC and allows bulk visualisation.

megaqc.cli.create_megaqc_app()[source]
megaqc.cli.main()[source]

megaqc.commands module

Click commands.

megaqc.commands.megaqc_date_type(arg)[source]

megaqc.compat module

Python 2/3 compatibility module.

megaqc.database module

Database module, including the SQLAlchemy database object and DB-related utilities.

class megaqc.database.CRUDMixin[source]

Bases: object

Mixin that adds convenience methods for CRUD (create, read, update, delete) operations.

classmethod create(**kwargs)[source]

Create a new record and save it the database.

delete(commit=True)[source]

Remove the record from the database.

classmethod get_or_create(kwargs)[source]
property primary_key[source]
classmethod primary_key_columns()[source]
classmethod primary_key_name()[source]
save(commit=True)[source]

Save the record.

update(commit=True, **kwargs)[source]

Update specific fields of a record.

class megaqc.database.Model(**kwargs)[source]

Bases: megaqc.database.CRUDMixin, sqlalchemy.orm.decl_api.Model

Base model class that includes CRUD convenience methods.

class megaqc.database.SurrogatePK[source]

Bases: object

A mixin that adds a surrogate integer ‘primary key’ column named id to any declarative-mapped class.

classmethod get_by_id(record_id)[source]

Get record by ID.

id = Column(None, Integer(), table=None, primary_key=True, nullable=False)[source]
megaqc.database.init_db(url)[source]

Initialise a new database.

megaqc.database.postgres_create_database(conn, cur, database, user)[source]

Create a Postgres database, with the given owner.

megaqc.database.postgres_create_user(username, conn, cur, password=None)[source]

Create a postgres user, including a password if provided.

megaqc.extensions module

Extensions module.

Each extension is initialized in the app factory located in app.py.

megaqc.scheduler module

megaqc.scheduler.init_scheduler(app)[source]
megaqc.scheduler.upload_reports_job()[source]

megaqc.settings module

Application configuration.

class megaqc.settings.Config[source]

Bases: object

Base configuration.

APP_DIR = '/home/runner/work/MegaQC/MegaQC/megaqc'[source]
CACHE_TYPE = 'simple'[source]
DB_PATH = None[source]
DEBUG_TB_ENABLED = False[source]
DEBUG_TB_INTERCEPT_REDIRECTS = False[source]
EXTRA_CONFIG = None[source]
JOBS = [{'id': 'job1', 'func': <function upload_reports_job>, 'trigger': 'interval', 'seconds': 30}][source]
LOG_LEVEL = 20[source]
PROJECT_ROOT = '/home/runner/work/MegaQC/MegaQC'[source]
SCHEDULER_API_ENABLED = True[source]
SECRET_KEY = 'secret-key'[source]
SERVER_NAME = None[source]
SQLALCHEMY_DATABASE = 'megaqc'[source]
SQLALCHEMY_DBMS = None[source]
SQLALCHEMY_HOST = 'localhost:5432'[source]
SQLALCHEMY_PASS = ''[source]
SQLALCHEMY_TRACK_MODIFICATIONS = False[source]
SQLALCHEMY_USER = 'megaqc_user'[source]
UPLOAD_FOLDER = '/home/runner/work/MegaQC/MegaQC/uploads'[source]
USER_REGISTRATION_APPROVAL = True[source]
update_db_uri()[source]
class megaqc.settings.DevConfig[source]

Bases: megaqc.settings.Config

Development configuration.

CACHE_TYPE = 'simple'[source]
DB_NAME = 'megaqc.db'[source]
DB_PATH = '/home/runner/work/MegaQC/MegaQC/megaqc.db'[source]
DEBUG = True[source]
DEBUG_TB_ENABLED = True[source]
ENV = 'dev'[source]
LOG_LEVEL = 10[source]
SQLALCHEMY_DBMS = 'sqlite'[source]
SQLALCHEMY_ECHO = True[source]
SQLALCHEMY_RECORD_QUERIES = True[source]
WTF_CSRF_ENABLED = False[source]
class megaqc.settings.ProdConfig[source]

Bases: megaqc.settings.Config

Production configuration.

DEBUG = False[source]
DEBUG_TB_ENABLED = False[source]
ENV = 'prod'[source]
SQLALCHEMY_DATABASE = 'megaqc'[source]
SQLALCHEMY_DBMS = 'postgresql'[source]
SQLALCHEMY_HOST = 'localhost:5432'[source]
SQLALCHEMY_PASS = 'megaqcpswd'[source]
SQLALCHEMY_USER = 'megaqc'[source]
class megaqc.settings.TestConfig[source]

Bases: megaqc.settings.Config

Test configuration.

DB_NAME = 'megaqc.db'[source]
DB_PATH = '/tmp/tmpa0x_owth/megaqc.db'[source]
DEBUG = True[source]
DEBUG_TB_ENABLED = False[source]
LOG_LEVEL = 10[source]
SQLALCHEMY_DBMS = 'sqlite'[source]
TESTING = True[source]
WTF_CSRF_ENABLED = False[source]

megaqc.wsgi module

Module contents

Main application package.