Class: Rafflesia::Genomes

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Genomes

Returns a new instance of Genomes.



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

def initialize(client)
  @client = client
end

Instance Method Details

#assembliesShow(assembly_id:, request_options: {}) ⇒ Rafflesia::EnvelopeGenomeAssemblyData

POST /v1/genomes/assemblies/show

Parameters:

  • assembly_id (String)

    Assembly identifier, e.g. GRCh38 or hg38 (case-insensitive, alias-aware).

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

    (see Rafflesia::Types::RequestOptions)

Returns:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rafflesia/genomes.rb', line 17

def assembliesShow(
  assembly_id:,
  request_options: {}
)
  body = {
    'assembly_id' => assembly_id
  }
  response = @client.request(
    method: :post,
    path: '/v1/genomes/assemblies/show',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeGenomeAssemblyData.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

#intervalsComplement(assembly_id:, bed:, request_options: {}) ⇒ Rafflesia::EnvelopeGenomeIntervalsComplementData

POST /v1/genomes/intervals/complement

Parameters:

  • assembly_id (String)

    Assembly identifier (case-insensitive, alias-aware) supplying contig bounds.

  • bed (String)

    BED text for the input interval set (chrom start end [name ...]).

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

    (see Rafflesia::Types::RequestOptions)

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/rafflesia/genomes.rb', line 41

def intervalsComplement(
  assembly_id:,
  bed:,
  request_options: {}
)
  body = {
    'assembly_id' => assembly_id,
    'bed' => bed
  }
  response = @client.request(
    method: :post,
    path: '/v1/genomes/intervals/complement',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeGenomeIntervalsComplementData.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

#intervalsFlank(bed:, left:, right:, assembly_id: nil, request_options: {}) ⇒ Rafflesia::EnvelopeGenomeIntervalsFlankData

POST /v1/genomes/intervals/flank

Parameters:

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

    Optional assembly id used to clamp flanks to contig bounds.

  • bed (String)

    BED text for the input interval set (chrom start end [name ...]).

  • left (Integer)

    Left flank length in base pairs (0 to omit).

  • right (Integer)

    Right flank length in base pairs (0 to omit).

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

    (see Rafflesia::Types::RequestOptions)

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/rafflesia/genomes.rb', line 69

def intervalsFlank(
  bed:,
  left:,
  right:,
  assembly_id: nil,
  request_options: {}
)
  body = {
    'assembly_id' => assembly_id,
    'bed' => bed,
    'left' => left,
    'right' => right
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/genomes/intervals/flank',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeGenomeIntervalsFlankData.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

#intervalsIntersect(a_bed:, b_bed:, a_name: nil, b_name: nil, request_options: {}) ⇒ Rafflesia::EnvelopeGenomeIntervalsIntersectData

POST /v1/genomes/intervals/intersect

Parameters:

  • a_bed (String)

    BED text for the A interval set (chrom start end [name ...]).

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

    Label for the A interval set.

  • b_bed (String)

    BED text for the B interval set (chrom start end [name ...]).

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

    Label for the B interval set.

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

    (see Rafflesia::Types::RequestOptions)

Returns:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/rafflesia/genomes.rb', line 101

def intervalsIntersect(
  a_bed:,
  b_bed:,
  a_name: nil,
  b_name: nil,
  request_options: {}
)
  body = {
    'a_bed' => a_bed,
    'a_name' => a_name,
    'b_bed' => b_bed,
    'b_name' => b_name
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/genomes/intervals/intersect',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeGenomeIntervalsIntersectData.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

#intervalsMerge(bed:, min_gap: nil, request_options: {}) ⇒ Rafflesia::EnvelopeGenomeIntervalsMergeData

POST /v1/genomes/intervals/merge

Parameters:

  • bed (String)

    BED text for the input interval set (chrom start end [name ...]).

  • min_gap (Integer, nil) (defaults to: nil)

    Maximum gap in base pairs between intervals to still merge them (0 merges overlapping or book-ended intervals).

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

    (see Rafflesia::Types::RequestOptions)

Returns:



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/rafflesia/genomes.rb', line 131

def intervalsMerge(
  bed:,
  min_gap: nil,
  request_options: {}
)
  body = {
    'bed' => bed,
    'min_gap' => min_gap
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/genomes/intervals/merge',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeGenomeIntervalsMergeData.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

#intervalsSubtract(a_bed:, b_bed:, a_name: nil, b_name: nil, request_options: {}) ⇒ Rafflesia::EnvelopeGenomeIntervalsSubtractData

POST /v1/genomes/intervals/subtract

Parameters:

  • a_bed (String)

    BED text for the A interval set (chrom start end [name ...]).

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

    Label for the A interval set.

  • b_bed (String)

    BED text for the B interval set (chrom start end [name ...]).

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

    Label for the B interval set.

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

    (see Rafflesia::Types::RequestOptions)

Returns:



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/rafflesia/genomes.rb', line 159

def intervalsSubtract(
  a_bed:,
  b_bed:,
  a_name: nil,
  b_name: nil,
  request_options: {}
)
  body = {
    'a_bed' => a_bed,
    'a_name' => a_name,
    'b_bed' => b_bed,
    'b_name' => b_name
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/genomes/intervals/subtract',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeGenomeIntervalsSubtractData.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

#regionsGet(assembly_id:, region:, request_options: {}) ⇒ Rafflesia::EnvelopeGenomeRegionData

POST /v1/genomes/regions/get

Parameters:

  • assembly_id (String)

    Assembly identifier (case-insensitive, alias-aware).

  • region (String)

    Region string, e.g. chr17:43,044,295-43125483 (1-based inclusive).

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

    (see Rafflesia::Types::RequestOptions)

Returns:



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/rafflesia/genomes.rb', line 189

def regionsGet(
  assembly_id:,
  region:,
  request_options: {}
)
  body = {
    'assembly_id' => assembly_id,
    'region' => region
  }
  response = @client.request(
    method: :post,
    path: '/v1/genomes/regions/get',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeGenomeRegionData.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

#variantsAnnotate(path:, sources:, database: nil, output_format: nil, output_relation: nil, partition_by: nil, preview_limit: nil, relation: nil, release: nil, sort_by: nil, request_options: {}) ⇒ Rafflesia::EnvelopeVariantAnnotateData

POST /v1/genomes/variants/annotate

Parameters:

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

    Database name published with the relation

  • output_format (Rafflesia::Types::VariantAnnotateRequestOutputFormat, nil) (defaults to: nil)

    Requested durable relation format; parquet is the initial physical format

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

    Local output path or alias for a durable relation artifact

  • partition_by (Array<String>, nil) (defaults to: nil)

    Requested physical partition columns

  • path (String)

    Path to a VCF file readable by the server.

  • preview_limit (Integer, nil) (defaults to: nil)

    When output_relation is requested, include at most this many rows as a non-pageable preview

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

    Requested logical relation name

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

    Immutable database release published with the relation

  • sort_by (Array<String>, nil) (defaults to: nil)

    Requested physical sort columns

  • sources (Array<String>, nil)

    Annotation source names to query, e.g. clinvar, gnomad.

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

    (see Rafflesia::Types::RequestOptions)

Returns:



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/rafflesia/genomes.rb', line 223

def variantsAnnotate(
  path:,
  sources:,
  database: nil,
  output_format: nil,
  output_relation: nil,
  partition_by: nil,
  preview_limit: nil,
  relation: nil,
  release: nil,
  sort_by: nil,
  request_options: {}
)
  body = {
    'database' => database,
    'output_format' => output_format,
    'output_relation' => output_relation,
    'partition_by' => partition_by,
    'path' => path,
    'preview_limit' => preview_limit,
    'relation' => relation,
    'release' => release,
    'sort_by' => sort_by,
    'sources' => sources
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/genomes/variants/annotate',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeVariantAnnotateData.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

#variantsMap(path:, to:, assembly: nil, database: nil, output_format: nil, output_relation: nil, partition_by: nil, preview_limit: nil, relation: nil, release: nil, sort_by: nil, request_options: {}) ⇒ Rafflesia::EnvelopeVariantMapGenomicData

POST /v1/genomes/variants/map

Parameters:

  • assembly (Rafflesia::Types::VariantMapGenomicRequestAssembly, nil) (defaults to: nil)

    Reference assembly id.

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

    Database name published with the relation

  • output_format (Rafflesia::Types::VariantMapGenomicRequestOutputFormat, nil) (defaults to: nil)

    Requested durable relation format; parquet is the initial physical format

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

    Local output path or alias for a durable relation artifact

  • partition_by (Array<String>, nil) (defaults to: nil)

    Requested physical partition columns

  • path (String)

    Path to a VCF file readable by the server.

  • preview_limit (Integer, nil) (defaults to: nil)

    When output_relation is requested, include at most this many rows as a non-pageable preview

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

    Requested logical relation name

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

    Immutable database release published with the relation

  • sort_by (Array<String>, nil) (defaults to: nil)

    Requested physical sort columns

  • to (Rafflesia::Types::VariantMapGenomicRequestTo)

    Mapping target: transcripts or proteins.

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

    (see Rafflesia::Types::RequestOptions)

Returns:



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/rafflesia/genomes.rb', line 274

def variantsMap(
  path:,
  to:,
  assembly: nil,
  database: nil,
  output_format: nil,
  output_relation: nil,
  partition_by: nil,
  preview_limit: nil,
  relation: nil,
  release: nil,
  sort_by: nil,
  request_options: {}
)
  body = {
    'assembly' => assembly,
    'database' => database,
    'output_format' => output_format,
    'output_relation' => output_relation,
    'partition_by' => partition_by,
    'path' => path,
    'preview_limit' => preview_limit,
    'relation' => relation,
    'release' => release,
    'sort_by' => sort_by,
    'to' => to
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/genomes/variants/map',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeVariantMapGenomicData.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

#variantsNearby(features:, path:, request_options: {}) ⇒ Rafflesia::EnvelopeVariantNearbyData

POST /v1/genomes/variants/nearby

Parameters:

  • features (Array<String>, nil)

    Genome/structure feature classes: exons, pockets, interfaces.

  • path (String)

    Path to a VCF file readable by the server.

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

    (see Rafflesia::Types::RequestOptions)

Returns:



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/rafflesia/genomes.rb', line 318

def variantsNearby(
  features:,
  path:,
  request_options: {}
)
  body = {
    'features' => features,
    'path' => path
  }
  response = @client.request(
    method: :post,
    path: '/v1/genomes/variants/nearby',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeVariantNearbyData.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

#variantsNormalize(path:, assembly: nil, database: nil, output_format: nil, output_relation: nil, partition_by: nil, preview_limit: nil, relation: nil, release: nil, sort_by: nil, request_options: {}) ⇒ Rafflesia::EnvelopeVariantNormalizeData

POST /v1/genomes/variants/normalize

Parameters:

  • assembly (Rafflesia::Types::VariantNormalizeRequestAssembly, nil) (defaults to: nil)

    Reference assembly id, e.g. GRCh38.

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

    Database name published with the relation

  • output_format (Rafflesia::Types::VariantNormalizeRequestOutputFormat, nil) (defaults to: nil)

    Requested durable relation format; parquet is the initial physical format

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

    Local output path or alias for a durable relation artifact

  • partition_by (Array<String>, nil) (defaults to: nil)

    Requested physical partition columns

  • path (String)

    Path to a VCF file readable by the server.

  • preview_limit (Integer, nil) (defaults to: nil)

    When output_relation is requested, include at most this many rows as a non-pageable preview

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

    Requested logical relation name

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

    Immutable database release published with the relation

  • sort_by (Array<String>, nil) (defaults to: nil)

    Requested physical sort columns

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

    (see Rafflesia::Types::RequestOptions)

Returns:



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/rafflesia/genomes.rb', line 352

def variantsNormalize(
  path:,
  assembly: nil,
  database: nil,
  output_format: nil,
  output_relation: nil,
  partition_by: nil,
  preview_limit: nil,
  relation: nil,
  release: nil,
  sort_by: nil,
  request_options: {}
)
  body = {
    'assembly' => assembly,
    'database' => database,
    'output_format' => output_format,
    'output_relation' => output_relation,
    'partition_by' => partition_by,
    'path' => path,
    'preview_limit' => preview_limit,
    'relation' => relation,
    'release' => release,
    'sort_by' => sort_by
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/genomes/variants/normalize',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeVariantNormalizeData.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

#variantsQuery(chrom:, end_:, file:, start:, region: nil, request_options: {}) ⇒ Rafflesia::EnvelopeVariantQueryData

POST /v1/genomes/variants/query

Parameters:

  • chrom (String)

    Sequence/contig name to query, e.g. chr1 or 1

  • end (Integer)

    1-based inclusive end coordinate

  • file (String)

    Local bgzipped, tabix-indexed VCF path (.vcf.gz); its .tbi/.csi index must sit beside it

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

    Optional combined region string :-; chrom/start/end take precedence when set

  • start (Integer)

    1-based inclusive start coordinate

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

    (see Rafflesia::Types::RequestOptions)

Returns:



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/rafflesia/genomes.rb', line 397

def variantsQuery(
  chrom:,
  end_:,
  file:,
  start:,
  region: nil,
  request_options: {}
)
  body = {
    'chrom' => chrom,
    'end' => end_,
    'file' => file,
    'region' => region,
    'start' => start
  }.compact
  response = @client.request(
    method: :post,
    path: '/v1/genomes/variants/query',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeVariantQueryData.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

#variantsSplit(path:, request_options: {}) ⇒ Rafflesia::EnvelopeVariantSplitData

POST /v1/genomes/variants/split

Parameters:

  • path (String)

    Path to a VCF file readable by the server.

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

    (see Rafflesia::Types::RequestOptions)

Returns:



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/rafflesia/genomes.rb', line 428

def variantsSplit(
  path:,
  request_options: {}
)
  body = {
    'path' => path
  }
  response = @client.request(
    method: :post,
    path: '/v1/genomes/variants/split',
    auth: true,
    body: body,
    request_options: request_options
  )
  result = Rafflesia::EnvelopeVariantSplitData.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