Skip to content
Merged
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 .github/workflows/ci-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout TileDB-VCF
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.12"

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
libtiledbvcf:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup to build htslib from source
run: brew install autoconf automake
- name: Configure libtiledbvcf
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
env:
DYLD_LIBRARY_PATH: "${{ github.workspace }}/dist/lib"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0 # fetch everything for python setuptools_scm
- name: Download libtiledbvcf artifact
Expand All @@ -78,11 +78,11 @@ jobs:
name: libtiledbvcf
path: dist
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install libtiledb
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ci
create-args: tiledb
Expand All @@ -101,7 +101,7 @@ jobs:
runs-on: macos-15
needs: libtiledbvcf
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Download libtiledbvcf artifact
uses: actions/download-artifact@v4
with:
Expand All @@ -116,13 +116,13 @@ jobs:
python-standalone:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0 # fetch everything for python setuptools_scm
- name: Setup to build htslib from source
run: brew install autoconf automake
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Build tiledbvcf-py
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ jobs:
matrix:
os: [macos-15, ubuntu-24.04]
branches:
- {libtiledb: release-2.30, tiledb-py: 0.36.0}
- {libtiledb: release-2.30, tiledb-py: 0.36.1}
- {libtiledb: main, tiledb-py: main}
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
steps:
- name: Clone TileDB
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: TileDB-Inc/TileDB
ref: ${{ matrix.branches.libtiledb }}
path: TileDB
- name: Clone TileDB-Py
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: TileDB-Inc/TileDB-Py
ref: ${{ matrix.branches.tiledb-py }}
path: TileDB-Py
- name: Clone TileDB-VCF
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: TileDB-VCF
fetch-depth: 0 # fetch everything for python setuptools_scm
Expand Down Expand Up @@ -80,11 +80,13 @@ jobs:
- name: Test libtiledbvcf
run: bash TileDB-VCF/ci/nightly/test-libtiledbvcf.sh
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Build tiledb-py from source
run: bash TileDB-VCF/ci/nightly/build-tiledb-py.sh
env:
PYBIND11_MAX_VERSION: ${{ matrix.branches.tiledb-py != 'main' && '<3' || '' }}
- name: Build (and test) tiledbvcf-py
run: bash TileDB-VCF/ci/nightly/build-tiledbvcf-py.sh
issue:
Expand All @@ -94,7 +96,7 @@ jobs:
needs: nightly
if: ( failure() || cancelled() ) && github.repository_owner == 'TileDB-Inc' && github.event_name == 'schedule'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Open Issue
uses: TileDB-Inc/github-actions/open-issue@main
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/quarto-render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
quarto-render-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: "Install Quarto"
uses: quarto-dev/quarto-actions/setup@v2
Expand All @@ -25,7 +25,7 @@ jobs:
# https://github.com/quarto-dev/quarto-cli/issues/493

- name: "Deploy to gh-pages"
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
# Change to the name of your repo's primary branch name:
if: github.ref == 'refs/heads/main' && github.repository_owner == 'TileDB-Inc'
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install conda env
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ci/gha-win-env.yml
cache-environment: true
Expand Down
1 change: 1 addition & 0 deletions apis/python/src/tiledbvcf/binding/libtiledbvcf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ PYBIND11_MODULE(libtiledbvcf, m) {
"ingest_samples",
&Writer::ingest_samples,
py::call_guard<py::gil_scoped_release>())
.def("set_skip_aggregate_stats", &Writer::set_skip_aggregate_stats)
.def(
"delete_samples",
&Writer::delete_samples,
Expand Down
2 changes: 1 addition & 1 deletion apis/python/src/tiledbvcf/binding/pyarrow_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using namespace tiledb::vcf;
* @return py::object Arrow table
*/
py::object _buffer_to_table(std::shared_ptr<ArrayBuffers> buffers) {
auto pa = py::module::import("pyarrow");
auto pa = py::module_::import("pyarrow");
auto pa_table_from_arrays = pa.attr("Table").attr("from_arrays");
auto pa_array_import = pa.attr("Array").attr("_import_from_c");
auto pa_schema_import = pa.attr("Schema").attr("_import_from_c");
Expand Down
2 changes: 1 addition & 1 deletion apis/python/src/tiledbvcf/binding/sample_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace py = pybind11;
using namespace py::literals;
using namespace tiledb::vcf;

void load_sample_stats(py::module& m) {
void load_sample_stats(py::module_& m) {
m.def(
"sample_qc",
[](const std::string& dataset_uri,
Expand Down
2 changes: 1 addition & 1 deletion apis/python/src/tiledbvcf/binding/vcf_arrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void build_arrow_array_from_buffer(
}

py::object buffers_to_table(std::vector<std::shared_ptr<BufferInfo>>& buffers) {
auto pa = py::module::import("pyarrow");
auto pa = py::module_::import("pyarrow");
auto pa_table_from_arrays = pa.attr("Table").attr("from_arrays");
auto pa_array_import = pa.attr("Array").attr("_import_from_c");
auto pa_schema_import = pa.attr("Schema").attr("_import_from_c");
Expand Down
5 changes: 5 additions & 0 deletions apis/python/src/tiledbvcf/binding/writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ void Writer::ingest_samples() {
check_error(writer, tiledb_vcf_writer_store(writer));
}

void Writer::set_skip_aggregate_stats(bool skip) {
auto writer = ptr.get();
check_error(writer, tiledb_vcf_writer_set_skip_aggregate_stats(writer, skip));
}

void Writer::delete_samples(std::vector<std::string> samples_to_delete) {
std::vector<const char*> samples;
for (std::string& sample : samples_to_delete) {
Expand Down
2 changes: 2 additions & 0 deletions apis/python/src/tiledbvcf/binding/writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ class Writer {

void ingest_samples();

void set_skip_aggregate_stats(bool skip);

void delete_samples(std::vector<std::string> samples);

/** Returns schema version number of the TileDB VCF dataset */
Expand Down
14 changes: 14 additions & 0 deletions apis/python/src/tiledbvcf/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,23 @@ def ingest_samples(
def delete_samples(
self,
sample_uris: List[str] = None,
skip_aggregate_stats: bool = False,
):
"""
Delete samples from the dataset.

Parameters
----------
sample_uris
List of sample names to delete.
skip_aggregate_stats
If True, skip updating allele_count and variant_stats arrays
during deletion.
"""
if self.mode != "w":
raise Exception("Dataset not open in write mode")
if skip_aggregate_stats:
self.writer.set_skip_aggregate_stats(True)
self.writer.delete_samples(sample_uris)

def tiledb_stats(self) -> str:
Expand Down
Loading
Loading