

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# AWS HealthOmics バリアントストアと注釈ストアの可用性の変更
<a name="variant-store-availability-change"></a>

慎重に検討した結果、2025 年 11 月 7 日以降、新しいお客様に AWS HealthOmics バリアントストアと注釈ストアを閉鎖することを決定しました。既存のお客様は、通常どおりサービスを引き続き使用できます。

次のセクションでは、バリアントストアと分析ストアを新しいソリューションに移行するための移行オプションについて説明します。ご質問やご不明点がございましたら、[support.console.aws.amazon.com でサポートケースを作成してください。](https://support.console.aws.amazon.com)

**Topics**
+ [移行オプションの概要](#migrate-variant-store)
+ [ETL ロジックの移行オプション](#migrate-variant-store-etl-logic)
+ [ストレージの移行オプション](#migrate-variant-store-storage)
+ [分析](#migrate-variant-store-analytics)
+ [AWS パートナー](#migrate-variant-store-partners)
+ [例](#migrate-variant-store-examples)

## 移行オプションの概要
<a name="migrate-variant-store"></a>

次の移行オプションは、バリアントストアと注釈ストアを使用する代わりに使用できます。

1. GitHub で ETL ロジックの HealthOmics 提供のリファレンス実装を使用します。 [https://github.com/aws-samples/aws-healthomics-tutorials/tree/main/glue-variant-etl](https://github.com/aws-samples/aws-healthomics-tutorials/tree/main/glue-variant-etl)

   ストレージに S3 テーブルバケットを使用し、既存の AWS 分析サービスを引き続き使用します。

1. 既存の AWS サービスを組み合わせてソリューションを作成します。

   ETL では、カスタム Glue ETL ジョブを記述したり、EMR でオープンソースの HAIL または GLOW コードを使用してバリアントデータを変換したりできます。

   ストレージに S3 テーブルバケットを使用し、既存の AWS 分析サービスを引き続き使用する 

1. バリアントと注釈ストアの代替を提供する[AWS パートナー](https://aws.amazon.com/partners/work-with-partners/)を選択します。

## ETL ロジックの移行オプション
<a name="migrate-variant-store-etl-logic"></a>

ETL ロジックでは、次の移行オプションを検討してください。

1. HealthOmics は、バリアントストア ETL パイプラインのソースコードを GitHub のリファレンス実装として提供します。このパイプラインを使用して、バリアントストアと同じバリアントデータ ETL プロセスを強化できますが、ETL ロジックを完全に制御できます。詳細については、GitHub の[「Glue Variant ETL](https://github.com/aws-samples/aws-healthomics-tutorials/tree/main/glue-variant-etl)」を参照してください。

1. バリアントデータを変換するには、カスタム Glue ETL ジョブを記述するか、EMR でオープンソースの HAIL または GLOW コードを使用できます。

## ストレージの移行オプション
<a name="migrate-variant-store-storage"></a>

サービスホスト型データストアの代わりに、Amazon S3 テーブルバケットを使用してカスタムテーブルスキーマを定義できます。テーブルバケットの詳細については、*Amazon S3ユーザーガイド*」の[「テーブルバケット](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets.html)」を参照してください。

Amazon S3 のフルマネージド Iceberg テーブルには、テーブルバケットを使用できます。

サポート[ケース](http://support.console.aws.amazon.com.)を発行して、HealthOmics チームにバリアントまたは注釈ストアから設定した Amazon S3 テーブルバケットにデータを移行するようにリクエストできます。

Amazon S3 テーブルバケットにデータが入力されたら、バリアントストアと注釈ストアを削除できます。詳細については、[HealthOmics 分析ストアの削除」を参照してください。](https://docs.aws.amazon.com/omics/latest/dev/deleting-a-store-examples.html)

## 分析
<a name="migrate-variant-store-analytics"></a>

データ分析では、Amazon [Amazon Athena](https://docs.aws.amazon.com/athena) [EMR、Amazon](https://docs.aws.amazon.com/emr) [Redshift](https://docs.aws.amazon.com/redshift)、[Amazon Quick](https://docs.aws.amazon.com/quicksight) などの AWS 分析サービスを引き続き使用します。

## AWS パートナー
<a name="migrate-variant-store-partners"></a>

カスタマイズ可能な ETL、テーブルスキーマ、組み込みクエリおよび分析ツール、データを操作するためのユーザーインターフェイスを提供する [AWS パートナー](https://aws.amazon.com/partners/work-with-partners/)と連携できます。

## 例
<a name="migrate-variant-store-examples"></a>

次の例は、VPC および GVCF データの保存に適したテーブルを作成する方法を示しています。

### Athena DDL
<a name="migrate-variant-store-athena"></a>

Athena で次の DDL の例を使用して、VPC と GVCF データを 1 つのテーブルに保存するための適切なテーブルを作成できます。この例はバリアントストア構造とまったく同じではありませんが、一般的なユースケースに適しています。

テーブルを作成するときに、DATABASE\$1NAME と TABLE\$1NAME の独自の値を作成します。

```
 CREATE TABLE <DATABASE_NAME>. <TABLE_NAME> (
  sample_name string,
  variant_name string COMMENT 'The ID field in VCF files, '.' indicates no name',
  chrom string,
  pos bigint,
  ref string,
  alt array <string>,
  qual double,
  filter string,
  genotype string,
  info map <string, string>,
  attributes map <string, string>,
  is_reference_block boolean COMMENT 'Used in GVCF for non-variant sites')
PARTITIONED BY (bucket(128, sample_name), chrom)
LOCATION '{URL}/'
TBLPROPERTIES (
  'table_type'='iceberg',
  'write_compression'='zstd'
);
```

### Python を使用してテーブルを作成する (Athena なし)
<a name="migrate-variant-store-python"></a>

次の Python コード例は、Athena を使用せずにテーブルを作成する方法を示しています。

```
 import boto3
from pyiceberg.catalog import Catalog, load_catalog
from pyiceberg.schema import Schema
from pyiceberg.table import Table
from pyiceberg.table.sorting import SortOrder, SortField, SortDirection, NullOrder
from pyiceberg.partitioning import PartitionSpec, PartitionField
from pyiceberg.transforms import IdentityTransform, BucketTransform
from pyiceberg.types import (
    NestedField,
    StringType,
    LongType,
    DoubleType,
    MapType,
    BooleanType,
    ListType
)


def load_s3_tables_catalog(bucket_arn: str) -> Catalog:
    session = boto3.session.Session()
    region = session.region_name or 'us-east-1'
    
    catalog_config = {
        "type": "rest",
        "warehouse": bucket_arn,
        "uri": f"https://s3tables.{region}.amazonaws.com/iceberg",
        "rest.sigv4-enabled": "true",
        "rest.signing-name": "s3tables",
        "rest.signing-region": region
    }
    
    return load_catalog("s3tables", **catalog_config)


def create_namespace(catalog: Catalog, namespace: str) -> None:
    try:
        catalog.create_namespace(namespace)
        print(f"Created namespace: {namespace}")
    except Exception as e:
        if "already exists" in str(e):
            print(f"Namespace {namespace} already exists.")
        else:
            raise e


def create_table(catalog: Catalog, namespace: str, table_name: str, schema: Schema, 
                partition_spec: PartitionSpec = None, sort_order: SortOrder = None) -> Table:
    if catalog.table_exists(f"{namespace}.{table_name}"):
        print(f"Table {namespace}.{table_name} already exists.")
        return catalog.load_table(f"{namespace}.{table_name}")
    
    create_table_args = {
        "identifier": f"{namespace}.{table_name}",
        "schema": schema,
        "properties": {"format-version": "2"}
    }
    
    if partition_spec is not None:
        create_table_args["partition_spec"] = partition_spec
    if sort_order is not None:
        create_table_args["sort_order"] = sort_order
    
    table = catalog.create_table(**create_table_args)
    print(f"Created table: {namespace}.{table_name}")
    return table


def main(bucket_arn: str, namespace: str, table_name: str):
    # Schema definition
    genomic_variants_schema = Schema(
        NestedField(1, "sample_name", StringType(), required=True),
        NestedField(2, "variant_name", StringType(), required=True),
        NestedField(3, "chrom", StringType(), required=True),
        NestedField(4, "pos", LongType(), required=True),
        NestedField(5, "ref", StringType(), required=True),
        NestedField(6, "alt", ListType(element_id=1000, element_type=StringType(), element_required=True), required=True),
        NestedField(7, "qual", DoubleType()),
        NestedField(8, "filter", StringType()),
        NestedField(9, "genotype", StringType()),
        NestedField(10, "info", MapType(key_type=StringType(), key_id=1001, value_type=StringType(), value_id=1002)),
        NestedField(11, "attributes", MapType(key_type=StringType(), key_id=2001, value_type=StringType(), value_id=2002)),
        NestedField(12, "is_reference_block", BooleanType()),
        identifier_field_ids=[1, 2, 3, 4]
    )
    
    # Partition and sort specifications
    partition_spec = PartitionSpec(
        PartitionField(source_id=1, field_id=1001, transform=BucketTransform(128), name="sample_bucket"),
        PartitionField(source_id=3, field_id=1002, transform=IdentityTransform(), name="chrom")
    )
    
    sort_order = SortOrder(
        SortField(source_id=3, transform=IdentityTransform(), direction=SortDirection.ASC, null_order=NullOrder.NULLS_LAST),
        SortField(source_id=4, transform=IdentityTransform(), direction=SortDirection.ASC, null_order=NullOrder.NULLS_LAST)
    )
    
    # Connect to catalog and create table
    catalog = load_s3_tables_catalog(bucket_arn)
    create_namespace(catalog, namespace)
    table = create_table(catalog, namespace, table_name, genomic_variants_schema, partition_spec, sort_order)
    
    return table


if __name__ == "__main__":
    bucket_arn = 'arn:aws:s3tables:<REGION>:<ACCOUNT_ID>:bucket/<TABLE_BUCKET_NAME'
    namespace = "variant_db"
    table_name = "genomic_variants"
    
    main(bucket_arn, namespace, table_name)
```