Ejemplo n.º 1
0
def main(argv):
    # set recommended java heap settings
    os.environ['NXF_OPTS'] = '-Xms1g -Xmx4g'

    args, unknown = parse(argv)

    logfile = os.path.join(args.tracedir[0], args.logfile[0])
    profile = ','.join(args.profile)
    script = args.script[0] if not args.revision else args.script[0] + " -r %s" % args.revision[0]

    reportdir = args.tracedir[0]
    utils.create_report_dir(reportdir)

    reads = args.reads[0]

    command = "nextflow -log %s run %s " % (logfile, script)
    command += "-profile %s --genome %s --tracedir %s " % ( profile, args.genome[0], reportdir)
    # Check for glob files and reads in awsbatch
    if (reads.startswith('s3://')):
        print("Replacing --reads by readPaths")
        s3bucket, globPattern = os.path.split(reads)
        readPathsConfig = convertToReadPathsConfig(filesGlob=globPattern, bucket=s3bucket)
        command += "-c %s " % readPathsConfig
    else:
        command += "--reads %s " % reads

    command += ' '.join(unknown)
    run(command=command, script=script, tracedir=reportdir, dryrun=args.dryrun)
Ejemplo n.º 2
0
def main(argv):
    args = parse(argv)

    aws_queue = args.awsqueue
    out_dir = args.outDir
    work = args.work
    script = args.script_location
    nextflow_args = args.nextflow_args if args.nextflow_args else ''
    local_report_dir = args.localReportDir
    logfile = args.logfile
    dry_run = args.dryrun
    resume = '-resume' if args.resume else ''
    profile = ','.join(args.profile)
    genome = args.genome
    genome_base = args.genome_base

    # locate the logfile in the localReportDir
    logfile = os.path.join(local_report_dir, logfile)

    utils.create_report_dir(local_report_dir)

    run_multiqc(aws_queue=aws_queue,
                profile=profile,
                out_dir=out_dir,
                work_dir=work,
                script=script,
                resume=resume,
                nextflow_args=nextflow_args,
                local_report_dir=local_report_dir,
                logfile=logfile,
                genome=genome,
                genome_base=genome_base,
                dry_run=dry_run)
Ejemplo n.º 3
0
def main(argv):
    args = parse(argv)

    aws_queue = args.awsqueue
    out_base = args.outDir
    work_base = args.work
    script = args.script_location
    genome = args.genome
    genome_base = args.genome_base
    nextflow_args = args.nextflow_args if args.nextflow_args else ''
    tools = args.tools
    local_report_dir = args.localReportDir
    logfile = args.logfile
    dry_run = args.dryrun
    resume = '-resume' if args.resume else ''
    samples = args.samples

    # locate the logfile in the localReportDir
    logfile = os.path.join(local_report_dir, logfile)

    utils.create_report_dir(local_report_dir)

    # if only one sample.tsv given don't change work/out dir
    if len(samples) > 1 and type(samples) == list:
        for sample in samples:
            # create a work and output folder path for each sample
            sample_id = utils.get_simple_basename(sample)
            out_dir = os.path.join(out_base, sample_id)
            work = os.path.join(work_base, sample_id)

            run_sample(tsv_file=sample, aws_queue=aws_queue, tools=tools, out_dir=out_dir, work=work, script=script,
                       genome=genome, genome_base=genome_base, resume=resume, nextflow_args=nextflow_args,
                       local_report_dir=local_report_dir, dry_run=dry_run, logfile=logfile)
    elif len(samples) == 1 and type(samples) == list:

        sample = samples[0]
        out_dir = out_base
        work = work_base

        run_sample(tsv_file=sample, aws_queue=aws_queue, tools=tools, out_dir=out_dir, work=work, script=script,
                   genome=genome, genome_base=genome_base, resume=resume, nextflow_args=nextflow_args,
                   local_report_dir=local_report_dir, logfile=logfile, dry_run=dry_run)
    else:
        sys.stderr.write('Found %i samples. Could not resolve sample: \'%s\'' % (samples, len(samples)))
        sys.exit(1)
Ejemplo n.º 4
0
def main(argv):
    args = parse(argv)

    aws_queue = args.awsqueue
    out_dir = args.outDir
    work = args.work
    script = args.script_location
    genome = args.genome
    genome_base = args.genome_base
    nextflow_args = args.nextflow_args if args.nextflow_args else ''
    annotate_tools = '--annotateTools %s' % args.annotateTools if args.annotateTools else ''
    tools = args.tools
    local_report_dir = args.localReportDir
    logfile = args.logfile
    dry_run = args.dryrun
    resume = '-resume' if args.resume else ''
    profile = ','.join(args.profile)

    # locate the logfile in the localReportDir
    logfile = os.path.join(local_report_dir, logfile)

    utils.create_report_dir(local_report_dir)
    try:
        annotate_sample(aws_queue=aws_queue,
                        profile=profile,
                        annotate_tools=annotate_tools,
                        tools=tools,
                        out_dir=out_dir,
                        work=work,
                        script=script,
                        genome=genome,
                        genome_base=genome_base,
                        resume=resume,
                        nextflow_args=nextflow_args,
                        local_report_dir=local_report_dir,
                        logfile=logfile,
                        dry_run=dry_run)
    except RuntimeError as err:
        raise err