Пример #1
0
    def run(self, config, config_file, parallel, dirs, samples):
        with prun.start(_wres(parallel, ["picard"]),
                        samples, config, dirs, "trimming") as run_parallel:
            samples = run_parallel("process_lane", samples)
            samples = run_parallel("trim_lane", samples)
        with prun.start(_wres(parallel, ["aligner"],
                              ensure_mem={"tophat": 8, "tophat2": 8, "star": 30}),
                        samples, config, dirs, "multicore",
                        multiplier=alignprep.parallel_multiplier(samples)) as run_parallel:
            samples = disambiguate.split(samples)
            samples = run_parallel("process_alignment", samples)
            samples = disambiguate.resolve(samples, run_parallel)

        with prun.start(_wres(parallel, ["samtools", "cufflinks"]),
                        samples, config, dirs, "rnaseqcount") as run_parallel:
            samples = rnaseq.estimate_expression(samples, run_parallel)
            #samples = rnaseq.detect_fusion(samples, run_parallel)

        combined = combine_count_files([x[0].get("count_file") for x in samples])
        gtf_file = utils.get_in(samples[0][0], ('genome_resources', 'rnaseq',
                                                'transcripts'), None)
        annotated = annotate_combined_count_file(combined, gtf_file)
        for x in samples:
            x[0]["combined_counts"] = combined
            if annotated:
                x[0]["annotated_combined_counts"] = annotated

        with prun.start(_wres(parallel, ["picard", "fastqc", "rnaseqc"]),
                        samples, config, dirs, "persample") as run_parallel:
            samples = qcsummary.generate_parallel(samples, run_parallel)
        return samples
Пример #2
0
    def run(self, config, config_file, parallel, dirs, samples):
        with prun.start(parallel, samples, config, dirs, "trimming") as run_parallel:
            samples = run_parallel("trim_lane", samples)
        with prun.start(
            _wprogs(parallel, ["aligner"], {"tophat": 8, "tophat2": 8, "star": 30}),
            samples,
            config,
            dirs,
            "multicore",
            multiplier=alignprep.parallel_multiplier(samples),
        ) as run_parallel:
            samples = disambiguate.split(samples)
            samples = run_parallel("process_alignment", samples)
            samples = disambiguate.resolve(samples, run_parallel)

        with prun.start(
            _wprogs(parallel, ["samtools", "gatk", "cufflinks"]), samples, config, dirs, "rnaseqcount"
        ) as run_parallel:
            samples = rnaseq.estimate_expression(samples, run_parallel)
            # samples = rnaseq.detect_fusion(samples, run_parallel)

        combined = combine_count_files([x[0].get("count_file") for x in samples])
        organism = utils.get_in(samples[0][0], ("genome_resources", "aliases", "ensembl"), None)
        annotated = annotate_combined_count_file(combined, organism)
        for x in samples:
            x[0]["combined_counts"] = combined
            x[0]["annotated_combined_counts"] = annotated

        with prun.start(
            _wprogs(parallel, ["picard", "fastqc", "rnaseqc"]), samples, config, dirs, "persample"
        ) as run_parallel:
            samples = qcsummary.generate_parallel(samples, run_parallel)
        return samples
Пример #3
0
    def run(self, config, config_file, parallel, dirs, samples):
        with prun.start(_wres(parallel, ["picard", "AlienTrimmer"]),
                        samples, config, dirs, "trimming") as run_parallel:
            with profile.report("adapter trimming", dirs):
                samples = run_parallel("prepare_sample", samples)
                samples = run_parallel("trim_sample", samples)
        with prun.start(_wres(parallel, ["aligner", "picard"],
                              ensure_mem={"tophat": 8, "tophat2": 8, "star": 40}),
                        samples, config, dirs, "multicore",
                        multiplier=alignprep.parallel_multiplier(samples)) as run_parallel:
            with profile.report("alignment", dirs):
                samples = disambiguate.split(samples)
                samples = run_parallel("process_alignment", samples)
        with prun.start(_wres(parallel, ["samtools", "cufflinks"]),
                        samples, config, dirs, "rnaseqcount") as run_parallel:
            with profile.report("disambiguation", dirs):
                samples = disambiguate.resolve(samples, run_parallel)
            with profile.report("transcript assembly", dirs):
                samples = rnaseq.assemble_transcripts(run_parallel, samples)
            with profile.report("estimate expression", dirs):
                samples = rnaseq.estimate_expression(samples, run_parallel)

        with prun.start(_wres(parallel, ["picard", "fastqc", "rnaseqc","kraken"]),
                        samples, config, dirs, "persample") as run_parallel:
            with profile.report("quality control", dirs):
                samples = qcsummary.generate_parallel(samples, run_parallel)
        
        logger.info("Timing: finished")
        return samples
Пример #4
0
 def run(self, config, run_info_yaml, parallel, dirs, samples):
     with prun.start(_wres(parallel, ["aligner"],
                           ensure_mem={"tophat": 8, "tophat2": 8, "star": 2}),
                     [samples[0]], config, dirs, "organize_samples") as run_parallel:
         with profile.report("organize samples", dirs):
             samples = run_parallel("organize_samples", [[dirs, config, run_info_yaml,
                                                          [x[0]["description"] for x in samples]]])
     with prun.start(_wres(parallel, ["picard", "cutadapt"]),
                     samples, config, dirs, "trimming") as run_parallel:
         with profile.report("adapter trimming", dirs):
             samples = run_parallel("prepare_sample", samples)
             samples = run_parallel("trim_sample", samples)
     with prun.start(_wres(parallel, ["aligner", "picard"],
                           ensure_mem={"tophat": 8, "tophat2": 8, "star": 2}),
                     samples, config, dirs, "alignment",
                     multiplier=alignprep.parallel_multiplier(samples)) as run_parallel:
         with profile.report("alignment", dirs):
             samples = disambiguate.split(samples)
             samples = run_parallel("process_alignment", samples)
     with prun.start(_wres(parallel, ["samtools", "cufflinks"]),
                     samples, config, dirs, "rnaseqcount") as run_parallel:
         with profile.report("disambiguation", dirs):
             samples = disambiguate.resolve(samples, run_parallel)
         with profile.report("transcript assembly", dirs):
             samples = rnaseq.assemble_transcripts(run_parallel, samples)
         with profile.report("estimate expression", dirs):
             samples = rnaseq.estimate_expression(samples, run_parallel)
     with prun.start(_wres(parallel, ["picard", "fastqc", "rnaseqc", "kraken"]),
                     samples, config, dirs, "qc") as run_parallel:
         with profile.report("quality control", dirs):
             samples = qcsummary.generate_parallel(samples, run_parallel)
     logger.info("Timing: finished")
     return samples
Пример #5
0
 def run(self, config, run_info_yaml, parallel, dirs, samples):
     with prun.start(_wres(parallel, ["aligner"],
                           ensure_mem={"tophat": 8, "tophat2": 8, "star": 2}),
                     [samples[0]], config, dirs, "organize_samples") as run_parallel:
         with profile.report("organize samples", dirs):
             samples = run_parallel("organize_samples", [[dirs, config, run_info_yaml,
                                                          [x[0]["description"] for x in samples]]])
     with prun.start(_wres(parallel, ["picard", "cutadapt"]),
                     samples, config, dirs, "trimming") as run_parallel:
         with profile.report("adapter trimming", dirs):
             samples = run_parallel("prepare_sample", samples)
             samples = run_parallel("trim_sample", samples)
     with prun.start(_wres(parallel, ["aligner", "picard"],
                           ensure_mem={"tophat": 8, "tophat2": 8, "star": 2}),
                     samples, config, dirs, "alignment",
                     multiplier=alignprep.parallel_multiplier(samples)) as run_parallel:
         with profile.report("alignment", dirs):
             samples = run_parallel("disambiguate_split", [samples])
             samples = run_parallel("process_alignment", samples)
     with prun.start(_wres(parallel, ["samtools", "cufflinks"]),
                     samples, config, dirs, "rnaseqcount") as run_parallel:
         with profile.report("disambiguation", dirs):
             samples = disambiguate.resolve(samples, run_parallel)
         with profile.report("transcript assembly", dirs):
             samples = rnaseq.assemble_transcripts(run_parallel, samples)
         with profile.report("estimate expression", dirs):
             samples = rnaseq.estimate_expression(samples, run_parallel)
     with prun.start(_wres(parallel, ["picard", "fastqc", "rnaseqc", "kraken"]),
                     samples, config, dirs, "qc") as run_parallel:
         with profile.report("quality control", dirs):
             samples = qcsummary.generate_parallel(samples, run_parallel)
     logger.info("Timing: finished")
     return samples
Пример #6
0
    def run(self, config, config_file, run_parallel, parallel, dirs, lane_items):
        lane_items = run_parallel("trim_lane", lane_items)
        samples = disambiguate.split(lane_items)
        samples = run_parallel("process_alignment", samples)
        samples = disambiguate.resolve(samples, run_parallel)
        samples = rnaseq.estimate_expression(samples, run_parallel)
        combined = combine_count_files([x[0].get("count_file") for x in samples])
        for x in samples:
            x[0]["combined_counts"] = combined

        samples = qcsummary.generate_parallel(samples, run_parallel)
        #run_parallel("generate_bigwig", samples, {"programs": ["ucsc_bigwig"]})
        return samples
Пример #7
0
    def run(self, config, config_file, parallel, dirs, samples):
        with prun.start(_wres(parallel, ["picard", "AlienTrimmer"]), samples,
                        config, dirs, "trimming") as run_parallel:
            with profile.report("adapter trimming", dirs):
                samples = run_parallel("process_lane", samples)
                samples = run_parallel("trim_lane", samples)
        with prun.start(_wres(parallel, ["aligner", "picard"],
                              ensure_mem={
                                  "tophat": 8,
                                  "tophat2": 8,
                                  "star": 40
                              }),
                        samples,
                        config,
                        dirs,
                        "multicore",
                        multiplier=alignprep.parallel_multiplier(
                            samples)) as run_parallel:
            with profile.report("alignment", dirs):
                samples = disambiguate.split(samples)
                samples = run_parallel("process_alignment", samples)

        with prun.start(_wres(parallel, ["samtools", "cufflinks"]), samples,
                        config, dirs, "rnaseqcount") as run_parallel:
            with profile.report("disambiguation", dirs):
                samples = disambiguate.resolve(samples, run_parallel)
            with profile.report("estimate expression", dirs):
                samples = rnaseq.estimate_expression(samples, run_parallel)

        combined = combine_count_files(
            [x[0].get("count_file") for x in samples])
        gtf_file = utils.get_in(samples[0][0],
                                ('genome_resources', 'rnaseq', 'transcripts'),
                                None)
        annotated = annotate_combined_count_file(combined, gtf_file)
        for x in samples:
            x[0]["combined_counts"] = combined
            if annotated:
                x[0]["annotated_combined_counts"] = annotated

        with prun.start(_wres(parallel, ["picard", "fastqc", "rnaseqc"]),
                        samples, config, dirs, "persample") as run_parallel:
            with profile.report("quality control", dirs):
                samples = qcsummary.generate_parallel(samples, run_parallel)
        logger.info("Timing: finished")
        return samples
Пример #8
0
    def run(self, config, config_file, run_parallel, parallel, dirs, lane_items):
        lane_items = run_parallel("trim_lane", lane_items)
        samples = disambiguate.split(lane_items)
        samples = run_parallel("process_alignment", samples)
        samples = disambiguate.resolve(samples, run_parallel)
        samples = rnaseq.estimate_expression(samples, run_parallel)
        #samples = rnaseq.detect_fusion(samples, run_parallel)
        combined = combine_count_files([x[0].get("count_file") for x in samples])
        organism = utils.get_in(samples[0][0], ('genome_resources', 'aliases',
                                                'ensembl'), None)
        annotated = annotate_combined_count_file(combined, organism)
        for x in samples:
            x[0]["combined_counts"] = combined
            x[0]["annotated_combined_counts"] = annotated

        samples = qcsummary.generate_parallel(samples, run_parallel)
        #run_parallel("generate_bigwig", samples, {"programs": ["ucsc_bigwig"]})
        return samples