Skip to content

Commit

Permalink
Unmapped IDs all accounted for
Browse files Browse the repository at this point in the history
  • Loading branch information
iquasere committed Feb 1, 2021
1 parent 0da25ce commit bd13cc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "upimapi" %}
{% set version = "1.1.0" %}
{% set version = "1.1.1" %}
{% set sha256 = "e5eda4953af1bbb20c7a4dc79bb8975603bd0cac666218cdc753f8cf3f9ca716" %}

package:
Expand All @@ -22,7 +22,7 @@ requirements:
- openpyxl
- xlrd
- diamond
- subprocess
- psutil

test:
commands:
Expand Down
14 changes: 4 additions & 10 deletions upimapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from uniprot_support import UniprotSupport

__version__ = '1.1.0'
__version__ = '1.1.1'

upmap = UniprotSupport()

Expand Down Expand Up @@ -208,9 +208,6 @@ def recursive_uniprot_fasta(self, all_ids, output, max_iter=5, step=1000):
else:
print(output + ' not found. Will perform mapping for all IDs.')
ids_done = list()
tries = 0
ids_unmapped_output = '{}{}ids_unmapped.txt'.format('/'.join(output.split('/')[:-1]),
'/' if '/' in output else '')

ids_missing = list(set(all_ids) - set(ids_done))

Expand All @@ -232,7 +229,7 @@ def recursive_uniprot_fasta(self, all_ids, output, max_iter=5, step=1000):
print('Results for all IDs are available at ' + output)
else:
ids_unmapped_output = '/'.join(output.split('/')[:-1]) + '/ids_unmapped.txt'
handler = open(ids_unmapped_output, 'w')
handler = open(ids_unmapped_output, 'a')
handler.write('\n'.join(ids_missing))
print('Maximum iterations were made. Results related to {} IDs were not obtained. IDs with missing '
'information are available at {} and information obtained is available at {}'.format(
Expand Down Expand Up @@ -290,15 +287,12 @@ def recursive_uniprot_information(self, ids, output, max_iter=5, excel=False,
if len(ids_missing) == 0:
print('Results for all IDs are available at ' + output)
else:
open(ids_unmapped_output, 'w').write('\n'.join(ids_missing))
open(ids_unmapped_output, 'a').write('\n'.join(ids_missing))
print("Maximum iterations were made. Results related to {} IDs were not obtained. IDs with missing "
"information are available at {} and information obtained is available at {}".format(
str(len(ids_missing)), ids_unmapped_output, output))

'''
Input:
Output:
'''

def get_ids(self, inpute, input_type='blast', full_id=False):
if input_type == 'blast':
ids = self.parse_blast(inpute)['sseqid']
Expand Down

0 comments on commit bd13cc1

Please sign in to comment.