import argparse import subprocess import time import tempfile from collections import defaultdict from ruffus import * import yaml from ccrngspy.tasks import FastQC from ccrngspy import utils from ccrngspy.pipeline import fastqc_helpers from ccrngspy.pipeline import dummy_helpers logger = utils.make_local_logger("FastQC logging", level="debug", color="green") parser = argparse.ArgumentParser(description="Run fastqc on files.") parser.add_argument("--print_only", dest="print_only", action="store_true", default=False, help="Don't run the pipeline, just print what will be run.") parser.add_argument('--verbose', type=int, default=3, help="Verbosity when using print only mode.") parser.add_argument('--config_file', dest="config_file", type=str, help="A YAML configuration file for pipeline.") parser.add_argument('--sample_file', dest="sample_file", type=str, help="A YAML configuration file for pipeline.")
"""Wrapper for RUM (RNAseq Unified Mapper). Kenny Daily, 2012 """ import subprocess import argparse import os import Task from ccrngspy import utils logger = utils.make_local_logger("RUM logging", level="debug", color="green") class RUMrunner(Task.Task): """Container for RUM tasks. """ _cmd = "RUM_runner.pl" _opt_lookup = dict(output_directory="-o %s", threads="-t %s", casava="--casava") def __init__(self, config_file=None, name=None, input_file_list=None,
import sys import os import argparse import subprocess import time import tempfile from collections import defaultdict from ruffus import * import yaml from ccrngspy.tasks import BFAST from ccrngspy.pipeline import bfast_helpers from ccrngspy import utils logger = utils.make_local_logger("Ruffus BFAST QC Logger", level="debug", color=True) parser = argparse.ArgumentParser(description="Run bfast on files.") parser.add_argument('--config_file', dest="config_file", type=str, help="A YAML configuration file for pipeline.") parser.add_argument('--verbose', type=int, default=3, help="Verbosity when using print only mode.") parser.add_argument('--sample_file', dest="sample_file", type=str, help="A tab separated file about the samples to run.") parser.add_argument("--print_only", dest="print_only", action="store_true", default=False, help="Don't run the pipeline, just print what will be run.")
import sys import os import argparse import subprocess import time import tempfile from collections import defaultdict from ruffus import * import yaml # from ccrngspy.tasks import BFAST # from ccrngspy.pipeline import bfast_helpers from ccrngspy import utils logger = utils.make_local_logger("Ruffus Breakdancer QC Logger", level="debug", color=True) parser = argparse.ArgumentParser(description="Run breakdancer on BAM files.") parser.add_argument('--config_file', dest="config_file", type=str, help="A YAML configuration file for pipeline.") parser.add_argument('--verbose', type=int, default=3, help="Verbosity when using print only mode.") parser.add_argument('--sample_file', dest="sample_file", type=str, help="A tab separated file about the samples to run.") parser.add_argument("--print_only", dest="print_only", action="store_true", default=False, help="Don't run the pipeline, just print what will be run.")
"""Helper files for pipeline fastqc steps. """ import os import csv from ccrngspy import utils logger = utils.make_local_logger("Picard helper logging", level="debug", color="green") def make_picard_param_list(samples, config, params=None): """Helper function to turn the sample file into a list of files. Needs to be a list of [[input1, input2], output, params]; for the fastqc script. The output is a log file (a sentinel that can be used to check completion), while the params are taken from the global opts variable (and possibly from the YAML config file). """ final_list = [] rum_dir = config['rum_params']['output_dir'] log_dir = config['general_params']['log_file_dir'] for sample in samples: tmp = [os.path.join(fastq_dir, sample['samplename', RUM.sorted.sam]), os.path.join(fastq_dir, sample['samplename', RUM.sam]), os.path.join(log_dir, "%s.picard.LOG" % sample['samplename']), params]
import sys import os import argparse import subprocess from ruffus import * import yaml from ccrngspy.tasks import FastQC from ccrngspy.tasks import Picard from ccrngspy.tasks import RUM from ccrngspy.pipeline import fastqc_helpers from ccrngspy.pipeline import rum_helpers from ccrngspy import utils logger = utils.make_local_logger("Ruffus RNASeq QC Logger", level="debug", color=True) parser = argparse.ArgumentParser(description="Run fastqc on files.") parser.add_argument("--print_only", dest="print_only", action="store_true", default=False, help="Don't run the pipeline, just print what will be run.") parser.add_argument("--no_log_dir", dest="no_create_log_dir", action="store_true", default=False, help="Don't recreate the output log dir.") parser.add_argument("--no_output_dir", dest="no_create_output_dir", action="store_true", default=False, help="Don't recreate the output dirs.") parser.add_argument('--config_file', dest="config_file", type=str, help="A YAML configuration file for pipeline.")
"""Helper files for pipeline fastqc steps. """ import os from ccrngspy import utils logger = utils.make_local_logger("FastQC helper logging", level="debug", color="green") def make_fastqc_param_list(samples, config, params=None): """Helper function to turn the sample file into a list of files. Needs to be a list of [input, output, params]; for the fastqc script. The output is a log file (a sentinel that can be used to check completion), while the params are taken from the global opts variable (and possibly from the YAML config file). """ final_list = [] fastq_dir = config['general_params']['fastq_input_dir'] output_dir = config['fastqc_params']['output_dir'] for sample in samples: params = dict(sample=sample['samplename']) tmp1 = [os.path.join(fastq_dir, sample['filename1']), os.path.join(output_dir, "%s_fastqc.zip" % sample['sample1']),
"""Helper files for pipeline bowtie steps. """ import os from ccrngspy import utils logger = utils.make_local_logger("Bowtie helper logging", level="debug", color="green") def make_bowtie_param_list(samples, config, params=None): """Helper function to turn the sample file into a list of files. Needs to be a list of [[input1, input2], output, params]; for the fastqc script. The output is the file bowtie2.sam. while the params are taken from the global opts variable (and possibly from the YAML config file). """ final_list = [] fastq_dir = config['general_params']['fastq_input_dir'] log_dir = config['general_params']['log_file_dir'] bowtie_dir = config['bowtie_params']['output_dir'] for sample in samples: params = dict(sample=sample['samplename'])
import sys import os import argparse import subprocess import time from ruffus import * import yaml from ccrngspy.tasks import Picard from ccrngspy.tasks import RUM from ccrngspy.pipeline import rum_helpers from ccrngspy.pipeline import picard_helpers from ccrngspy import utils logger = utils.make_local_logger("Ruffus RNASeq RUM2 QC Logger", level="debug", color=True) parser = argparse.ArgumentParser(description="Run RUM2 pipeline.") parser.add_argument('--config_file', dest="config_file", type=str, help="A YAML configuration file for pipeline.") parser.add_argument('--sample_file', dest="sample_file", type=str, help="A tab separated file about the samples to run.") parser.add_argument("--print_only", dest="print_only", action="store_true", default=False, help="Don't run the pipeline, just print what will be run.") parser.add_argument("--no_output_dir", dest="no_create_output_dir", action="store_true", default=False, help="Don't recreate the output dirs.")
"""Wrapper for Tophat. Kenny Daily, 2012 """ import subprocess import argparse import os import Task from ccrngspy import utils logger = utils.make_local_logger("Tophat logging", level="debug", color="green") class TophatRunner(Task.Task): """Container for Tophat tasks. """ _cmd = "/usr/local/tophat-2.0.4/bin/tophat2" def __init__(self, index=None, mate_file_one=None, mate_file_two=None, output_dir=None, threads=1, other_params=None): self.index = index self.mate_file_one = mate_file_one self.mate_file_two = mate_file_two self.output_dir = output_dir self.threads = threads