Example #1
0
else:
    num = args.cpus
lib.log.debug("Running Augustus on %i chunks, using %i CPUs" %
              (len(scaffolds), num))
lib.runMultiProgress(runAugustus, scaffolds, num)

lib.log.debug("Augustus prediction is finished, now concatenating results")
with open(os.path.join(tmpdir, 'augustus_all.gff3'), 'w') as output:
    for file in scaffolds:
        file = os.path.join(tmpdir, file + '.augustus.gff3')
        with open(file) as input:
            output.write(input.read())

if lib.checkannotations(os.path.join(tmpdir, 'augustus_all.gff3')):
    lib.log.debug('Augustus finished, now joining results')
if lib.which_path('join_aug_pred.pl'):
    join_script = 'join_aug_pred.pl'
else:
    join_script = os.path.join(AUGUSTUS_BASE, 'scripts', 'join_aug_pred.pl')

cmd = '{:} < {:} > {:}'.format(join_script,
                               os.path.join(tmpdir, 'augustus_all.gff3'),
                               args.out)
lib.log.debug(cmd)

with open(args.out, 'w') as finalout:
    with open(os.path.join(tmpdir, 'augustus_all.gff3'), 'r') as infile:
        subprocess.call([join_script], stdin=infile, stdout=finalout)

if not args.debug:
    shutil.rmtree(tmpdir)
Example #2
0
    ipr_properties = os.path.join(tmpdir, 'interproscan.properties')
    downloadIPRproperties(ipr_properties, args.cpus_per_chunk)
    if chunks > 1:
        runMultiProgress(safe_run, file_list, threads, progress=args.progress)
    else:
        runDocker(file_list[0])

elif args.method == 'local':
    if not args.iprscan_path:
        print(
            'You must specify location of interproscan.sh to --iprscan_path, exiting.'
        )
        sys.exit(1)
    else:
        if args.iprscan_path.endswith('interproscan.sh'):
            iprpath = lib.which_path(args.iprscan_path)
        else:
            iprpath = os.path.join(args.iprscan_path, 'interproscan.sh')
    if not os.path.isfile(iprpath):
        print(('%s is not a valid path to interproscan.sh' % iprpath))
        sys.exit(1)
    print(
        'Important: you need to manually configure your interproscan.properties file for embedded workers.'
    )
    print((
        'Will try to launch %i interproscan processes, adjust -c,--cpus for your system'
        % args.cpus))
    if chunks > 1:
        runMultiProgress(safe_run2,
                         file_list,
                         args.cpus,