Skip to content

Commit

Permalink
Update version and add hit to Prod model
Browse files Browse the repository at this point in the history
  • Loading branch information
horta committed Feb 26, 2024
1 parent 3c8f85d commit 9199fad
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 134 deletions.
2 changes: 1 addition & 1 deletion python-core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "deciphon-core"
version = "0.23.1"
version = "0.23.2"
description = "Python wrapper around the Deciphon C library"
authors = ["Danilo Horta <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion python-core/tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_scan(tmp_path, files_path: Path):

shutil.unpack_archive(snapfile.path, format="zip")
products = snapfile.basename / "products.tsv"
assert checksum(products)[:8] == "e06f9686"
assert checksum(products)[:8] == "ee567b88"


sequences = [
Expand Down
1 change: 1 addition & 0 deletions snap/deciphon_snap/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Prod(BaseModel):
seq_id: int
window: int
window_interval: Interval
hit: int
hit_interval: Interval
profile: str
abc: str
Expand Down
4 changes: 3 additions & 1 deletion snap/deciphon_snap/snap_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ def __init__(self, filesystem):
for idx, row in enumerate((csv_parse(fieldnames, r) for r in rows[1:])):
seq_id = int(row["sequence"])
window = int(row["window"])
hit = int(row["hit"])
profile = str(row["profile"])
with fs.open(f"{hmmer_dir}/{seq_id}/{window}/{profile}.h3r", "rb") as f2:
with fs.open(f"{hmmer_dir}/{seq_id}/{window}/{hit}/{profile}.h3r", "rb") as f2:
h3r = H3Result(raw=read_h3result(fileno=f2.fileno()))
window_start = int(row["window_start"])
window_stop = int(row["window_stop"])
Expand All @@ -51,6 +52,7 @@ def __init__(self, filesystem):
seq_id=seq_id,
window=window,
window_interval=window_interval,
hit=hit,
hit_interval=hit_interval,
profile=profile,
abc=row["abc"],
Expand Down
2 changes: 1 addition & 1 deletion snap/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "deciphon-snap"
version = "0.10.2"
version = "0.11.0"
description = "Reader for Deciphon snap files."
authors = ["Danilo Horta <[email protected]>"]
license = "MIT"
Expand Down
Binary file modified snap/tests/files/consensus.dcs
Binary file not shown.
Binary file removed snap/tests/files/example.dcs
Binary file not shown.
9 changes: 9 additions & 0 deletions snap/tests/test_alignments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from pathlib import Path

from deciphon_snap.read_snap import read_snap
from deciphon_snap.view import view_alignments

def test_alignments(files_path: Path):
snap_file = read_snap(files_path / "consensus.dcs")
txt = view_alignments(snap_file)
print(txt)
86 changes: 0 additions & 86 deletions snap/tests/test_fasta.py

This file was deleted.

22 changes: 0 additions & 22 deletions snap/tests/test_gff.py

This file was deleted.

22 changes: 0 additions & 22 deletions snap/tests/test_read.py

This file was deleted.

0 comments on commit 9199fad

Please sign in to comment.