Skip to content

Commit

Permalink
add template for gpu support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Kamiński committed Jan 18, 2024
1 parent 5c62f00 commit 24c136d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
7 changes: 7 additions & 0 deletions alntools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ def __init__(self, enh: bool = False,
self.sigma_factor = sigma_factor
self.gap_penalty = gap_penalty

# TODO implement this
def submatrix_to_span(self, densitymap, mode: str = 'results') -> pd.DataFrame:
'''
run plmblast flow from substitution matrix
func should return same results as embedding_to_span
'''
pass

def embedding_to_span(self, X: np.ndarray, Y: np.ndarray, mode: str = 'results' ) -> pd.DataFrame:
'''
Expand Down
4 changes: 2 additions & 2 deletions examples/scope.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

ALIGNMENT_CUTOFF="0.3"
COSINE_CUTOFF=95
COSINE_CUTOFF=70

DBDIR=/home/nfs/kkaminski/PLMBLST/db/scop40-201
RESULTS="/home/nfs/kkaminski/PLMBLST/results/scope40-201_${ALIGNMENT_CUTOFF}_${COSINE_CUTOFF}.csv"

NUM_WORKERS=10
NUM_WORKERS=6
# Return hits with scores >=0.3
# no cutoff because our database is small we dont need additional filtering
# Run plm-blast
Expand Down
19 changes: 19 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest




@pytest.mark.parametrize("size", [10, 50, 100])
def test_remove_duplicates(size):
'''
test if function properly filter redundant hits eg. a-b, a-b, a-c func should exclude b-a
'''

data = {idx: list(range(size)) for idx in range(size)}
# func

# expected number of samples is size*(size - 1)/2
expected_size = size*(size - 1)/2
actual_size = sum([len(v) for v in data.values()])

assert actual_size == expected_size

0 comments on commit 24c136d

Please sign in to comment.