Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: check-case-conflict
- id: check-yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
rev: v0.16.8
hooks:
- id: ruff-check
- id: ruff-format
Expand All @@ -34,7 +34,7 @@ repos:
always_run: true
stages: [pre-push]
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.15.1
rev: v4.18.1
hooks:
- id: commitizen
stages: [commit-msg]
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmaps/phase-3-getitem-glue-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ pub fn reconstruct_haplotypes_fused<'py>(
out_data, out_offsets = gvl_rust.reconstruct_haplotypes_fused(
regions=req.regions,
geno_offset_idx=req.geno_offset_idx,
geno_offsets=self.genotypes.offsets, # already (2,n) or 1-D; Rust normalizes
geno_offsets=self.genotypes.offsets, # already (2,n) or 1-D; Rust normalizes
geno_v_idxs=self.genotypes.data,
v_starts=self.variants.start,
ilens=self.variants.ilen,
Expand Down
10 changes: 8 additions & 2 deletions docs/source/dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ Set `realign_tracks=False` in two cases:
ds = gvl.get_dummy_dataset()

# Reference-coordinate float tracks alongside haplotypes
ds_ref_tracks = ds.with_seqs("haplotypes").with_tracks(["read-depth"]).with_settings(realign_tracks=False)
ds_ref_tracks = (
ds.with_seqs("haplotypes")
.with_tracks(["read-depth"])
.with_settings(realign_tracks=False)
)

# Interval tracks alongside haplotypes (realign_tracks=False is required)
ds_itvs = (
Expand Down Expand Up @@ -164,7 +168,9 @@ ds = gvl.Dataset.open("ds.gvl", reference="ref.fa", var_fields=["AF"])
rv = ds.with_seqs("variants")[0, 0]
rv["AF"] # per-variant AF values, aligned with rv.alt/.start/.ilen

win = ds.with_seqs("variant-windows", gvl.VarWindowOpt(...)).with_output_format("flat")[0, 0]
win = ds.with_seqs("variant-windows", gvl.VarWindowOpt(...)).with_output_format("flat")[
0, 0
]
win.fields["AF"] # same field, alongside win.fields["start"]/["ilen"]
```

Expand Down
2 changes: 1 addition & 1 deletion docs/source/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ GVL's read path (haplotype reconstruction and track re-alignment) is parallelize
Environment variables configure a whole process, which means a script's parallelism can't be determined by reading the script — a value in a shell profile, a Dockerfile, or a SLURM template changes how it runs. To state the policy where a reader can see it, set it on the dataset:

```python
ds = ds.with_settings(parallel=False) # True | False | "auto"
ds = ds.with_settings(parallel=False) # True | False | "auto"
```

- `True` — always hand batches to rayon, whatever their size.
Expand Down
44 changes: 33 additions & 11 deletions docs/superpowers/REGRESSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,35 @@ cells fit within a ≤256 GB allocation. The OOM-kills observed in the new pipel
```python
import genvarloader as gvl
from time import perf_counter

# tracks-only: with_seqs(None) -> batch is a single track tensor (no RaggedVariants)
ds = gvl.Dataset.open(DS_PATH, FASTA).with_seqs(None).with_tracks("read-depth","tracks").with_len(16384)
ds = (
gvl.Dataset.open(DS_PATH, FASTA)
.with_seqs(None)
.with_tracks("read-depth", "tracks")
.with_len(16384)
)
for bs in (8, 32):
dl = ds.to_dataloader(batch_size=bs, shuffle=False)
ny=nnuc=0; burn=5; nb=150; t0=perf_counter(); esz=4; done=False
ny = nnuc = 0
burn = 5
nb = 150
t0 = perf_counter()
esz = 4
done = False
while not done:
for b in dl:
trk = b[1] if isinstance(b,(list,tuple)) else b # track tensor
if ny==burn: t0=perf_counter()
if ny>=burn: nnuc+=trk.numel(); esz=trk.element_size()
ny+=1
if ny>=nb: done=True; break
print(bs, nnuc/(perf_counter()-t0)/2**20*esz, "MiB/s")
trk = b[1] if isinstance(b, (list, tuple)) else b # track tensor
if ny == burn:
t0 = perf_counter()
if ny >= burn:
nnuc += trk.numel()
esz = trk.element_size()
ny += 1
if ny >= nb:
done = True
break
print(bs, nnuc / (perf_counter() - t0) / 2**20 * esz, "MiB/s")
```
Run with `NUMBA_NUM_THREADS=1` for the single-thread numbers. The 0.6.1 side uses the
equivalent old API (`gvl.Dataset.open(ds, fasta, return_sequences=False)`; restored in
Expand All @@ -171,12 +187,18 @@ the *same* BED + variants + BigWig table to keep regions/samples identical.

```python
import numpy as np, numba as nb


@nb.njit(parallel=True)
def f(x):
s=0.0
for i in nb.prange(x.size): s+=x[i]
s = 0.0
for i in nb.prange(x.size):
s += x[i]
return s
f(np.ones(1000)); print(nb.threading_layer()) # 'tbb' if installed, else 'omp'


f(np.ones(1000))
print(nb.threading_layer()) # 'tbb' if installed, else 'omp'
```
0.6.1 pulled `tbb` transitively; 0.24.1 made it optional, so fresh installs report `omp`.

Expand Down
12 changes: 7 additions & 5 deletions docs/superpowers/plans/2026-05-08-get-splice-bed.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@ def get_splice_bed(
if contigs is not None:
lf = lf.filter(pl.col("seqname").is_in(contigs))

lf = lf.filter(pl.col("feature") == "CDS").rename({
"seqname": "chrom",
"start": "chromStart",
"end": "chromEnd",
})
lf = lf.filter(pl.col("feature") == "CDS").rename(
{
"seqname": "chrom",
"start": "chromStart",
"end": "chromEnd",
}
)

lf = lf.with_columns(
pl.col("chromStart") - 1,
Expand Down
Loading
Loading