Skip to content

Commit

Permalink
Merge pull request #64 from IBM/rfd-dev
Browse files Browse the repository at this point in the history
 Bug fix: peptides similarity support for None df_target
  • Loading branch information
RaulFD-creator authored Nov 11, 2024
2 parents 3b81d16 + c12a6c8 commit 1c5d789
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions hestia/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,11 +680,12 @@ def _medium_alignment(df_query, df_target, tmp_dir,
dbtype, db_target_file, '-v', '1',
f'{tmp_dir}/db_target'])

subprocess.run(['mmseqs', 'search', f'{tmp_dir}/db_query',
subprocess.run(['mmseqs', 'search', f'{tmp_dir}/db_query',
f'{tmp_dir}/db_target', f'{tmp_dir}/align_db',
f'{tmp_dir}/tmp', '--alignment-mode', '3',
'--seq-id-mode', denominator, '--search-type', '1',
'--prefilter-mode', '2', '-s', '2', '-v', mmseqs_v,
'--prefilter-mode', '2', '-s', '2',
'-v', str(mmseqs_v),
'--threads', str(threads), '--mask', '0',
'--comp-bias-corr', '0',
'-e', '1e7'])
Expand All @@ -705,6 +706,8 @@ def _medium_alignment(df_query, df_target, tmp_dir,
os.mkdir(tmp_dir)

df_query['seq_len'] = df_query[field_name].map(len)
if df_target is None:
df_target = df_query
normal_df_query = df_query[df_query['seq_len'] > 20]
medium_df_query = df_query[(df_query['seq_len'] > 8) &
(df_query['seq_len'] <= 20)]
Expand Down Expand Up @@ -739,7 +742,8 @@ def _medium_alignment(df_query, df_target, tmp_dir,
medium_simdf = pd.DataFrame()
if len(small_df_query) > 0:
small_simdf = _small_alignment(
df_query=small_df_query, df_target=df_target, field_name=field_name
df_query=small_df_query, df_target=df_target, field_name=field_name,
denominator=denominator
)
else:
small_simdf = pd.DataFrame()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/IBM/Hestia-OOD',
version='0.0.32',
version='0.0.33',
zip_safe=False,
)

0 comments on commit 1c5d789

Please sign in to comment.