'''
Individual stages of the pipeline implemented as functions from
input files to output files.

The run_stage function knows everything about submitting jobs and, given
the state parameter, has full access to the state of the pipeline, such
as config, options, DRMAA and the logger.
'''

from pipeline_base.utils import safe_make_dir
from pipeline_base.runner import run_stage
import os


class Stages(object):
    def __init__(self, state):
        self.state = state

    def get_stage_options(self, stage, *options):
        return self.state.config.get_stage_options(stage, *options)

    def get_options(self, *options):
        return self.state.config.get_options(*options)

    def original_files(self, output):
        '''Original files'''
        pass

    def fastqc(self, fastq_in, dir_out):
        '''Quality check fastq file using fastqc'''
        safe_make_dir(dir_out)
        command = '{command_dir}/fastqc --extract -o {dir} {fastq}'.format(command_dir="/mnt/vicnode_nfs/tools/FastQC", dir=dir_out, fastq=fastq_in)
        run_stage(self.state, 'fastqc', command)


'''
Individual stages of the pipeline implemented as functions from
input files to output files.

The run_stage function knows everything about submitting jobs and, given
the state parameter, has full access to the state of the pipeline, such
as config, options, DRMAA and the logger.
'''

from pipeline_base.utils import safe_make_dir
from pipeline_base.runner import run_stage
import os


class Stages(object):
    def __init__(self, state):
        self.state = state

    def get_stage_options(self, stage, *options):
        return self.state.config.get_stage_options(stage, *options)

    def get_options(self, *options):
        return self.state.config.get_options(*options)

    def original_files(self, output):
        '''Original files'''
        pass

    def fastqc(self, fastq_in, dir_out):
        '''Quality check fastq file using fastqc'''
        safe_make_dir(dir_out)
        command = '{command_dir}/fastqc --extract -o {dir} {fastq}'.format(command_dir="/mnt/vicnode_nfs/tools/FastQC", dir=dir_out, fastq=fastq_in)
        run_stage(self.state, 'fastqc', command)


Individual stages of the pipeline implemented as functions from input files to output files.  The run_stage function knows everything about submitting jobs and, given the state parameter, has full access to the state of the pipeline, such as config, options, DRMAA and the logger. Original files Quality check fastq file using fastqc