Skip to content

Commit

Permalink
update to v0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Palmer authored and Jon Palmer committed Apr 29, 2016
1 parent a093df5 commit 50e39ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions bin/funannotate-compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ def __init__(self,prog):
if not os.path.isdir(os.path.join(args.out, 'signalp')):
os.makedirs(os.path.join(args.out, 'signalp'))
sig = {}
for i in range(0,len(scinames)):
if scinames[i] not in sig:
sig[scinames[i]] = len(signalpDict[i])
for i in range(0,len(names)):
if names[i] not in sig:
sig[names[i]] = len(signalpDict[i])
sigdf = pd.DataFrame([sig])
sigdf.transpose().to_csv(os.path.join(args.out, 'signalp', 'signalp.csv'))
lib.drawbarplot(sigdf, os.path.join(args.out, 'signalp', 'signalp.pdf'))
Expand Down
2 changes: 1 addition & 1 deletion funannotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def fmtcols(mylist, cols):
for i in range(0,num_lines))
return "\n".join(lines)

version = '0.2.3'
version = '0.2.5'

default_help = """
Usage: funannotate <command> <arguments>
Expand Down
11 changes: 6 additions & 5 deletions lib/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ def signalP(input, tmpdir, output):
log.info("Predicting secreted proteins with SignalP")
FNULL = open(os.devnull, 'w')
#split input file into chunks, 20 should mean < 200 proteins per chunk
fasta2chunks(input, 20, tmpdir, 'signalp_tmp')
fasta2chunks(input, 40, tmpdir, 'signalp_tmp')
for file in os.listdir(os.path.join(tmpdir, 'signalp_tmp')):
if file.startswith('chunk'):
file = os.path.join(tmpdir, 'signalp_tmp', file)
Expand Down Expand Up @@ -1063,9 +1063,9 @@ def GetClusterGenes(input, GFF, output, annotations):
global dictClusters
#pull out genes in clusters from GFF3, load into dictionary
with open(output, 'w') as out:
subprocess.call(['bedtools', 'intersect','-wo', '-a', input, '-b', GFF], stdout = output)
subprocess.call(['bedtools', 'intersect','-wo', '-a', input, '-b', GFF], stdout = out)
dictClusters = {}
with open(Output, 'rU') as input:
with open(output, 'rU') as input:
for line in input:
cols = line.split('\t')
if cols[8] != 'gene':
Expand All @@ -1076,14 +1076,14 @@ def GetClusterGenes(input, GFF, output, annotations):
dictClusters[ID] = [gene]
else:
dictClusters[ID].append(gene)
with open(annotations, 'w') as output:
with open(annotations, 'w') as annotout:
for k, v in dictClusters.items():
for i in v:
if not i.endswith('-T1'):
ID = i + ('-T1')
else:
ID = i
out.write("%s\tnote\tantiSMASH:%s\n" % (ID, k))
annotout.write("%s\tnote\tantiSMASH:%s\n" % (ID, k))

def splitFASTA(input, outputdir):
if not os.path.isdir(outputdir):
Expand Down Expand Up @@ -1354,6 +1354,7 @@ def drawbarplot(df, output):
ax = sns.barplot(data=df, palette=pref_colors)
plt.xlabel('Genomes')
plt.ylabel('Secreted Proteins')
plt.xticks(rotation=90)
fig.savefig(output, format='pdf', dpi=1000, bbox_inches='tight')
plt.close(fig)

Expand Down

0 comments on commit 50e39ca

Please sign in to comment.