#!/usr/bin/env python ''' Module for NGS580 Targetted Exome Analysis using Igor's sns-wes variant calling pipeline This script will check for the completion of NGS580 demultiplexing, and conditionally run the 'start_NGS580_WES_analysis.sh' script to start the analysis copy of the script here: https://github.com/NYU-Molecular-Pathology/protocols/blob/c90653b31d2a65d6df357984e156279ff7f5895c/NGS580/start_NGS580_WES_analysis.sh ''' # ~~~~~ LOGGING ~~~~~~ # from util import log import logging import os script_timestamp = log.timestamp() scriptdir = os.path.dirname(os.path.realpath(__file__)) scriptname = os.path.basename(__file__) logdir = os.path.join(scriptdir, 'logs') file_timestamp = log.timestamp() log_file = os.path.join(scriptdir, logdir, '{0}.{1}.log'.format(scriptname, file_timestamp)) # add a per-module timestamped logging file handler logger = log.build_logger(name="NGS580_analysis") logger.addHandler( log.create_main_filehandler(log_file=log_file, name="NGS580_analysis")) # make the file handler global for use elsewhere main_filehandler = log.get_logger_handler(logger=logger, handler_name='NGS580_analysis') logger.debug("loading NGS580_analysis module")
# -*- coding: utf-8 -*- """ Runs a series of analysis tasks Originally designed as an extension to the sns pipeline output, with the flexibility of added ad hoc extra analysis tasks for downstream processing """ # ~~~~~ LOGGING ~~~~~~ # import os from util import log import logging # path to the script's dir scriptdir = os.path.dirname(os.path.realpath(__file__)) scriptname = os.path.basename(__file__) script_timestamp = log.timestamp() # path to parent dir 2 levels above this script snsxt_parent_dir = os.path.realpath(os.path.dirname(os.path.dirname(__file__)) ) # /ifs/data/molecpathlab/scripts/snsxt/ # dir for logs log_dir = os.path.join(snsxt_parent_dir, 'logs') # timestamped subdir for logs # log_subdir = os.path.join(snsxt_parent_dir, 'logs', script_timestamp) # set a timestamped log file for debug log log_file = os.path.join(log_dir, '{0}.{1}.log'.format(scriptname, script_timestamp)) email_log_file = os.path.join(log_dir, '{0}.{1}.email.log'.format(scriptname, script_timestamp)) def logpath(): """
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' unit tests for the find module ''' import unittest import os from NGS580_demultiplexing import NextSeqRun from util import log script_timestamp = log.timestamp() scriptdir = os.path.dirname(os.path.realpath(__file__)) fixture_dir = os.path.join(scriptdir, "fixtures") sequencer_dir = os.path.join(fixture_dir, 'NextSeq_runs') samplesheet_source_dir = os.path.join(fixture_dir, 'to_be_demultiplexed', 'NGS580') samplesheet_processed_dir = os.path.join(fixture_dir, 'to_be_demultiplexed', 'processed') configs = {} configs['sequencer_dir'] = sequencer_dir configs['email_recipients'] = 'bar' configs['reply_to_servername'] = 'baz' configs['scriptdir'] = scriptdir configs['logdir'] = os.path.join(scriptdir, 'logs') configs['script_timestamp'] = log.timestamp() configs['samplesheet_source_dir'] = samplesheet_source_dir configs['demultiplex_580_script'] = 'zzzzz' configs['samplesheet_processed_dir'] = samplesheet_processed_dir configs['seqtype'] = 'NGS580'