)
    cmd += 'cd {mount}/input; '.format(mount=mount)
    cmd += 'bwa mem -t {cores} {reference} {fastq} > {mount}/{output}; '.format(
        cores=cores,
        reference=os.path.basename(reference),
        fastq=' '.join([mount + '/input/' + os.path.basename(f) for f in fastq]),
        mount=mount,
        output='output/aligned.sam'
    )

    # Add any extra flags if they are passed
    if extra_command_flags:
        cmd += ' {}'.format(extra_command_flags)
    p.command = cmd

    # Build the BWA pipeline configuration
    p.build()

    # ===================================================
    #  Execute the pipeline
    # ---------------------------------------------------
    operation = p.run()

    # Printout the response to SDTOUT
    sys.stdout.write('Pipeline Response:\n')
    sys.stdout.write(json.dumps(operation, indent=4, sort_keys=True))
    sys.stdout.write('\n')

if __name__ == "__main__":
    main()
Example #2
0
                logging.warning('Sample {} has no coverage for target {}.'.format(subject['sample'], targetCol))
    if errors > 0:
        sys.exit(1)

    # Compute the logistic normal hyperparameters.
    # Omit the non-target columns.
    mu, covariance = hln_EM(coverage_df[targetCols].values.astype(float), max_iterations=max_iterations,
                            tol=tol, fit_diag_only=fit_diag_only)

    # Pickle the intervals, hyperparameters and CoverageMatrix arguments into the outputFile.
    logging.info('Trained for {} total targets'.format(len(targets)))
    logging.info('Writing intervals plus hyperparameters to file {}.'.format(outputFile))
    targets_params['parameters'] = HLN_Parameters(targets, mu, covariance)

    with open(outputFile, 'w') as f:
        cPickle.dump(targets_params, f, protocol=cPickle.HIGHEST_PROTOCOL)

@command('create-bams')
def create_bams(targetsFile, outputPrefix):
    """Makes simulated data to run the program with, given a target bed file and an output file prefix.

    :param targetsFile: A BED file with targets to simulate coverage for.
    :param outputPrefix: an output file prefix used to name the output bam and fofn file.
    :return:
    """
    SimulateData.make_simulated_data(outputPrefix, targetsFile)


if __name__ == '__main__':
    main()
Example #3
0
def main():
    """Set debug and run mando.main function."""
    if not os.path.exists("debug_tstoolbox"):
        sys.tracebacklimit = 0
    mando.main()
Example #4
0
def main():
    if not os.path.exists('debug_swmmtoolbox'):
        sys.tracebacklimit = 0
    mando.main()
Example #5
0
def main():
    if not os.path.exists('debug_swmmtoolbox'):
        sys.tracebacklimit = 0
    mando.main()
Example #6
0
def main():
    mando.main()
Example #7
0
def main():
    ''' Main function
    '''
    if not os.path.exists('debug_wdmtoolbox'):
        sys.tracebacklimit = 0
    mando.main()
Example #8
0
def main():
    """Main function."""
    if not os.path.exists('debug_wdmtoolbox'):
        sys.tracebacklimit = 0
    mando.main()
Example #9
0
def main():
    if not os.path.exists("debug_hspfbintoolbox"):
        sys.tracebacklimit = 0
    mando.main()
Example #10
0
def main():
    ''' Main '''
    if not os.path.exists('debug_mettoolbox'):
        sys.tracebacklimit = 0
    mando.main()
Example #11
0
def main():
    """Run the main function."""
    if not os.path.exists('debug_wdmtoolbox'):
        sys.tracebacklimit = 0
    mando.main()
Example #12
0
def main():
    """Set debug and run mando.main function."""
    if not os.path.exists('debug_tstoolbox'):
        sys.tracebacklimit = 0
    mando.main()
Example #13
0
def main():
    """Run the main function."""
    if not os.path.exists("debug_wdmtoolbox"):
        sys.tracebacklimit = 0
    mando.main()