Skip to content

Commit

Permalink
Remove some more dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Oct 11, 2024
1 parent 00826c5 commit a707902
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
16 changes: 1 addition & 15 deletions src/cfeintact/subtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from pathlib import Path
from typing import Iterator, List, Sequence, Optional, Dict
from typing import Iterator, List, Dict
import contextlib
import importlib.resources as resources

Expand Down Expand Up @@ -84,17 +84,3 @@ def subtype_sequences(subtype: str) -> List[SeqRecord]:
SEQUENCE_CACHE[subtype] = list(subtype_sequences_iter(subtype))

return SEQUENCE_CACHE[subtype]


def convert_from_aligned_to_reference(position: int, alignment: List[Sequence[str]]) -> Optional[int]:
hxb2_pos = 0
subtype_pos = 0
for i in range(len(alignment[0])):
if subtype_pos == position:
return hxb2_pos
if alignment[0][i] != "-":
subtype_pos += 1
if alignment[1][i] != "-":
hxb2_pos += 1

return None
8 changes: 8 additions & 0 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ def test_basic_run(tmp_path, request):
except SystemExit as e: assert e.code == 0

assert os.path.exists(os.path.join(working_dir, "defects.json"))


def test_version_run(tmp_path, request):
testargs = ["cfeintact", "version"]

with patch.object(sys, 'argv', testargs):
try: main.cli()
except SystemExit as e: assert e.code == 0

0 comments on commit a707902

Please sign in to comment.