Skip to content

Commit

Permalink
Update cd-hit and mmseq installation8
Browse files Browse the repository at this point in the history
  • Loading branch information
breimanntools committed Jun 27, 2024
1 parent c830c39 commit 604df94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y mmseqs2
- name: Install cd-hit (Windows)
- name: Install cd-hit (Windows)
if: runner.os == 'Windows'
run: |
curl -L -o cd-hit.tar.gz https://github.com/weizhongli/cdhit/releases/download/V4.8.1/cd-hit-v4.8.1-2019-0228.tar.gz
Expand All @@ -70,10 +70,10 @@ jobs:
run: echo $PATH

- name: Check cd-hit Installation
run: cd-hit -h
run: which cd-hit || true

- name: Check mmseqs2 Installation
run: mmseqs -h
run: which mmseqs || true

- name: Run Tests
run: pytest tests
Expand Down
10 changes: 6 additions & 4 deletions aaanalysis/data_handling/_seq_preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def check_match_list_seq_alphabet(list_seq=None, alphabet=None):
raise ValueError(f"Following amino acid(s) from 'list_seq' are not in 'alphabet': {invalid_chars}")


def check_match_gap_alphabet():
""""""

def check_match_gap_alphabet(gap="_", alphabet=None):
"""Check that gap is not in alphabet"""
if gap in alphabet:
raise ValueError(f"'gap' ('{gap}') should not be contained in the 'alphabet' ('{alphabet}')")


# II Main Functions
Expand Down Expand Up @@ -77,8 +78,9 @@ def encode_one_hot(list_seq: Union[List[str], str] = None,
check_all_str_or_convertible=True,
accept_none=False, accept_str=True)
ut.check_str(name="alphabet", val=alphabet, accept_none=False)
ut.check_str(name="gap", val=gap, accept_none=False)
check_gap(gap=gap)
ut.check_str_options(name="pad_at", val=pad_at, list_str_options=["N", "C"])
check_match_gap_alphabet(gap=gap, alphabet=alphabet)
check_match_list_seq_alphabet(list_seq=list_seq, alphabet=alphabet)
# Create encoding
feature_matrix = encode_one_hot(list_seq=list_seq, alphabet=alphabet, gap=gap, pad_at=pad_at)
Expand Down

0 comments on commit 604df94

Please sign in to comment.