import pypeliner.workflow import pypeliner.app import pypeliner.managed import sys import os import shutil from interface.tenxanalysis import TenxAnalysis from utils.isabl import TenxDataStorage from interface.qualitycontrol import QualityControl from utils.config import Configuration, write_config config = Configuration() def Run(sampleid, species, umi_plot, mito_plot, ribo_plot, counts_plot, raw_sce): print("Running QC.") tenx = TenxDataStorage(sampleid) tenx_analysis = TenxAnalysis(tenx.tenx_path) tenx_analysis.load() tenx_analysis.extract() qc = QualityControl(tenx_analysis, sampleid) qc.run(mito=config.mito) plots = qc.plots umi = os.path.join(plots, "umi.png") mito = os.path.join(plots, "mito.png") ribo = os.path.join(plots, "ribo.png") counts = os.path.join(plots, "counts.png")
pred = torch.clamp(complex_abs(pred), min=0.0, max=1.0) target = torch.clamp(complex_abs(target), min=0.0, max=1.0) return pred, target return transform if __name__ == '__main__': # Run from main directory with python -m data.reconstruction.rec_transforms import matplotlib.pyplot as plt from torch.utils.data import DataLoader from data.reconstruction.scar_seg import (get_train_set, get_val_set) from utils.config import Configuration conf = Configuration() conf.input_mode = '2d' conf.dataset_mode = 'reconstruction' conf.downscale = 1 conf.undersampling = { 'sampling_scheme': "varden", 'acceleration_factor': 8, 'variable_acceleration': False } conf.augmentation = { #'elastic_transform_sigma': 30, #'elastic_transform_alpha': 1000, 'shift': (0, 10), 'rotate': 10, 'scale': (0.9, 1.1) }
configuration_markup = { 'config': { 'ready': False, }, 'runtime': { 'secret_key': None, 'debug': False, 'allowed_hosts': 'localhost, 127.0.0.1', }, 'application': { 'api_delay': 0, } } conf_path = 'conf/project.conf' conf = Configuration(conf_path, configuration_markup) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) CONF_READY = conf.get_bool('config', 'ready') if not CONF_READY: print( '[INFO] Configuration file has been generated but seems to be not yet edited.' ) print('[INFO] Check: {}'.format(os.path.join(PROJECT_ROOT, conf_path))) print('[INFO] Set option \'ready\' to \'True\' when you\'ll finish setup.') print('[INFO] Aborting server startup.') exit(0)
from utils.config import Configuration conf = Configuration('app.conf', markdown='main') PROJECT_NAME = conf.get('GENERIC', 'project_name') VERSION = conf.get('GENERIC', 'version') or 'Aftermath' TELEGRAM_BOT_TOKEN = conf.get('TELEGRAM', 'token') AUTHOR_FULLNAME = conf.get('ABOUT', 'author_fullname') AUTHOR_TELEGRAM = conf.get('ABOUT', 'author_telegram')
import os from utils.config import Configuration conf = Configuration('project.conf', markdown='main') BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) SECRET_KEY = conf.get('PREDEFINED', 'secret_key') DEBUG = conf.get('PREDEFINED', 'debug', 'bool') ALLOWED_HOSTS = conf.get('DEPLOY', 'allowed_hosts', 'csv') EMAIL_ENABLED = conf.get('EMAIL', 'enabled', 'bool') if EMAIL_ENABLED: EMAIL_USE_TLS = conf.get('EMAIL', 'use_tls', 'bool') EMAIL_HOST = conf.get('EMAIL', 'host') EMAIL_HOST_USER = conf.get('EMAIL', 'host_user') EMAIL_HOST_PASSWORD = conf.get('EMAIL', 'host_password') EMAIL_PORT = conf.get('EMAIL', 'port') DEFAULT_FROM_EMAIL = conf.get('EMAIL', 'default_from') INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions',