# Path: ob_pipelines/config.py
# AWS_PROFILE = os.environ.get('AWS_PROFILE', 'default')
# CONFIG_FILE = op.join(op.dirname(op.dirname(ob_pipelines.__file__)), 'config.yaml')
# class ConfigManager:
#     def __init__(self, config):
#     def get(self, option, default=None):
#     def get_source_bucket(self):
#     def get_target_bucket(self):
# 
# Path: ob_pipelines/pipelines/rnaseq/tasks/bam_to_fastq.py
# class BamToFastQ(BatchTask, LoggingTaskWrapper, Sample):
#     job_definition = 'bam2fastq'
# 
#     @property
#     def parameters(self):
#         return {
#             'input': self.input().path,
#             'fq1': self.output()['fq1'].path,
#             'fq2': self.output()['fq2'].path,
#         }
# 
#     def requires(self):
#         return FilterSpliced(sample_id=self.sample_id)
# 
#     def output(self):
#         s3_prefix = '{}/{}/filtered/{}'.format(
#             settings.get_target_bucket(), self.sample_folder, self.sample_id)
#         s3_paths = [
#             s3_prefix + '_1.fq.gz',
#             s3_prefix + '_2.fq.gz',
#         ]
#         return [S3Target(path) for path in s3_paths]
# 
# Path: ob_pipelines/pipelines/rnaseq/tasks/kallisto.py
# class Kallisto(BatchTask, LoggingTaskWrapper, Sample):
#     job_definition = 'kallisto'
# 
#     @property
#     def parameters(self):
#         fq1, fq2 = self.input()
#         return {
#             'threads': '20',
#             'index': get_index('kallisto'),
#             'reads1': fq1.path,
#             'reads2': fq2.path,
#             'strand_flag': '--rf-stranded',
#             'output': op.dirname(self.output()['abundance'].path) + '/'
#         }
# 
#     def requires(self):
#         return SampleFastQ(sample_id=self.sample_id)
# 
#     def output(self):
#         output_files = {
#             'abundance': 'abundance.tsv',
#             'h5': 'abundance.h5',
#             'run_info': 'run_info.json'
#         }
#         return {k: S3Target('{}/{}/kallisto/{}'.format(settings.get_target_bucket(), self.sample_folder, fname))
#                 for k, fname in output_files.items()}


from luigi.contrib.s3 import S3Target
from ob_pipelines.config import settings
from ob_pipelines.pipelines.rnaseq.tasks.bam_to_fastq import BamToFastQ
from ob_pipelines.pipelines.rnaseq.tasks.kallisto import Kallisto



class KallistoSpliced(Kallisto):

    def requires(self):
        return BamToFastQ(sample_id=self.sample_id)

    def output(self):
        output_files = {
            'abundance': 'abundance.tsv',
            'h5': 'abundance.h5',

# Path: ob_pipelines/config.py
# AWS_PROFILE = os.environ.get('AWS_PROFILE', 'default')
# CONFIG_FILE = op.join(op.dirname(op.dirname(ob_pipelines.__file__)), 'config.yaml')
# class ConfigManager:
#     def __init__(self, config):
#     def get(self, option, default=None):
#     def get_source_bucket(self):
#     def get_target_bucket(self):
# 
# Path: ob_pipelines/pipelines/rnaseq/tasks/bam_to_fastq.py
# class BamToFastQ(BatchTask, LoggingTaskWrapper, Sample):
#     job_definition = 'bam2fastq'
# 
#     @property
#     def parameters(self):
#         return {
#             'input': self.input().path,
#             'fq1': self.output()['fq1'].path,
#             'fq2': self.output()['fq2'].path,
#         }
# 
#     def requires(self):
#         return FilterSpliced(sample_id=self.sample_id)
# 
#     def output(self):
#         s3_prefix = '{}/{}/filtered/{}'.format(
#             settings.get_target_bucket(), self.sample_folder, self.sample_id)
#         s3_paths = [
#             s3_prefix + '_1.fq.gz',
#             s3_prefix + '_2.fq.gz',
#         ]
#         return [S3Target(path) for path in s3_paths]
# 
# Path: ob_pipelines/pipelines/rnaseq/tasks/kallisto.py
# class Kallisto(BatchTask, LoggingTaskWrapper, Sample):
#     job_definition = 'kallisto'
# 
#     @property
#     def parameters(self):
#         fq1, fq2 = self.input()
#         return {
#             'threads': '20',
#             'index': get_index('kallisto'),
#             'reads1': fq1.path,
#             'reads2': fq2.path,
#             'strand_flag': '--rf-stranded',
#             'output': op.dirname(self.output()['abundance'].path) + '/'
#         }
# 
#     def requires(self):
#         return SampleFastQ(sample_id=self.sample_id)
# 
#     def output(self):
#         output_files = {
#             'abundance': 'abundance.tsv',
#             'h5': 'abundance.h5',
#             'run_info': 'run_info.json'
#         }
#         return {k: S3Target('{}/{}/kallisto/{}'.format(settings.get_target_bucket(), self.sample_folder, fname))
#                 for k, fname in output_files.items()}


# Path: ob_pipelines/pipelines/rnaseq/tasks/kallisto_spliced.py
from luigi.contrib.s3 import S3Target
from ob_pipelines.config import settings
from ob_pipelines.pipelines.rnaseq.tasks.bam_to_fastq import BamToFastQ
from ob_pipelines.pipelines.rnaseq.tasks.kallisto import Kallisto




class KallistoSpliced(Kallisto):

    def requires(self):
        return BamToFastQ(sample_id=self.sample_id)

    def output(self):
        output_files = {
            'abundance': 'abundance.tsv',
            'h5': 'abundance.h5',

            'run_info': 'run_info.json'