Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
dockerbuild/
sample_data/
.DS_Store
funannotate.egg-info
.idea
6 changes: 3 additions & 3 deletions funannotate/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def MEROPSBlast(input, cpus, evalue, tmpdir, output, diamond=True):
cmd = ['blastp', '-db', blastdb, '-outfmt', '5', '-out', blast_tmp, '-num_threads', str(cpus),
'-max_target_seqs', '1', '-evalue', str(evalue), '-query', input]
if not os.path.isfile(blast_tmp):
lib.runSubprocess4(cmd, '.', lib.log)
lib.runSubprocess(cmd, '.', lib.log, only_failed=True)
# parse results
with open(output, 'w') as out:
with open(blast_tmp, 'r') as results:
Expand Down Expand Up @@ -64,7 +64,7 @@ def SwissProtBlast(input, cpus, evalue, tmpdir, GeneDict, diamond=True):
'-num_threads', str(cpus), '-max_target_seqs', '1',
'-evalue', str(evalue), '-query', input]
if not lib.checkannotations(blast_tmp):
lib.runSubprocess4(cmd, '.', lib.log)
lib.runSubprocess(cmd, '.', lib.log, only_failed=True)
# parse results
counter = 0
total = 0
Expand Down Expand Up @@ -1443,7 +1443,7 @@ def __init__(self, prog):
'--db', mibig_db, '--max-hsps', '1',
'--evalue', '0.001', '--max-target-seqs', '1',
'--outfmt', '6']
lib.runSubprocess4(cmd, '.', lib.log)
lib.runSubprocess(cmd, '.', lib.log, only_failed=True)
# now parse blast results to get {qseqid: hit}
MIBiGBlast = {}
with open(mibig_blast, 'r') as input:
Expand Down
2 changes: 1 addition & 1 deletion funannotate/aux_scripts/augustus_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def runAugustus(Input):
core_cmd.insert(2, '--predictionStart='+str(start))
core_cmd.insert(3, '--predictionEnd='+str(end))
# try using library module
lib.runSubprocess2(core_cmd, '.', lib.log, aug_out)
lib.runSubprocess(core_cmd, '.', lib.log, capture_output=aug_out)


log_name = args.logfile
Expand Down
4 changes: 2 additions & 2 deletions funannotate/aux_scripts/funannotate-p2g.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ def runDiamond(input, query, cpus, output, premade_db=None):
if premade_db is None:
db_cmd = ['diamond', 'makedb', '--threads',
str(cpus), '--in', query, '--db', 'diamond']
lib.runSubprocess4(db_cmd, output, lib.log)
lib.runSubprocess(db_cmd, output, lib.log, only_failed=True)
else:
lib.log.debug('Using premade Diamond database: {}'.format(premade_db))
os.symlink(os.path.abspath(premade_db),
os.path.join(output, 'diamond.dmnd'))
# now run search
lib.runSubprocess4(cmd, output, lib.log)
lib.runSubprocess(cmd, output, lib.log, only_failed=True)


def runtblastn(input, query, cpus, output, maxhits):
Expand Down
2 changes: 1 addition & 1 deletion funannotate/aux_scripts/phobius-multiproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def runPhobiusLocal(Input):
base = base.split('.fa')[0]
OUTPATH = os.path.join(TMPDIR, base+'.phobius')
cmd = ['phobius.pl', '-short', Input]
lib.runSubprocess2(cmd, TMPDIR, lib.log, OUTPATH)
lib.runSubprocess(cmd, TMPDIR, lib.log, capture_output=OUTPATH)


global parentdir
Expand Down
6 changes: 3 additions & 3 deletions funannotate/aux_scripts/trinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def runTrinityGG(genome, readTuple, longReads, shortBAM, output, args=False):
lib.log.info("Building Hisat2 genome index")
cmd = ['hisat2-build', '-p',
str(args.cpus), genome, os.path.join(tmpdir, 'hisat2.genome')]
lib.runSubprocess4(cmd, '.', lib.log)
lib.runSubprocess(cmd, '.', lib.log, only_failed=True)
# align reads using hisat2
lib.log.info("Aligning reads to genome using Hisat2")
# use bash wrapper for samtools piping for SAM -> BAM -> sortedBAM
Expand Down Expand Up @@ -96,7 +96,7 @@ def runTrinityGG(genome, readTuple, longReads, shortBAM, output, args=False):
cmd = cmd + jaccard_clip
if longReads and lib.checkannotations(longReads):
cmd = cmd + ['--long_reads', os.path.realpath(longReads)]
lib.runSubprocess2(cmd, '.', lib.log, TrinityLog)
lib.runSubprocess(cmd, '.', lib.log, capture_output=TrinityLog)
commands = os.path.join(tmpdir, 'trinity_gg', 'trinity_GG.cmds')

# this will create all the Trinity commands, will now run these in parallel using multiprocessing
Expand All @@ -122,7 +122,7 @@ def runTrinityGG(genome, readTuple, longReads, shortBAM, output, args=False):
# now grab them all using Trinity script
cmd = ['perl', os.path.abspath(os.path.join(
TRINITY, 'util', 'support_scripts', 'GG_partitioned_trinity_aggregator.pl')), 'Trinity_GG']
lib.runSubprocess5(cmd, '.', lib.log, outputfiles, output)
lib.runSubprocess(cmd, '.', lib.log, in_file=outputfiles, capture_output=output)
lib.log.info('{:,} transcripts derived from Trinity'.format(
lib.countfasta(output)))

Expand Down
Loading