pypi genvarloader 0.17.0

latest releases: 0.43.1, 0.43.0, 0.42.1...
14 months ago

0.17.0 (2025-08-22)

❗Breaking Changes❗

  • The layout of Ragged offsets has changed to match Awkward for better performance. This ONLY affects SVAR datasets which must have their offsets rewritten to have shape (2, n_regions, n_samples, ploidy) instead of (n_regions, n_samples, ploidy, 2). The SVAR genotype metadata shape info must be updated to reflect this as well. In addition, any code that uses Ragged.offsets directly may need to be adjusted as 2-D offsets have had their axes transposed.
  • The transform and return_indices arguments have been moved to Dataset.to_torch_dataset and Dataset.to_dataloader

📦Additions📦

  • Dataset.n_intervals() and Dataset.n_variants() methods to get arrays of how many intervals and variants are present in each region/sample/ploid/track
  • Dataset.with_seqs('variants') and Dataset.with_tracks(kind='intervals') to return RaggedVariants and RaggedIntervals, respectively. These are simple containers of Ragged arrays. Methods to convert RaggedVariants and RaggedIntervals to dictionaries of PyTorch Nested tensors.
  • Ragged arrays are now a subclass of Awkward Arrays. As a result, Ragged arrays now support all element-wise operators, all awkward functions, and NumPy ufuncs. Their indexing behavior also directly inherits from awkward arrays. As a result, the Ragged.to_awkward() method is deprecated. If you want to remove the Ragged behavior from a Ragged array and get a plain awkward array, you can use Ragged.to_ak(). Awkward arrays can be converted to Ragged ones by simply passing an awkward array to the Ragged constructor directly: Ragged(ak_array).
  • gvl.data_registry.fetch() to obtain pre-processed datasets. Currently includes Geuvadis with RNA-seq tracks and the full 1000 Genomes Project WGS data as VCF/PLINK and BigWigs that can be passed to gvl.write().

Commits

Feat

  • use new seqpro.Ragged interface
  • method to obtain the number of variants per region,sample,haplotype.
  • support for reverse complementing alt alleles of RaggedVariants
  • ragvariant methods for pytorch, fix squeeze for scalar indexing, upstream genoray fix for extending genotypes from PGEN, (perf) batched contig normalization
  • subsetting for RefDataset

Fix

  • right shape for double slice indexing
  • shape/broadcasting bug for reverse complementing variants
  • perf: breaking changes to ragged data layout from seqpro to eliminate copies when converting non-contiguous ragged data to/from awkward arrays.
  • when ref not passed to Dataset.open, emit a warning instead of error and let ds return raggedvariants
  • refdataset transforms with indices

[main d38797c] bump: version 0.16.0 → 0.17.0
2 files changed, 19 insertions(+), 1 deletion(-)

Don't miss a new genvarloader release

NewReleases is sending notifications on new releases.