1. Structure
  2. Life Sciences
  3. Population Genomics
  4. Tutorials
  5. Advanced
  6. Annotations
  7. Ingesting Annotations
  • Home
  • What is TileDB?
  • Get Started
  • Explore Content
  • Accounts
    • Individual Accounts
      • Apply for the Free Tier
      • Profile
        • Overview
        • Cloud Credentials
        • Storage Paths
        • REST API Tokens
        • Credits
    • Organization Admins
      • Create an Organization
      • Profile
        • Overview
        • Members
        • Cloud Credentials
        • Storage Paths
        • Billing
      • API Tokens
    • Organization Members
      • Organization Invitations
      • Profile
        • Overview
        • Members
        • Cloud Credentials
        • Storage Paths
        • Billing
      • API Tokens
  • Catalog
    • Introduction
    • Data
      • Arrays
      • Tables
      • Single-Cell (SOMA)
      • Genomics (VCF)
      • Biomedical Imaging
      • Vector Search
      • Files
    • Code
      • Notebooks
      • Dashboards
      • User-Defined Functions
      • Task Graphs
      • ML Models
    • Groups
    • Marketplace
    • Search
  • Collaborate
    • Introduction
    • Organizations
    • Access Control
      • Introduction
      • Share Assets
      • Asset Permissions
      • Public Assets
    • Logging
    • Marketplace
  • Analyze
    • Introduction
    • Slice Data
    • Multi-Region Redirection
    • Notebooks
      • Launch a Notebook
      • Usage
      • Widgets
      • Notebook Image Dependencies
    • Dashboards
      • Dashboards
      • Streamlit
    • Preview
    • User-Defined Functions
    • Task Graphs
    • Serverless SQL
    • Monitor
      • Task Log
      • Task Graph Log
  • Scale
    • Introduction
    • Task Graphs
    • API Usage
  • Structure
    • Why Structure Is Important
    • Arrays
      • Introduction
      • Quickstart
      • Foundation
        • Array Data Model
        • Key Concepts
          • Storage
            • Arrays
            • Dimensions
            • Attributes
            • Cells
            • Domain
            • Tiles
            • Data Layout
            • Compression
            • Encryption
            • Tile Filters
            • Array Schema
            • Schema Evolution
            • Fragments
            • Fragment Metadata
            • Commits
            • Indexing
            • Array Metadata
            • Datetimes
            • Groups
            • Object Stores
          • Compute
            • Writes
            • Deletions
            • Consolidation
            • Vacuuming
            • Time Traveling
            • Reads
            • Query Conditions
            • Aggregates
            • User-Defined Functions
            • Distributed Compute
            • Concurrency
            • Parallelism
        • Storage Format Spec
      • Tutorials
        • Basics
          • Basic Dense Array
          • Basic Sparse Array
          • Array Metadata
          • Compression
          • Encryption
          • Data Layout
          • Tile Filters
          • Datetimes
          • Multiple Attributes
          • Variable-Length Attributes
          • String Dimensions
          • Nullable Attributes
          • Multi-Range Reads
          • Query Conditions
          • Aggregates
          • Deletions
          • Catching Errors
          • Configuration
          • Basic S3 Example
          • Basic TileDB Cloud
          • fromDataFrame
          • Palmer Penguins
        • Advanced
          • Schema Evolution
          • Advanced Writes
            • Write at a Timestamp
            • Get Fragment Info
            • Consolidation
              • Fragments
              • Fragment List
              • Consolidation Plan
              • Commits
              • Fragment Metadata
              • Array Metadata
            • Vacuuming
              • Fragments
              • Commits
              • Fragment Metadata
              • Array Metadata
          • Advanced Reads
            • Get Fragment Info
            • Time Traveling
              • Introduction
              • Fragments
              • Array Metadata
              • Schema Evolution
          • Array Upgrade
          • Backends
            • Amazon S3
            • Azure Blob Storage
            • Google Cloud Storage
            • MinIO
            • Lustre
          • Virtual Filesystem
          • User-Defined Functions
          • Distributed Compute
          • Result Estimation
          • Incomplete Queries
        • Management
          • Array Schema
          • Groups
          • Object Management
        • Performance
          • Summary of Factors
          • Dense vs. Sparse
          • Dimensions vs. Attributes
          • Compression
          • Tiling and Data Layout
          • Tuning Writes
          • Tuning Reads
      • API Reference
    • Tables
      • Introduction
      • Quickstart
      • Foundation
        • Data Model
        • Key Concepts
          • Indexes
          • Columnar Storage
          • Compression
          • Data Manipulation
          • Optimize Tables
          • ACID
          • Serverless SQL
          • SQL Connectors
          • Dataframes
          • CSV Ingestion
      • Tutorials
        • Basics
          • Ingestion with SQL
          • CSV Ingestion
          • Basic S3 Example
          • Running Locally
        • Advanced
          • Scalable Ingestion
          • Scalable Queries
      • API Reference
    • AI & ML
      • Vector Search
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • Vector Search
            • Vector Databases
            • Algorithms
            • Distance Metrics
            • Updates
            • Deployment Methods
            • Architecture
            • Distributed Compute
          • Storage Format Spec
        • Tutorials
          • Basics
            • Ingestion & Querying
            • Updates
            • Deletions
            • Basic S3 Example
            • Running Locally
          • Advanced
            • Versioning
            • Time Traveling
            • Consolidation
            • Distributed Compute
            • RAG LLM
            • LLM Memory
            • File Search
            • Image Search
            • Protein Search
          • Performance
        • API Reference
      • ML Models
        • Introduction
        • Quickstart
        • Foundation
          • Basics
          • Storage
          • Cloud Execution
          • Why TileDB for Machine Learning
        • Tutorials
          • Ingestion
            • Data Ingestion
              • Dense Datasets
              • Sparse Datasets
            • ML Model Ingestion
          • Management
            • Array Schema
            • Machine Learning: Groups
            • Time Traveling
    • Life Sciences
      • Single-cell
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • Data Structures
            • Use of Apache Arrow
            • Join IDs
            • State Management
            • TileDB Cloud URIs
          • SOMA API Specification
        • Tutorials
          • Data Ingestion
          • Bulk Ingestion Tutorial
          • Data Access
          • Distributed Compute
          • Basic S3 Example
          • Multi-Experiment Queries
          • Appending Data to a SOMA Experiment
          • Add New Measurements
          • SQL Queries
          • Running Locally
          • Shapes in TileDB-SOMA
          • Drug Discovery App
        • Spatial
          • Introduction
          • Foundation
            • Spatial Data Model
            • Data Structures
          • Tutorials
            • Spatial Data Ingestion
            • Access Spatial Data
            • Manage Coordinate Spaces
        • API Reference
      • Population Genomics
        • Introduction
        • Quickstart
        • Foundation
          • Data Model
          • Key Concepts
            • The N+1 Problem
            • Architecture
            • Arrays
            • Ingestion
            • Reads
            • Variant Statistics
            • Annotations
            • User-Defined Functions
            • Tables and SQL
            • Distributed Compute
          • Storage Format Spec
        • Tutorials
          • Basics
            • Basic Ingestion
            • Basic Queries
            • Export to VCF
            • Add New Samples
            • Deleting Samples
            • Basic S3 Example
            • Basic TileDB Cloud
          • Advanced
            • Scalable Ingestion
            • Scalable Queries
            • Query Transforms
            • Handling Large Queries
            • Annotations
              • Finding Annotations
              • Embedded Annotations
              • External Annotations
              • Annotation VCFs
              • Ingesting Annotations
            • Variant Statistics
            • Tables and SQL
            • User-Defined Functions
            • Sample Metadata
            • Split VCF
          • Performance
        • API Reference
          • Command Line Interface
          • Python API
          • Cloud API
      • Biomedical Imaging
        • Introduction
        • Foundation
          • Data Model
          • Key Concepts
            • Arrays
            • Ingestion
            • Reads
            • User Defined Functions
          • Storage Format Spec
        • Quickstart
        • Tutorials
          • Basics
            • Ingestion
            • Read
              • OpenSlide
              • TileDB-Py
          • Advanced
            • Batched Ingestion
            • Chunked Ingestion
            • Machine Learning
              • PyTorch
            • Napari
    • Files
  • API Reference
  • Self-Hosting
    • Installation
    • Upgrades
    • Administrative Tasks
    • Image Customization
      • Customize User-Defined Function Images
      • AWS ECR Container Registry
      • Customize Jupyter Notebook Images
    • Single Sign-On
      • Configure Single Sign-On
      • OpenID Connect
      • Okta SCIM
      • Microsoft Entra
  • Glossary
  1. Structure
  2. Life Sciences
  3. Population Genomics
  4. Tutorials
  5. Advanced
  6. Annotations
  7. Ingesting Annotations

Ingesting Annotations

life sciences
genomics (vcf)
tutorials
annotations
Learn about ingesting tabular annotations into TileDB arrays.
How to run this tutorial

You can run this tutorial only on TileDB Cloud. However, TileDB Cloud has a free tier. We strongly recommend that you sign up and run everything there, as that requires no installations or deployment.

This tutorial demonstrates how annotation that is tabular in nature, from sample metadata or variant annotation, can be ingested into generic TileDB arrays by using the from_csv or from_pandas methods.

This is the method used to ingest VEP and SnpEFF annotations into TileDB arrays. While creating the source tab-delimited files is beyond the scope of this tutorial, the following steps can be used for a number of external annotation approaches:

  1. Produce a sampleless, variant-only VCF file from the allele_count auxiliary array member of a TileDB-VCF dataset.
  2. Annotate the sampleless VCF file with VEP or SnpEFF.
  3. Convert the annotated VCF file to a comma-separated (CSV) or tab-delimited (TSV) file.
  4. Import the CSV (or TSV) into pandas, and make the necessary data type conversions.
  5. Use the from_pandas method to convert the pandas DataFrame to a TileDB array.

Import the necessary libraries, and set the URIs that will be used in this tutorial. If you are running this from a local notebook, visit the Tutorials: Basic TileDB Cloud for more information on how to set your TileDB Cloud credentials in a configuration object (this step can be omitted inside a TileDB Cloud notebook).

  • Python
import os

import numpy as np
import pandas as pd
import tiledb
import tiledb.cloud
import tiledb.cloud.vcf

# Get your credentials
tiledb_token = os.environ["TILEDB_REST_TOKEN"]
# or use your username and password (not recommended)
# tiledb_username = os.environ["TILEDB_USERNAME"]
# tiledb_password = os.environ["TILEDB_PASSWORD"]

tsv_uri = "tiledb://TileDB-Inc/vep-chr1-10k-tsv-gz"
tsv_name = "vep-chr1-10k.tsv.gz"
array_name = "my_vep_array"

# Clean up
if tiledb.object_type(array_name) == "array":
    tiledb.remove(array_name)
if os.path.exists(tsv_name):
    os.remove(tsv_name)

# Log into TileDB Cloud
tiledb.cloud.login(token=tiledb_token)
# or use your username and password (not recommended)
# tiledb.cloud.login(username=tiledb_username, password=tiledb_password)

Fetch a pre-made, tab-delimited VEP annotation file from the TileDB Cloud.

  • Python
tiledb.cloud.files.utils.export_file(uri=tsv_uri, output_uri=tsv_name)

Select the columns to ingest.

  • Python
vep_cols = [
    "CHROM",
    "POS",
    "REF",
    "ALT",
    "Gene",
    "Feature",
    "Feature_type",
    "Consequence",
    "cDNA_position",
    "CDS_position",
    "Protein_position",
    "Amino_acids",
    "Codons",
    "Existing_variation",
    "IMPACT",
    "SYMBOL",
    "BIOTYPE",
    "EXON",
    "INTRON",
    "HGVSc",
    "HGVSp",
    "HGVSg",
    "HGVS_OFFSET",
    "REF_ALLELE",
    "DISTANCE",
    "STRAND",
    "FLAGS",
    "VARIANT_CLASS",
    "SYMBOL_SOURCE",
    "HGNC_ID",
    "CCDS",
    "gnomADg_AF",
    "gnomADg_AFR_AF",
    "gnomADg_AMI_AF",
    "gnomADg_AMR_AF",
    "gnomADg_ASJ_AF",
    "gnomADg_EAS_AF",
    "gnomADg_FIN_AF",
    "gnomADg_MID_AF",
    "gnomADg_NFE_AF",
    "gnomADg_OTH_AF",
    "gnomADg_SAS_AF",
    "CLIN_SIG",
    "SOMATIC",
    "PHENO",
]

Read the tab-delimited file into a pandas DataFrame.

  • Python
df = pd.read_csv(
    tsv_name,
    comment="#",
    sep="\t",
    usecols=vep_cols,
    compression="gzip",
    dtype=pd.StringDtype(),
)
df
CHROM POS REF ALT Consequence IMPACT SYMBOL Gene Feature_type Feature ... gnomADg_ASJ_AF gnomADg_EAS_AF gnomADg_FIN_AF gnomADg_MID_AF gnomADg_NFE_AF gnomADg_OTH_AF gnomADg_SAS_AF CLIN_SIG SOMATIC PHENO
0 chr1 10097 T A upstream_gene_variant MODIFIER DDX11L2 ENSG00000290825 Transcript ENST00000456328 ... <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
1 chr1 10109 A T upstream_gene_variant MODIFIER DDX11L2 ENSG00000290825 Transcript ENST00000456328 ... 0 0 0 0 0 0 0 <NA> <NA> <NA>
2 chr1 10113 CT C upstream_gene_variant MODIFIER DDX11L2 ENSG00000290825 Transcript ENST00000456328 ... <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
3 chr1 10146 ACCCCT A upstream_gene_variant MODIFIER DDX11L2 ENSG00000290825 Transcript ENST00000456328 ... <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
4 chr1 10159 A AC upstream_gene_variant MODIFIER DDX11L2 ENSG00000290825 Transcript ENST00000456328 ... <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
9986 chr1 664707 T C intron_variant&non_coding_transcript_variant MODIFIER <NA> ENSG00000230021 Transcript ENST00000635509 ... 0 0.0002242 0 0 0 0 0 <NA> <NA> <NA>
9987 chr1 664724 G A intron_variant&non_coding_transcript_variant MODIFIER <NA> ENSG00000230021 Transcript ENST00000635509 ... <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>
9988 chr1 664772 G T intron_variant&non_coding_transcript_variant MODIFIER <NA> ENSG00000230021 Transcript ENST00000635509 ... 0 0 0 0 0 0 0 <NA> <NA> <NA>
9989 chr1 664793 G A intron_variant&non_coding_transcript_variant MODIFIER <NA> ENSG00000230021 Transcript ENST00000635509 ... 0 0.0004803 0 0 8.331e-05 0 0 <NA> <NA> <NA>
9990 chr1 664808 A G intron_variant&non_coding_transcript_variant MODIFIER <NA> ENSG00000230021 Transcript ENST00000635509 ... <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA> <NA>

9991 rows × 45 columns

Design an array schema, and create the TileDB array.

  • Python
ctx = tiledb.cloud.Ctx()
zstd_filter = tiledb.FilterList([tiledb.ZstdFilter()])
double_delta_zstd_filter = tiledb.FilterList(
    [tiledb.DoubleDeltaFilter(), tiledb.ZstdFilter()]
)

schema = tiledb.ArraySchema(
    domain=tiledb.Domain(
        *[
            tiledb.Dim(
                name="contig",
                domain=(None, None),
                tile="None",
                dtype="|S0",
                var=True,
                filters=zstd_filter,
            ),
            tiledb.Dim(
                name="pos_start",
                domain=(0, np.iinfo(np.uint32).max - 1),
                tile=np.iinfo(np.uint32).max,
                dtype="uint32",
                filters=double_delta_zstd_filter,
            ),
        ]
    ),
    attrs=[
        tiledb.Attr(
            name="ref",
            dtype="ascii",
            var=True,
            nullable=False,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="alt",
            dtype="ascii",
            var=True,
            nullable=False,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="Gene",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="Feature",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="Feature_type",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="Consequence",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="cDNA_position",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="CDS_position",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="Protein_position",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="Amino_acids",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="Codons",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="Existing_variation",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="IMPACT",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="SYMBOL",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="BIOTYPE",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="EXON",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="INTRON",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="HGVSc",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="HGVSp",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="HGVSg",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="HGVS_OFFSET",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="REF_ALLELE",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="DISTANCE",
            dtype="int32",
            var=False,
            nullable=True,
            filters=double_delta_zstd_filter,
        ),
        tiledb.Attr(
            name="STRAND",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="FLAGS",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="VARIANT_CLASS",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="SYMBOL_SOURCE",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="HGNC_ID",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="CCDS",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_AFR_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_AMI_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_AMR_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_ASJ_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_EAS_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_FIN_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_MID_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_NFE_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_OTH_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="gnomADg_SAS_AF",
            dtype=np.float32,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="CLIN_SIG",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="SOMATIC",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
        tiledb.Attr(
            name="PHENO",
            dtype="ascii",
            var=True,
            nullable=True,
            filters=zstd_filter,
        ),
    ],
    cell_order="row-major",
    tile_order="row-major",
    capacity=10000,
    sparse=True,
    allows_duplicates=True,
    ctx=ctx,
)

# Create array
tiledb.Array.create(array_name, schema)

Clean the DataFrame, casting pandas data types in order to conform to the TileDB schema data types.

  • Python
df.rename(
    columns={"CHROM": "contig", "POS": "pos_start", "REF": "ref", "ALT": "alt"},
    inplace=True,
)
df["contig"] = df["contig"].astype(str)
df["pos_start"] = df["pos_start"].astype(np.uint32)
df["ref"] = df["ref"].astype(str)
df["alt"] = df["alt"].astype(str)

df["DISTANCE"] = df["DISTANCE"].astype(object).fillna(0).astype(np.int32)

for gnoval in [
    "gnomADg_AF",
    "gnomADg_AFR_AF",
    "gnomADg_AMI_AF",
    "gnomADg_AMR_AF",
    "gnomADg_ASJ_AF",
    "gnomADg_EAS_AF",
    "gnomADg_FIN_AF",
    "gnomADg_MID_AF",
    "gnomADg_NFE_AF",
    "gnomADg_OTH_AF",
    "gnomADg_SAS_AF",
]:
    df[gnoval] = df[gnoval].astype(str).str.replace("e-", "E-")
    df[gnoval] = df[gnoval].replace("<NA>", np.nan)
    df[gnoval] = df[gnoval].astype(object).astype(np.float32)

Set the index of the DataFrame to the match the TileDB dimensions.

  • Python
vep_dims = ["contig", "pos_start"]
df = df.set_index(["contig", "pos_start"])

Ingest the DataFrame into the TileDB array using from_pandas.

  • Python
tiledb.from_pandas(array_name, df, mode="append", index_dims=vep_dims, ctx=ctx)

Filter the TileDB array for variants with the gnomAD global allele frequency of less than 0.0001.

  • Python
my_vep = tiledb.open(array_name)
res = my_vep.query(cond="(gnomADg_AF < 0.0001)")
res.df[:]
contig pos_start ref alt Gene Feature Feature_type Consequence cDNA_position CDS_position ... gnomADg_ASJ_AF gnomADg_EAS_AF gnomADg_FIN_AF gnomADg_MID_AF gnomADg_NFE_AF gnomADg_OTH_AF gnomADg_SAS_AF CLIN_SIG SOMATIC PHENO
0 chr1 10109 A T ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
1 chr1 10228 TA T ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
2 chr1 10243 A G ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
3 chr1 10254 TA CA ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... NaN 0.000000 0.0 NaN 0.000000 NaN 0.0 None None None
4 chr1 10292 A T ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2389 chr1 664602 A G ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
2390 chr1 664652 T A ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
2391 chr1 664707 T C ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000224 0.0 0.0 0.000000 0.0 0.0 None None None
2392 chr1 664772 G T ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
2393 chr1 664793 G A ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000480 0.0 0.0 0.000083 0.0 0.0 None None None

2394 rows × 45 columns

Clean up the TileDB array and TSV file.

  • Python
my_vep = tiledb.open(array_name)
res = my_vep.query(cond="(gnomADg_AF < 0.0001)")
res.df[:]
contig pos_start ref alt Gene Feature Feature_type Consequence cDNA_position CDS_position ... gnomADg_ASJ_AF gnomADg_EAS_AF gnomADg_FIN_AF gnomADg_MID_AF gnomADg_NFE_AF gnomADg_OTH_AF gnomADg_SAS_AF CLIN_SIG SOMATIC PHENO
0 chr1 10109 A T ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
1 chr1 10228 TA T ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
2 chr1 10243 A G ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
3 chr1 10254 TA CA ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... NaN 0.000000 0.0 NaN 0.000000 NaN 0.0 None None None
4 chr1 10292 A T ENSG00000290825 ENST00000456328 Transcript upstream_gene_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2389 chr1 664602 A G ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
2390 chr1 664652 T A ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
2391 chr1 664707 T C ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000224 0.0 0.0 0.000000 0.0 0.0 None None None
2392 chr1 664772 G T ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 None None None
2393 chr1 664793 G A ENSG00000230021 ENST00000635509 Transcript intron_variant&non_coding_transcript_variant None None ... 0.0 0.000480 0.0 0.0 0.000083 0.0 0.0 None None None

2394 rows × 45 columns

Annotation VCFs
Variant Statistics