Skip to content

Commit

Permalink
parse signalp v6 #650
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Palmer committed Oct 11, 2021
1 parent 0f880cb commit ec3e016
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion funannotate/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -5654,6 +5654,8 @@ def parseSignalP(sigP, secretome_annot):
if line.startswith('#'):
if line.startswith('# SignalP-5'):
version = 5
elif line.startswith('# SignalP-6'):
version = 6
continue
if version < 5:
col = line.split(' ') # not tab delimited
Expand All @@ -5662,7 +5664,7 @@ def parseSignalP(sigP, secretome_annot):
ID = col[0]
end = int(col[2]) - 1
sigpDict[ID] = [end, '', '']
else: # version 5 has different format and tab delimited hooray!
elif version == 5: # version 5 has different format and tab delimited hooray!
if '\t' in line:
cols = line.split('\t')
if cols[1] != 'OTHER': # then signal peptide
Expand All @@ -5672,6 +5674,15 @@ def parseSignalP(sigP, secretome_annot):
prob = components[-1]
aa = components[3].replace('.', '')
sigpDict[ID] = [pos, aa, prob]
else:
if '\t' in line:
cols = line.split('\t')
if cols[1] != 'NO_SP': # then signal peptide
ID, prediction, score1, score2, position = cols[:5]
components = position.split()
pos = components[2].split('-')[0]
prob = components[-1]
sigpDict[ID] = [pos, '', prob]

with open(secretome_annot, 'w') as secout:
for k, v in natsorted(list(sigpDict.items())):
Expand Down

0 comments on commit ec3e016

Please sign in to comment.