Skip to content

Commit c4b2e8c

Browse files
committed
Add properties to access the sketch parameters of a Database
1 parent 8d9d399 commit c4b2e8c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/pyskani/_skani.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ class Database:
6363
) -> Optional[bool]: ...
6464
@property
6565
def path(self) -> Optional[Path]: ...
66+
@property
67+
def compression(self) -> int: ...
68+
@property
69+
def marker_compression(self) -> int: ...
6670
def sketch(self, name: str, *contigs: _Sequence, seed: bool = True) -> None: ...
6771
def query(
6872
self,

src/pyskani/_skani/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,18 @@ impl Database {
451451
}
452452
}
453453

454+
/// `int`: The compression factor for sketches.
455+
#[getter]
456+
pub fn get_compression<'py>(slf: PyRef<'py, Self>, _py: Python) -> usize {
457+
slf.params.c
458+
}
459+
460+
/// `int`: The compression factor for marker k-mers.
461+
#[getter]
462+
pub fn get_marker_compression<'py>(slf: PyRef<'py, Self>, _py: Python) -> usize {
463+
slf.params.marker_c
464+
}
465+
454466
/// Add a reference genome to the database.
455467
///
456468
/// Arguments:

0 commit comments

Comments
 (0)