Debian Codegraph @

third_party/googleapis/google/genomics/v1/reads.proto

raw
1 // Copyright 2016 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 syntax = "proto3";
16
17 package google.genomics.v1;
18
19 import "google/api/annotations.proto";
20 import "google/genomics/v1/range.proto";
21 import "google/genomics/v1/readalignment.proto";
22 import "google/genomics/v1/readgroupset.proto";
23 import "google/longrunning/operations.proto";
24 import "google/protobuf/empty.proto";
25 import "google/protobuf/field_mask.proto";
26
27 option cc_enable_arenas = true;
28 option go_package = "google.golang.org/genproto/googleapis/genomics/v1;genomics";
29 option java_multiple_files = true;
30 option java_outer_classname = "ReadsProto";
31 option java_package = "com.google.genomics.v1";
32
33
34 service StreamingReadService {
35 // Returns a stream of all the reads matching the search request, ordered
36 // by reference name, position, and ID.
37 rpc StreamReads(StreamReadsRequest) returns (stream StreamReadsResponse) {
38 option (google.api.http) = { post: "/v1/reads:stream" body: "*" };
39 }
40 }
41
42 // The Readstore. A data store for DNA sequencing Reads.
43 service ReadServiceV1 {
44 // Creates read group sets by asynchronously importing the provided
45 // information.
46 //
47 // For the definitions of read group sets and other genomics resources, see
48 // [Fundamentals of Google
49 // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
50 //
51 // The caller must have WRITE permissions to the dataset.
52 //
53 // ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import
54 //
55 // - Tags will be converted to strings - tag types are not preserved
56 // - Comments (`@CO`) in the input file header will not be preserved
57 // - Original header order of references (`@SQ`) will not be preserved
58 // - Any reverse stranded unmapped reads will be reverse complemented, and
59 // their qualities (also the "BQ" and "OQ" tags, if any) will be reversed
60 // - Unmapped reads will be stripped of positional information (reference name
61 // and position)
62 rpc ImportReadGroupSets(ImportReadGroupSetsRequest) returns (google.longrunning.Operation) {
63 option (google.api.http) = { post: "/v1/readgroupsets:import" body: "*" };
64 }
65
66 // Exports a read group set to a BAM file in Google Cloud Storage.
67 //
68 // For the definitions of read group sets and other genomics resources, see
69 // [Fundamentals of Google
70 // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
71 //
72 // Note that currently there may be some differences between exported BAM
73 // files and the original BAM file at the time of import. See
74 // [ImportReadGroupSets][google.genomics.v1.ReadServiceV1.ImportReadGroupSets]
75 // for caveats.
76 rpc ExportReadGroupSet(ExportReadGroupSetRequest) returns (google.longrunning.Operation) {
77 option (google.api.http) = { post: "/v1/readgroupsets/{read_group_set_id}:export" body: "*" };
78 }
79
80 // Searches for read group sets matching the criteria.
81 //
82 // For the definitions of read group sets and other genomics resources, see
83 // [Fundamentals of Google
84 // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
85 //
86 // Implements
87 // [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135).
88 rpc SearchReadGroupSets(SearchReadGroupSetsRequest) returns (SearchReadGroupSetsResponse) {
89 option (google.api.http) = { post: "/v1/readgroupsets/search" body: "*" };
90 }
91
92 // Updates a read group set.
93 //
94 // For the definitions of read group sets and other genomics resources, see
95 // [Fundamentals of Google
96 // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
97 //
98 // This method supports patch semantics.
99 rpc UpdateReadGroupSet(UpdateReadGroupSetRequest) returns (ReadGroupSet) {
100 option (google.api.http) = { patch: "/v1/readgroupsets/{read_group_set_id}" body: "read_group_set" };
101 }
102
103 // Deletes a read group set.
104 //
105 // For the definitions of read group sets and other genomics resources, see
106 // [Fundamentals of Google
107 // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
108 rpc DeleteReadGroupSet(DeleteReadGroupSetRequest) returns (google.protobuf.Empty) {
109 option (google.api.http) = { delete: "/v1/readgroupsets/{read_group_set_id}" };
110 }
111
112 // Gets a read group set by ID.
113 //
114 // For the definitions of read group sets and other genomics resources, see
115 // [Fundamentals of Google
116 // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
117 rpc GetReadGroupSet(GetReadGroupSetRequest) returns (ReadGroupSet) {
118 option (google.api.http) = { get: "/v1/readgroupsets/{read_group_set_id}" };
119 }
120
121 // Lists fixed width coverage buckets for a read group set, each of which
122 // correspond to a range of a reference sequence. Each bucket summarizes
123 // coverage information across its corresponding genomic range.
124 //
125 // For the definitions of read group sets and other genomics resources, see
126 // [Fundamentals of Google
127 // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
128 //
129 // Coverage is defined as the number of reads which are aligned to a given
130 // base in the reference sequence. Coverage buckets are available at several
131 // precomputed bucket widths, enabling retrieval of various coverage 'zoom
132 // levels'. The caller must have READ permissions for the target read group
133 // set.
134 rpc ListCoverageBuckets(ListCoverageBucketsRequest) returns (ListCoverageBucketsResponse) {
135 option (google.api.http) = { get: "/v1/readgroupsets/{read_group_set_id}/coveragebuckets" };
136 }
137
138 // Gets a list of reads for one or more read group sets.
139 //
140 // For the definitions of read group sets and other genomics resources, see
141 // [Fundamentals of Google
142 // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
143 //
144 // Reads search operates over a genomic coordinate space of reference sequence
145 // & position defined over the reference sequences to which the requested
146 // read group sets are aligned.
147 //
148 // If a target positional range is specified, search returns all reads whose
149 // alignment to the reference genome overlap the range. A query which
150 // specifies only read group set IDs yields all reads in those read group
151 // sets, including unmapped reads.
152 //
153 // All reads returned (including reads on subsequent pages) are ordered by
154 // genomic coordinate (by reference sequence, then position). Reads with
155 // equivalent genomic coordinates are returned in an unspecified order. This
156 // order is consistent, such that two queries for the same content (regardless
157 // of page size) yield reads in the same order across their respective streams
158 // of paginated responses.
159 //
160 // Implements
161 // [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85).
162 rpc SearchReads(SearchReadsRequest) returns (SearchReadsResponse) {
163 option (google.api.http) = { post: "/v1/reads/search" body: "*" };
164 }
165 }
166
167 // The read group set search request.
168 message SearchReadGroupSetsRequest {
169 // Restricts this query to read group sets within the given datasets. At least
170 // one ID must be provided.
171 repeated string dataset_ids = 1;
172
173 // Only return read group sets for which a substring of the name matches this
174 // string.
175 string name = 3;
176
177 // The continuation token, which is used to page through large result sets.
178 // To get the next page of results, set this parameter to the value of
179 // `nextPageToken` from the previous response.
180 string page_token = 2;
181
182 // The maximum number of results to return in a single page. If unspecified,
183 // defaults to 256. The maximum value is 1024.
184 int32 page_size = 4;
185 }
186
187 // The read group set search response.
188 message SearchReadGroupSetsResponse {
189 // The list of matching read group sets.
190 repeated ReadGroupSet read_group_sets = 1;
191
192 // The continuation token, which is used to page through large result sets.
193 // Provide this value in a subsequent request to return the next page of
194 // results. This field will be empty if there aren't any additional results.
195 string next_page_token = 2;
196 }
197
198 // The read group set import request.
199 message ImportReadGroupSetsRequest {
200 enum PartitionStrategy {
201 PARTITION_STRATEGY_UNSPECIFIED = 0;
202
203 // In most cases, this strategy yields one read group set per file. This is
204 // the default behavior.
205 //
206 // Allocate one read group set per file per sample. For BAM files, read
207 // groups are considered to share a sample if they have identical sample
208 // names. Furthermore, all reads for each file which do not belong to a read
209 // group, if any, will be grouped into a single read group set per-file.
210 PER_FILE_PER_SAMPLE = 1;
211
212 // Includes all read groups in all imported files into a single read group
213 // set. Requires that the headers for all imported files are equivalent. All
214 // reads which do not belong to a read group, if any, will be grouped into a
215 // separate read group set.
216 MERGE_ALL = 2;
217 }
218
219 // Required. The ID of the dataset these read group sets will belong to. The
220 // caller must have WRITE permissions to this dataset.
221 string dataset_id = 1;
222
223 // The reference set to which the imported read group sets are aligned to, if
224 // any. The reference names of this reference set must be a superset of those
225 // found in the imported file headers. If no reference set id is provided, a
226 // best effort is made to associate with a matching reference set.
227 string reference_set_id = 4;
228
229 // A list of URIs pointing at [BAM
230 // files](https://samtools.github.io/hts-specs/SAMv1.pdf)
231 // in Google Cloud Storage.
232 // Those URIs can include wildcards (*), but do not add or remove
233 // matching files before import has completed.
234 //
235 // Note that Google Cloud Storage object listing is only eventually
236 // consistent: files added may be not be immediately visible to
237 // everyone. Thus, if using a wildcard it is preferable not to start
238 // the import immediately after the files are created.
239 repeated string source_uris = 2;
240
241 // The partition strategy describes how read groups are partitioned into read
242 // group sets.
243 PartitionStrategy partition_strategy = 5;
244 }
245
246 // The read group set import response.
247 message ImportReadGroupSetsResponse {
248 // IDs of the read group sets that were created.
249 repeated string read_group_set_ids = 1;
250 }
251
252 // The read group set export request.
253 message ExportReadGroupSetRequest {
254 // Required. The Google Cloud project ID that owns this
255 // export. The caller must have WRITE access to this project.
256 string project_id = 1;
257
258 // Required. A Google Cloud Storage URI for the exported BAM file.
259 // The currently authenticated user must have write access to the new file.
260 // An error will be returned if the URI already contains data.
261 string export_uri = 2;
262
263 // Required. The ID of the read group set to export. The caller must have
264 // READ access to this read group set.
265 string read_group_set_id = 3;
266
267 // The reference names to export. If this is not specified, all reference
268 // sequences, including unmapped reads, are exported.
269 // Use `*` to export only unmapped reads.
270 repeated string reference_names = 4;
271 }
272
273 message UpdateReadGroupSetRequest {
274 // The ID of the read group set to be updated. The caller must have WRITE
275 // permissions to the dataset associated with this read group set.
276 string read_group_set_id = 1;
277
278 // The new read group set data. See `updateMask` for details on mutability of
279 // fields.
280 ReadGroupSet read_group_set = 2;
281
282 // An optional mask specifying which fields to update. Supported fields:
283 //
284 // * [name][google.genomics.v1.ReadGroupSet.name].
285 // * [referenceSetId][google.genomics.v1.ReadGroupSet.reference_set_id].
286 //
287 // Leaving `updateMask` unset is equivalent to specifying all mutable
288 // fields.
289 google.protobuf.FieldMask update_mask = 3;
290 }
291
292 message DeleteReadGroupSetRequest {
293 // The ID of the read group set to be deleted. The caller must have WRITE
294 // permissions to the dataset associated with this read group set.
295 string read_group_set_id = 1;
296 }
297
298 message GetReadGroupSetRequest {
299 // The ID of the read group set.
300 string read_group_set_id = 1;
301 }
302
303 message ListCoverageBucketsRequest {
304 // Required. The ID of the read group set over which coverage is requested.
305 string read_group_set_id = 1;
306
307 // The name of the reference to query, within the reference set associated
308 // with this query. Optional.
309 string reference_name = 3;
310
311 // The start position of the range on the reference, 0-based inclusive. If
312 // specified, `referenceName` must also be specified. Defaults to 0.
313 int64 start = 4;
314
315 // The end position of the range on the reference, 0-based exclusive. If
316 // specified, `referenceName` must also be specified. If unset or 0, defaults
317 // to the length of the reference.
318 int64 end = 5;
319
320 // The desired width of each reported coverage bucket in base pairs. This
321 // will be rounded down to the nearest precomputed bucket width; the value
322 // of which is returned as `bucketWidth` in the response. Defaults
323 // to infinity (each bucket spans an entire reference sequence) or the length
324 // of the target range, if specified. The smallest precomputed
325 // `bucketWidth` is currently 2048 base pairs; this is subject to
326 // change.
327 int64 target_bucket_width = 6;
328
329 // The continuation token, which is used to page through large result sets.
330 // To get the next page of results, set this parameter to the value of
331 // `nextPageToken` from the previous response.
332 string page_token = 7;
333
334 // The maximum number of results to return in a single page. If unspecified,
335 // defaults to 1024. The maximum value is 2048.
336 int32 page_size = 8;
337 }
338
339 // A bucket over which read coverage has been precomputed. A bucket corresponds
340 // to a specific range of the reference sequence.
341 message CoverageBucket {
342 // The genomic coordinate range spanned by this bucket.
343 Range range = 1;
344
345 // The average number of reads which are aligned to each individual
346 // reference base in this bucket.
347 float mean_coverage = 2;
348 }
349
350 message ListCoverageBucketsResponse {
351 // The length of each coverage bucket in base pairs. Note that buckets at the
352 // end of a reference sequence may be shorter. This value is omitted if the
353 // bucket width is infinity (the default behaviour, with no range or
354 // `targetBucketWidth`).
355 int64 bucket_width = 1;
356
357 // The coverage buckets. The list of buckets is sparse; a bucket with 0
358 // overlapping reads is not returned. A bucket never crosses more than one
359 // reference sequence. Each bucket has width `bucketWidth`, unless
360 // its end is the end of the reference sequence.
361 repeated CoverageBucket coverage_buckets = 2;
362
363 // The continuation token, which is used to page through large result sets.
364 // Provide this value in a subsequent request to return the next page of
365 // results. This field will be empty if there aren't any additional results.
366 string next_page_token = 3;
367 }
368
369 // The read search request.
370 message SearchReadsRequest {
371 // The IDs of the read groups sets within which to search for reads. All
372 // specified read group sets must be aligned against a common set of reference
373 // sequences; this defines the genomic coordinates for the query. Must specify
374 // one of `readGroupSetIds` or `readGroupIds`.
375 repeated string read_group_set_ids = 1;
376
377 // The IDs of the read groups within which to search for reads. All specified
378 // read groups must belong to the same read group sets. Must specify one of
379 // `readGroupSetIds` or `readGroupIds`.
380 repeated string read_group_ids = 5;
381
382 // The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to
383 // `*`, only unmapped reads are returned. If unspecified, all reads (mapped
384 // and unmapped) are returned.
385 string reference_name = 7;
386
387 // The start position of the range on the reference, 0-based inclusive. If
388 // specified, `referenceName` must also be specified.
389 int64 start = 8;
390
391 // The end position of the range on the reference, 0-based exclusive. If
392 // specified, `referenceName` must also be specified.
393 int64 end = 9;
394
395 // The continuation token, which is used to page through large result sets.
396 // To get the next page of results, set this parameter to the value of
397 // `nextPageToken` from the previous response.
398 string page_token = 3;
399
400 // The maximum number of results to return in a single page. If unspecified,
401 // defaults to 256. The maximum value is 2048.
402 int32 page_size = 4;
403 }
404
405 // The read search response.
406 message SearchReadsResponse {
407 // The list of matching alignments sorted by mapped genomic coordinate,
408 // if any, ascending in position within the same reference. Unmapped reads,
409 // which have no position, are returned contiguously and are sorted in
410 // ascending lexicographic order by fragment name.
411 repeated Read alignments = 1;
412
413 // The continuation token, which is used to page through large result sets.
414 // Provide this value in a subsequent request to return the next page of
415 // results. This field will be empty if there aren't any additional results.
416 string next_page_token = 2;
417 }
418
419 // The stream reads request.
420 message StreamReadsRequest {
421 // The Google Cloud project ID which will be billed
422 // for this access. The caller must have WRITE access to this project.
423 // Required.
424 string project_id = 1;
425
426 // The ID of the read group set from which to stream reads.
427 string read_group_set_id = 2;
428
429 // The reference sequence name, for example `chr1`,
430 // `1`, or `chrX`. If set to *, only unmapped reads are
431 // returned.
432 string reference_name = 3;
433
434 // The start position of the range on the reference, 0-based inclusive. If
435 // specified, `referenceName` must also be specified.
436 int64 start = 4;
437
438 // The end position of the range on the reference, 0-based exclusive. If
439 // specified, `referenceName` must also be specified.
440 int64 end = 5;
441
442 // Restricts results to a shard containing approximately `1/totalShards`
443 // of the normal response payload for this query. Results from a sharded
444 // request are disjoint from those returned by all queries which differ only
445 // in their shard parameter. A shard may yield 0 results; this is especially
446 // likely for large values of `totalShards`.
447 //
448 // Valid values are `[0, totalShards)`.
449 int32 shard = 6;
450
451 // Specifying `totalShards` causes a disjoint subset of the normal response
452 // payload to be returned for each query with a unique `shard` parameter
453 // specified. A best effort is made to yield equally sized shards. Sharding
454 // can be used to distribute processing amongst workers, where each worker is
455 // assigned a unique `shard` number and all workers specify the same
456 // `totalShards` number. The union of reads returned for all sharded queries
457 // `[0, totalShards)` is equal to those returned by a single unsharded query.
458 //
459 // Queries for different values of `totalShards` with common divisors will
460 // share shard boundaries. For example, streaming `shard` 2 of 5
461 // `totalShards` yields the same results as streaming `shard`s 4 and 5 of 10
462 // `totalShards`. This property can be leveraged for adaptive retries.
463 int32 total_shards = 7;
464 }
465
466 message StreamReadsResponse {
467 repeated Read alignments = 1;
468 }