def create_outfiles(options):
    ''' creates all parent directories given in the output prefix and returns the resulting file paths for the summary, plot and rdata file '''

    wutils.make_parent_dirs(options.outPrefix)
    # summary file, plot file, data file
    return (options.outPrefix + '.txt', options.outPrefix + '.pdf',
            options.outPrefix + '.Rdata')
def get_and_create_outfiles(cmdl_options):
    ''' 
    creates all parent folders for writing the output
    '''

    wutils.make_parent_dirs(cmdl_options.outPrefix)
    if (cmdl_options.outCirc is not None):
        wutils.make_parent_dirs(cmdl_options.outCirc)
def copy_file(source_path, target_path):
    ''' copies file of 'source_path' to 'target_path' (folder and filename) '''

    # check if file to copy really exists
    if (os.path.exists(source_path) and os.path.isfile(source_path)):
        # create directory of the target location
        wutils.make_parent_dirs(target_path)
        # copy file
        shutil.copy(source_path, target_path)
def create_outfiles(options):
    ''' creates parent directories and full filenames for the given file name prefix'''
    
    # create parent directories
    wutils.make_parent_dirs(options.outPrefix)
    
    # full output paths
    bedgraph_file = options.outPrefix+'.bedgraph'
    tdf_file = options.outPrefix+'.bedgraph.tdf'
    
    return bedgraph_file, tdf_file
def create_outfiles(options):
    ''' creates all parent folders for the output files if they do not exist'''
    
    wutils.make_parent_dirs(options.out1)
    wutils.make_parent_dirs(options.sam)
    if(options.out2 is not None):
        wutils.make_parent_dirs(options.out2)
def main():
    ''' main method for calling removeLinearReads from commandline '''
    
    print('Program call:')
    print(' '.join(sys.argv))
    
    _,o = get_command_line_options()
    wutils.make_parent_dirs(o.circOut)
    
    t_start = wutils.get_current_time()
    print(t_start[1]+'Start Removal of Linearly Mappable Reads')
    
    algo.remove_linearly_mappable_reads(o.circRNAPrediction, o.mapping, o.circOut, o.minReads, o.paired)
    
    t_end = wutils.get_current_time()
    print(t_end[1]+'Finished. Check out the results in '+o.circOut)
    
    wutils.print_resources(t_end[0]-t_start[0], child_processes=False)
    
    if(o.returnFilePath is not None):
        returnVars = [('filteredCircs', o.circOut)]
        wutils.write_watchdog_return_file(o.returnFilePath, returnVars)
Ejemplo n.º 7
0
def get_and_create_outfiles(cmdl_options):
    ''' creates all parent folders for writing the output '''
    wutils.make_parent_dirs(cmdl_options.countTable)
    # parent directories for optional plots
    if (cmdl_options.countPlot is not None):
        wutils.make_parent_dirs(cmdl_options.countPlot)
    if (cmdl_options.groupPlot is not None):
        wutils.make_parent_dirs(cmdl_options.groupPlot)
Ejemplo n.º 8
0
def get_and_create_outfiles(parser, cmdl_options):
    ''' check output options and create output files '''

    outfiles = ['', '', '']

    # 3 separate paths for output file
    if (cmdl_options.outPrefix is None):
        for pos, (oname, option) in enumerate([
            ('outReads1', cmdl_options.outReads1),
            ('outReads2', cmdl_options.outReads2),
            ('outSingletons', cmdl_options.outSingletons)
        ]):
            # check if option is used
            if (option is None):
                parser.error('Missing argument: outPrefix or ' + oname +
                             ' option is required!')
            outfiles[pos] = option

    # 1 shared prefix for the output
    else:
        for pos, (oname, option) in enumerate([
            ('outReads1', cmdl_options.outReads1),
            ('outReads2', cmdl_options.outReads2),
            ('outSingletons', cmdl_options.outSingletons)
        ]):
            if (option is not None):
                parser.error('Argument clash: use only outPrefix or ' + oname +
                             '!')
        outfiles[0] = cmdl_options.outPrefix + '1.fastq'
        outfiles[1] = cmdl_options.outPrefix + '2.fastq'
        outfiles[2] = cmdl_options.outPrefix + 'singleton.fastq'

    # make parent folders for every outfile
    for ofile in outfiles:
        wutils.make_parent_dirs(ofile)

    return outfiles
Ejemplo n.º 9
0
def create_output_dirs(options):
    ''' create all directories for writing the combined circRNA predictions'''

    wutils.make_parent_dirs(options.outUnion)
    wutils.make_parent_dirs(options.outIntersection)
    wutils.make_parent_dirs(options.outIntersectedUnion)
def create_outfiles(options):
    ''' create all parent directories of the sam file with the aligned reads '''

    wutils.make_parent_dirs(options.outSam)
Ejemplo n.º 11
0
def create_outfiles(options):
    ''' creates all parent directories of the resulting bed file that do not exist '''

    wutils.make_parent_dirs(options.outBed)
Ejemplo n.º 12
0
def create_outfiles(options):
    ''' create all parent directories of the sai file with the output of bwa aln '''

    wutils.make_parent_dirs(options.outSai)
Ejemplo n.º 13
0
def create_outfiles(options):
    ''' create all parent directories of the resulting bigwig file '''

    wutils.make_parent_dirs(options.outBw)
Ejemplo n.º 14
0
def create_outfiles(options):
    ''' create all parent directories of the sam/bam file with the remaining reads '''

    wutils.make_parent_dirs(options.outSamBam)
Ejemplo n.º 15
0
def create_output_dirs(cmdl_options):
    ''' create parent directories of concatenated output file '''

    wutils.make_parent_dirs(cmdl_options.outFile)
Ejemplo n.º 16
0
def get_and_create_outfiles(cmdl_options):
    ''' 
    creates all parent folders for writing the output
    '''

    wutils.make_parent_dirs(join(cmdl_options.outdir, ''))