Current section

Files

Jump to
google_api_genomics lib google_api genomics v1 api variants.ex
Raw

lib/google_api/genomics/v1/api/variants.ex

# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule GoogleApi.Genomics.V1.Api.Variants do
@moduledoc """
API calls for all endpoints tagged `Variants`.
"""
alias GoogleApi.Genomics.V1.Connection
import GoogleApi.Genomics.V1.RequestBuilder
@doc """
Creates a new variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
## Parameters
- connection (GoogleApi.Genomics.V1.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :access_token (String): OAuth access token.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :bearer_token (String): OAuth bearer token.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :body (Variant):
## Returns
{:ok, %GoogleApi.Genomics.V1.Model.Variant{}} on success
{:error, info} on failure
"""
@spec genomics_variants_create(Tesla.Env.client, keyword()) :: {:ok, GoogleApi.Genomics.V1.Model.Variant.t} | {:error, Tesla.Env.t}
def genomics_variants_create(connection, opts \\ []) do
optional_params = %{
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"access_token" => :query,
:"key" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"bearer_token" => :query,
:"oauth_token" => :query,
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"body" => :body
}
%{}
|> method(:post)
|> url("/v1/variants")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Genomics.V1.Model.Variant{})
end
@doc """
Deletes a variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
## Parameters
- connection (GoogleApi.Genomics.V1.Connection): Connection to server
- variant_id (String): The ID of the variant to be deleted.
- opts (KeywordList): [optional] Optional parameters
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :access_token (String): OAuth access token.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :bearer_token (String): OAuth bearer token.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
## Returns
{:ok, %GoogleApi.Genomics.V1.Model.Empty{}} on success
{:error, info} on failure
"""
@spec genomics_variants_delete(Tesla.Env.client, String.t, keyword()) :: {:ok, GoogleApi.Genomics.V1.Model.Empty.t} | {:error, Tesla.Env.t}
def genomics_variants_delete(connection, variant_id, opts \\ []) do
optional_params = %{
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"access_token" => :query,
:"key" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"bearer_token" => :query,
:"oauth_token" => :query,
:"upload_protocol" => :query,
:"prettyPrint" => :query
}
%{}
|> method(:delete)
|> url("/v1/variants/{variantId}", %{
"variantId" => URI.encode_www_form(variant_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Genomics.V1.Model.Empty{})
end
@doc """
Gets a variant by ID. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
## Parameters
- connection (GoogleApi.Genomics.V1.Connection): Connection to server
- variant_id (String): The ID of the variant.
- opts (KeywordList): [optional] Optional parameters
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :access_token (String): OAuth access token.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :bearer_token (String): OAuth bearer token.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
## Returns
{:ok, %GoogleApi.Genomics.V1.Model.Variant{}} on success
{:error, info} on failure
"""
@spec genomics_variants_get(Tesla.Env.client, String.t, keyword()) :: {:ok, GoogleApi.Genomics.V1.Model.Variant.t} | {:error, Tesla.Env.t}
def genomics_variants_get(connection, variant_id, opts \\ []) do
optional_params = %{
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"access_token" => :query,
:"key" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"bearer_token" => :query,
:"oauth_token" => :query,
:"upload_protocol" => :query,
:"prettyPrint" => :query
}
%{}
|> method(:get)
|> url("/v1/variants/{variantId}", %{
"variantId" => URI.encode_www_form(variant_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Genomics.V1.Model.Variant{})
end
@doc """
Creates variant data by asynchronously importing the provided information. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The variants for import will be merged with any existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and Variant info fields are merged as specified in infoMergeConfig. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set.
## Parameters
- connection (GoogleApi.Genomics.V1.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :access_token (String): OAuth access token.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :bearer_token (String): OAuth bearer token.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :body (ImportVariantsRequest):
## Returns
{:ok, %GoogleApi.Genomics.V1.Model.Operation{}} on success
{:error, info} on failure
"""
@spec genomics_variants_import(Tesla.Env.client, keyword()) :: {:ok, GoogleApi.Genomics.V1.Model.Operation.t} | {:error, Tesla.Env.t}
def genomics_variants_import(connection, opts \\ []) do
optional_params = %{
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"access_token" => :query,
:"key" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"bearer_token" => :query,
:"oauth_token" => :query,
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"body" => :body
}
%{}
|> method(:post)
|> url("/v1/variants:import")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Genomics.V1.Model.Operation{})
end
@doc """
Merges the given variants with existing variants. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant. Variant info fields are merged as specified in the infoMergeConfig field of the MergeVariantsRequest. Please exercise caution when using this method! It is easy to introduce mistakes in existing variants and difficult to back out of them. For example, suppose you were trying to merge a new variant with an existing one and both variants contain calls that belong to callsets with the same callset ID. // Existing variant - irrelevant fields trimmed for clarity { \"variantSetId\": \"10473108253681171589\", \"referenceName\": \"1\", \"start\": \"10582\", \"referenceBases\": \"G\", \"alternateBases\": [ \"A\" ], \"calls\": [ { \"callSetId\": \"10473108253681171589-0\", \"callSetName\": \"CALLSET0\", \"genotype\": [ 0, 1 ], } ] } // New variant with conflicting call information { \"variantSetId\": \"10473108253681171589\", \"referenceName\": \"1\", \"start\": \"10582\", \"referenceBases\": \"G\", \"alternateBases\": [ \"A\" ], \"calls\": [ { \"callSetId\": \"10473108253681171589-0\", \"callSetName\": \"CALLSET0\", \"genotype\": [ 1, 1 ], } ] } The resulting merged variant would overwrite the existing calls with those from the new variant: { \"variantSetId\": \"10473108253681171589\", \"referenceName\": \"1\", \"start\": \"10582\", \"referenceBases\": \"G\", \"alternateBases\": [ \"A\" ], \"calls\": [ { \"callSetId\": \"10473108253681171589-0\", \"callSetName\": \"CALLSET0\", \"genotype\": [ 1, 1 ], } ] } This may be the desired outcome, but it is up to the user to determine if if that is indeed the case.
## Parameters
- connection (GoogleApi.Genomics.V1.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :access_token (String): OAuth access token.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :bearer_token (String): OAuth bearer token.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :body (MergeVariantsRequest):
## Returns
{:ok, %GoogleApi.Genomics.V1.Model.Empty{}} on success
{:error, info} on failure
"""
@spec genomics_variants_merge(Tesla.Env.client, keyword()) :: {:ok, GoogleApi.Genomics.V1.Model.Empty.t} | {:error, Tesla.Env.t}
def genomics_variants_merge(connection, opts \\ []) do
optional_params = %{
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"access_token" => :query,
:"key" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"bearer_token" => :query,
:"oauth_token" => :query,
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"body" => :body
}
%{}
|> method(:post)
|> url("/v1/variants:merge")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Genomics.V1.Model.Empty{})
end
@doc """
Updates a variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics. Returns the modified variant without its calls.
## Parameters
- connection (GoogleApi.Genomics.V1.Connection): Connection to server
- variant_id (String): The ID of the variant to be updated.
- opts (KeywordList): [optional] Optional parameters
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :access_token (String): OAuth access token.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :bearer_token (String): OAuth bearer token.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :update_mask (String): An optional mask specifying which fields to update. At this time, mutable fields are names and info. Acceptable values are \"names\" and \"info\". If unspecified, all mutable fields will be updated.
- :body (Variant):
## Returns
{:ok, %GoogleApi.Genomics.V1.Model.Variant{}} on success
{:error, info} on failure
"""
@spec genomics_variants_patch(Tesla.Env.client, String.t, keyword()) :: {:ok, GoogleApi.Genomics.V1.Model.Variant.t} | {:error, Tesla.Env.t}
def genomics_variants_patch(connection, variant_id, opts \\ []) do
optional_params = %{
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"access_token" => :query,
:"key" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"bearer_token" => :query,
:"oauth_token" => :query,
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"updateMask" => :query,
:"body" => :body
}
%{}
|> method(:patch)
|> url("/v1/variants/{variantId}", %{
"variantId" => URI.encode_www_form(variant_id)
})
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Genomics.V1.Model.Variant{})
end
@doc """
Gets a list of variants matching the criteria. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126).
## Parameters
- connection (GoogleApi.Genomics.V1.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :fields (String): Selector specifying which fields to include in a partial response.
- :upload_type (String): Legacy upload protocol for media (e.g. \"media\", \"multipart\").
- :__/xgafv (String): V1 error format.
- :callback (String): JSONP
- :alt (String): Data format for response.
- :access_token (String): OAuth access token.
- :key (String): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- :quota_user (String): Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- :pp (Boolean): Pretty-print response.
- :bearer_token (String): OAuth bearer token.
- :oauth_token (String): OAuth 2.0 token for the current user.
- :upload_protocol (String): Upload protocol for media (e.g. \"raw\", \"multipart\").
- :pretty_print (Boolean): Returns response with indentations and line breaks.
- :body (SearchVariantsRequest):
## Returns
{:ok, %GoogleApi.Genomics.V1.Model.SearchVariantsResponse{}} on success
{:error, info} on failure
"""
@spec genomics_variants_search(Tesla.Env.client, keyword()) :: {:ok, GoogleApi.Genomics.V1.Model.SearchVariantsResponse.t} | {:error, Tesla.Env.t}
def genomics_variants_search(connection, opts \\ []) do
optional_params = %{
:"fields" => :query,
:"uploadType" => :query,
:"$.xgafv" => :query,
:"callback" => :query,
:"alt" => :query,
:"access_token" => :query,
:"key" => :query,
:"quotaUser" => :query,
:"pp" => :query,
:"bearer_token" => :query,
:"oauth_token" => :query,
:"upload_protocol" => :query,
:"prettyPrint" => :query,
:"body" => :body
}
%{}
|> method(:post)
|> url("/v1/variants/search")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%GoogleApi.Genomics.V1.Model.SearchVariantsResponse{})
end
end