Class: Rafflesia::HomologySearches

Inherits:
Object
  • Object
show all
Defined in:
lib/rafflesia/homology_searches.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ HomologySearches

Returns a new instance of HomologySearches.



9
10
11
# File 'lib/rafflesia/homology_searches.rb', line 9

def initialize(client)
  @client = client
end

Instance Method Details

#create(database_id:, query:, background: nil, database_release_alias: nil, database_release_id: nil, metadata: nil, mode: nil, parameters: nil, query_context_id: nil, search_profile: nil, request_options: {}) ⇒ Rafflesia::EnvelopeHomologySearch

POST /v1/homology_searches

Parameters:

  • background (Boolean, nil) (defaults to: nil)

    When true, enqueue durable background execution and return a queued search. Requires the serving database to run the shared durable request plane and a standalone search worker; a deployment without them refuses with 503 background_search_unavailable rather than running the search synchronously. Not offered by the rafflesia CLI for that reason.

  • database_id (String)

    Opaque db_ database id to search.

  • database_release_alias (String, nil) (defaults to: nil)

    Optional release alias; omit both selectors to use the database default.

  • database_release_id (String, nil) (defaults to: nil)

    Optional immutable dbr_ release id.

  • metadata (Hash{String => Object}, nil) (defaults to: nil)

    Caller metadata echoed on the search.

  • mode (String, nil) (defaults to: nil)

    Result mode: candidates or verified. Defaults to verified.

  • parameters (Object, nil) (defaults to: nil)

    Optional explicit resource budgets and planner policy; forwarded to the serving database unchanged.

  • query (Rafflesia::HomologyQuery)

    The query sequence.

  • query_context_id (String, nil) (defaults to: nil)

    Optional qctx_ preflight identity returned by query-context measure; the serving database rejects drift.

  • search_profile (String, nil) (defaults to: nil)

    Operating profile: economic, balanced, or sensitive. Defaults to balanced.

  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/rafflesia/homology_searches.rb', line 26

def create(
  database_id:,
  query:,
  background: nil,
  database_release_alias: nil,
  database_release_id: nil,
  metadata: nil,
  mode: nil,
  parameters: nil,
  query_context_id: nil,
  search_profile: nil,
  request_options: {}
)
  body = {
    'background' => background,
    'database_id' => database_id,
    'database_release_alias' => database_release_alias,
    'database_release_id' => database_release_id,
    'metadata' => ,
    'mode' => mode,
    'parameters' => parameters,
    'query' => query,
    'query_context_id' => query_context_id,
    'search_profile' => search_profile
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/homology_searches',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeHomologySearch.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end

#get(homology_search_id:, include_results: true, request_options: {}) ⇒ Rafflesia::EnvelopeHomologySearch

GET /v1/homology_searches/homology_search_id

Parameters:

  • homology_search_id (String)
  • include_results (Boolean, nil) (defaults to: true)
  • request_options (Hash) (defaults to: {})

    (see Rafflesia::Types::RequestOptions)

Returns:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/rafflesia/homology_searches.rb', line 68

def get(
  homology_search_id:,
  include_results: true,
  request_options: {}
)
  params = {
    'include_results' => include_results
  }.compact
  response = @client.request(
    method: :get,
    path: "/v1/homology_searches/#{Rafflesia::Util.encode_path(homology_search_id)}",
    auth: true,
    params: params,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeHomologySearch.new(response.body)
  result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
  result
end