예제 #1
0
def main():
    """TODO: Docstring for main.
    :returns: TODO

    """
    args = get_args()

    if args.task == 'inte':
        check_integrity(args.bams, args.tmp)
    if args.task in pipe_tasks:
        run_pipe(args)

    if args.task not in ['post', 'both']:
        return

    jc_it = os.path.join(args.od, 'JC.raw.input.%s.txt')
    jcec_it = os.path.join(args.od, 'JCEC.raw.input.%s.txt')

    python_executable = get_python_executable()
    root_dir = os.path.abspath(os.path.dirname(__file__))

    print('Processing count files.')
    for event_type in ['SE', 'MXE', 'A3SS', 'A5SS', 'RI']:
        process_counts(jc_it % (event_type), args.tstat, 'JC', event_type,
                       args.cstat, args.od, args.out_tmp_sub_dir, args.stat,
                       args.paired_stats, python_executable, root_dir)
        process_counts(jcec_it % (event_type), args.tstat, 'JCEC', event_type,
                       args.cstat, args.od, args.out_tmp_sub_dir, args.stat,
                       args.paired_stats, python_executable, root_dir)

    generate_summary(python_executable, args.od, root_dir)
    print('Done processing count files.')

    return
예제 #2
0
def main():
    """TODO: Docstring for main.
    :returns: TODO

    """
    args = get_args()

    if not os.path.exists(args.od) or not os.path.isdir(args.od):
        os.mkdir(args.od)
    if not os.path.exists(args.tmp) or not os.path.isdir(args.tmp):
        os.mkdir(args.tmp)

    if args.task == 'inte':
        check_integrity(args.bams, args.tmp)
    if args.task in pipe_tasks:
        run_pipe(args)

    if args.task not in ['post', 'both']:
        return

    jc_it = os.path.join(args.od, 'JC.raw.input.%s.txt')
    jcec_it = os.path.join(args.od, 'JCEC.raw.input.%s.txt')

    print('Processing count files.')
    process_counts(jc_it % ('SE'), args.tstat, 'JC', 'SE', args.cstat, args.od,
                   args.tmp, args.stat, args.paired_stats)
    process_counts(jcec_it % ('SE'), args.tstat, 'JCEC', 'SE', args.cstat,
                   args.od, args.tmp, args.stat, args.paired_stats)
    process_counts(jc_it % ('MXE'), args.tstat, 'JC', 'MXE', args.cstat,
                   args.od, args.tmp, args.stat, args.paired_stats)
    process_counts(jcec_it % ('MXE'), args.tstat, 'JCEC', 'MXE', args.cstat,
                   args.od, args.tmp, args.stat, args.paired_stats)
    process_counts(jc_it % ('A3SS'), args.tstat, 'JC', 'A3SS', args.cstat,
                   args.od, args.tmp, args.stat, args.paired_stats)
    process_counts(jcec_it % ('A3SS'), args.tstat, 'JCEC', 'A3SS', args.cstat,
                   args.od, args.tmp, args.stat, args.paired_stats)
    process_counts(jc_it % ('A5SS'), args.tstat, 'JC', 'A5SS', args.cstat,
                   args.od, args.tmp, args.stat, args.paired_stats)
    process_counts(jcec_it % ('A5SS'), args.tstat, 'JCEC', 'A5SS', args.cstat,
                   args.od, args.tmp, args.stat, args.paired_stats)
    process_counts(jc_it % ('RI'), args.tstat, 'JC', 'RI', args.cstat, args.od,
                   args.tmp, args.stat, args.paired_stats)
    process_counts(jcec_it % ('RI'), args.tstat, 'JCEC', 'RI', args.cstat,
                   args.od, args.tmp, args.stat, args.paired_stats)
    print('Done processing count files.')

    return
예제 #3
0
def main():
    """TODO: Docstring for main.
    :returns: TODO

    """
    args = get_args()

    if not os.path.exists(args.od) or not os.path.isdir(args.od):
        os.mkdir(args.od)

    run_pipe(args)

    jc_it = os.path.join(args.od, 'JC.raw.input.%s.txt')
    jcec_it = os.path.join(args.od, 'JCEC.raw.input.%s.txt')

    print 'Running the statistical part.'
    run_stat(jc_it % ('SE'), args.tstat, 'JC', 'SE', args.cstat, args.od,
             args.tmp, args.stat)
    run_stat(jcec_it % ('SE'), args.tstat, 'JCEC', 'SE', args.cstat, args.od,
             args.tmp, args.stat)
    run_stat(jc_it % ('MXE'), args.tstat, 'JC', 'MXE', args.cstat, args.od,
             args.tmp, args.stat)
    run_stat(jcec_it % ('MXE'), args.tstat, 'JCEC', 'MXE', args.cstat, args.od,
             args.tmp, args.stat)
    run_stat(jc_it % ('A3SS'), args.tstat, 'JC', 'A3SS', args.cstat, args.od,
             args.tmp, args.stat)
    run_stat(jcec_it % ('A3SS'), args.tstat, 'JCEC', 'A3SS', args.cstat,
             args.od, args.tmp, args.stat)
    run_stat(jc_it % ('A5SS'), args.tstat, 'JC', 'A5SS', args.cstat, args.od,
             args.tmp, args.stat)
    run_stat(jcec_it % ('A5SS'), args.tstat, 'JCEC', 'A5SS', args.cstat,
             args.od, args.tmp, args.stat)
    run_stat(jc_it % ('RI'), args.tstat, 'JC', 'RI', args.cstat, args.od,
             args.tmp, args.stat)
    run_stat(jcec_it % ('RI'), args.tstat, 'JCEC', 'RI', args.cstat, args.od,
             args.tmp, args.stat)
    print 'The statistical part is done.'

    shutil.rmtree(args.tmp)
    print 'Done.'

    return
예제 #4
0
def main():
    """Takes no arguments.
    Processes arguments supplied when rmats.py was called using get_args().
    If task argument is 'inte', checks BAM and prep file integrity.
    If task argument is 'prep', 'post', or 'both', runs pipeline using seperate module in rmatspipeline.
    If task argument is not valid, returns nothing.
    For each splicing event type, processes counts and outputs files.
    Generates output summary.
    Prints 'Done processing count files.' and returns nothing.
    """
    args = get_args()

    if args.task == 'inte':
        check_integrity(args.bams, args.tmp)
    if args.task in pipe_tasks:
        run_pipe(args)

    if args.task not in ['post', 'both', 'stat']:
        return

    jc_it = os.path.join(args.od, 'JC.raw.input.%s.txt')
    jcec_it = os.path.join(args.od, 'JCEC.raw.input.%s.txt')

    python_executable = get_python_executable()
    # realpath is used here to support the conda install which creates a
    # symlink for rmats.py
    root_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))

    print('Processing count files.')
    for event_type in ['SE', 'MXE', 'A3SS', 'A5SS', 'RI']:
        process_counts(jc_it % (event_type), args.tstat, 'JC', event_type,
                       args.cstat, args.od, args.out_tmp_sub_dir, args.stat,
                       args.paired_stats, python_executable, root_dir)
        process_counts(jcec_it % (event_type), args.tstat, 'JCEC', event_type,
                       args.cstat, args.od, args.out_tmp_sub_dir, args.stat,
                       args.paired_stats, python_executable, root_dir)

    generate_summary(python_executable, args.od, root_dir)
    print('Done processing count files.')

    return