def create_interfaces(args, logger):
    """Check third-party executable dependencies exist and instantiate.

    The instantiated interfaces are returned.
    """
    # Check for presence of third-party tools, by instantiating interfaces
    logger.info("Checking third-party packages:")
    logger.info("\tFastQC... (%s)", args.fastqc)
    fastqc_qc = fastqc.FastQC(args.fastqc)
    logger.info("\ttrim_quality... (%s)", args.trim_quality)
    trim_quality = seq_crumbs.Trim_Quality(args.trim_quality, logger)
    logger.info("\tjoin_paired_ends.py... (%s)", args.join_paired_ends)
    jpe = qiime.Join_Paired_Ends(args.join_paired_ends, logger)
    logger.info("\tconvert_format... (%s)", args.convert_format)
    convert_format = seq_crumbs.Convert_Format(args.convert_format, logger)
    logger.info("\tblastclust... (%s)", args.blastclust)
    blastclust = blast.Blastclust(args.blastclust)
    logger.info("\tmuscle... (%s)", args.muscle)
    muscle_aln = muscle.Muscle(args.muscle)
    logger.info("\tpick_otus.py... (%s)", args.pick_otus)
    pick_otus = qiime.Pick_Otus(args.pick_otus, logger)
    logger.info("\tpick_closed_reference_otus.py... (%s)",
                args.pick_closed_reference_otus)
    pcro = qiime.Pick_Closed_Ref_Otus(args.pick_closed_reference_otus, logger)
    return (fastqc_qc, trim_quality, jpe, convert_format, blastclust,
            muscle_aln, pick_otus, pcro)
def test_fastqc_cmd():
    """fastqc instantiates, runs and returns correct form of cmd-line"""
    obj = fastqc.FastQC("fastqc")
    target = ' '.join(["fastqc", READS1, "-o", OUTDIR])
    qc = obj.run(READS1, OUTDIR)
    assert_equal(qc.command,
                 target)
def test_fastqc_notexec():
    """Error thrown if fastqc exe not executable"""
    try:
        obj = fastqc.FastQC("LICENSE")
    except NotExecutableError:
        return True
    else:
        return False
def test_fastqc_exec_notexist():
    """Error thrown if fastqc executable does not exist"""
    try:
        obj = fastqc.FastQC(os.path.join(".", "fastqc"))
    except NotExecutableError:
        return True
    else:
        return False
Example #5
0
        os.path.join(args.indirname, fname)
        for fname in os.listdir(args.indirname)
        if fname.startswith(args.prefix)
    ])
    logger.info("Input files: %s" % infilenames)
    for fname in infilenames:
        if ' ' in os.path.relpath(fname):
            logger.error("Relative path to file or directory " +
                         "'%s' contains whitespace" % fname)
            logger.error("(exiting)")
            sys.exit(1)

    # Check for presence of third-party tools, by instantiating interfaces
    logger.info("Checking third-party packages:")
    logger.info("\tFastQC... (%s)" % args.fastqc)
    fastQC = fastqc.FastQC(args.fastqc, logger)
    logger.info("\ttrim_quality... (%s)" % args.trim_quality)
    trim_quality = seq_crumbs.Trim_Quality(args.trim_quality, logger)
    logger.info("\tjoin_paired_ends.py... (%s)" % args.join_paired_ends)
    jpe = qiime.Join_Paired_Ends(args.join_paired_ends, logger)
    logger.info("\tconvert_format... (%s)" % args.convert_format)
    convert_format = seq_crumbs.Convert_Format(args.convert_format, logger)
    logger.info("\tblastclust... (%s)" % args.blastclust)
    blastclust = blast.Blastclust(args.blastclust)
    logger.info("\tmuscle... (%s)" % args.muscle)
    muscle = muscle.Muscle(args.muscle, logger)
    logger.info("\tpick_otus.py... (%s)" % args.pick_otus)
    pick_otus = qiime.Pick_Otus(args.pick_otus, logger)
    logger.info("\tpick_closed_reference_otus.py... (%s)" %
                args.pick_closed_reference_otus)
    pcro = qiime.Pick_Closed_Ref_Otus(args.pick_closed_reference_otus, logger)
def test_fastqc():
    """fastqc instantiates with cmd-line if fastqc is in $PATH"""
    fastqc.FastQC("fastqc")