annotations.proto 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  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. syntax = "proto3";
  15. package google.genomics.v1;
  16. import "google/api/annotations.proto";
  17. import "google/protobuf/empty.proto";
  18. import "google/protobuf/field_mask.proto";
  19. import "google/protobuf/struct.proto";
  20. import "google/protobuf/wrappers.proto";
  21. import "google/rpc/status.proto";
  22. option cc_enable_arenas = true;
  23. option java_multiple_files = true;
  24. option java_outer_classname = "AnnotationsProto";
  25. option java_package = "com.google.genomics.v1";
  26. // This service provides storage and positional retrieval of genomic
  27. // reference annotations, including variant annotations.
  28. service AnnotationServiceV1 {
  29. // Creates a new annotation set. Caller must have WRITE permission for the
  30. // associated dataset.
  31. //
  32. // The following fields are required:
  33. //
  34. // * [datasetId][google.genomics.v1.AnnotationSet.dataset_id]
  35. // * [referenceSetId][google.genomics.v1.AnnotationSet.reference_set_id]
  36. //
  37. // All other fields may be optionally specified, unless documented as being
  38. // server-generated (for example, the `id` field).
  39. rpc CreateAnnotationSet(CreateAnnotationSetRequest) returns (AnnotationSet) {
  40. option (google.api.http) = { post: "/v1/annotationsets" body: "annotation_set" };
  41. }
  42. // Gets an annotation set. Caller must have READ permission for
  43. // the associated dataset.
  44. rpc GetAnnotationSet(GetAnnotationSetRequest) returns (AnnotationSet) {
  45. option (google.api.http) = { get: "/v1/annotationsets/{annotation_set_id}" };
  46. }
  47. // Updates an annotation set. The update must respect all mutability
  48. // restrictions and other invariants described on the annotation set resource.
  49. // Caller must have WRITE permission for the associated dataset.
  50. rpc UpdateAnnotationSet(UpdateAnnotationSetRequest) returns (AnnotationSet) {
  51. option (google.api.http) = { put: "/v1/annotationsets/{annotation_set_id}" body: "annotation_set" };
  52. }
  53. // Deletes an annotation set. Caller must have WRITE permission
  54. // for the associated annotation set.
  55. rpc DeleteAnnotationSet(DeleteAnnotationSetRequest) returns (google.protobuf.Empty) {
  56. option (google.api.http) = { delete: "/v1/annotationsets/{annotation_set_id}" };
  57. }
  58. // Searches for annotation sets that match the given criteria. Annotation sets
  59. // are returned in an unspecified order. This order is consistent, such that
  60. // two queries for the same content (regardless of page size) yield annotation
  61. // sets in the same order across their respective streams of paginated
  62. // responses. Caller must have READ permission for the queried datasets.
  63. rpc SearchAnnotationSets(SearchAnnotationSetsRequest) returns (SearchAnnotationSetsResponse) {
  64. option (google.api.http) = { post: "/v1/annotationsets/search" body: "*" };
  65. }
  66. // Creates a new annotation. Caller must have WRITE permission
  67. // for the associated annotation set.
  68. //
  69. // The following fields are required:
  70. //
  71. // * [annotationSetId][google.genomics.v1.Annotation.annotation_set_id]
  72. // * [referenceName][google.genomics.v1.Annotation.reference_name] or
  73. // [referenceId][google.genomics.v1.Annotation.reference_id]
  74. //
  75. // ### Transcripts
  76. //
  77. // For annotations of type TRANSCRIPT, the following fields of
  78. // [transcript][google.genomics.v1.Annotation.transcript] must be provided:
  79. //
  80. // * [exons.start][google.genomics.v1.Transcript.Exon.start]
  81. // * [exons.end][google.genomics.v1.Transcript.Exon.end]
  82. //
  83. // All other fields may be optionally specified, unless documented as being
  84. // server-generated (for example, the `id` field). The annotated
  85. // range must be no longer than 100Mbp (mega base pairs). See the
  86. // [Annotation resource][google.genomics.v1.Annotation]
  87. // for additional restrictions on each field.
  88. rpc CreateAnnotation(CreateAnnotationRequest) returns (Annotation) {
  89. option (google.api.http) = { post: "/v1/annotations" body: "annotation" };
  90. }
  91. // Creates one or more new annotations atomically. All annotations must
  92. // belong to the same annotation set. Caller must have WRITE
  93. // permission for this annotation set. For optimal performance, batch
  94. // positionally adjacent annotations together.
  95. //
  96. // If the request has a systemic issue, such as an attempt to write to
  97. // an inaccessible annotation set, the entire RPC will fail accordingly. For
  98. // lesser data issues, when possible an error will be isolated to the
  99. // corresponding batch entry in the response; the remaining well formed
  100. // annotations will be created normally.
  101. //
  102. // For details on the requirements for each individual annotation resource,
  103. // see
  104. // [CreateAnnotation][google.genomics.v1.AnnotationServiceV1.CreateAnnotation].
  105. rpc BatchCreateAnnotations(BatchCreateAnnotationsRequest) returns (BatchCreateAnnotationsResponse) {
  106. option (google.api.http) = { post: "/v1/annotations:batchCreate" body: "*" };
  107. }
  108. // Gets an annotation. Caller must have READ permission
  109. // for the associated annotation set.
  110. rpc GetAnnotation(GetAnnotationRequest) returns (Annotation) {
  111. option (google.api.http) = { get: "/v1/annotations/{annotation_id}" };
  112. }
  113. // Updates an annotation. Caller must have
  114. // WRITE permission for the associated dataset.
  115. rpc UpdateAnnotation(UpdateAnnotationRequest) returns (Annotation) {
  116. option (google.api.http) = { put: "/v1/annotations/{annotation_id}" body: "annotation" };
  117. }
  118. // Deletes an annotation. Caller must have WRITE permission for
  119. // the associated annotation set.
  120. rpc DeleteAnnotation(DeleteAnnotationRequest) returns (google.protobuf.Empty) {
  121. option (google.api.http) = { delete: "/v1/annotations/{annotation_id}" };
  122. }
  123. // Searches for annotations that match the given criteria. Results are
  124. // ordered by genomic coordinate (by reference sequence, then position).
  125. // Annotations with equivalent genomic coordinates are returned in an
  126. // unspecified order. This order is consistent, such that two queries for the
  127. // same content (regardless of page size) yield annotations in the same order
  128. // across their respective streams of paginated responses. Caller must have
  129. // READ permission for the queried annotation sets.
  130. rpc SearchAnnotations(SearchAnnotationsRequest) returns (SearchAnnotationsResponse) {
  131. option (google.api.http) = { post: "/v1/annotations/search" body: "*" };
  132. }
  133. }
  134. // An annotation set is a logical grouping of annotations that share consistent
  135. // type information and provenance. Examples of annotation sets include 'all
  136. // genes from refseq', and 'all variant annotations from ClinVar'.
  137. message AnnotationSet {
  138. // The server-generated annotation set ID, unique across all annotation sets.
  139. string id = 1;
  140. // The dataset to which this annotation set belongs.
  141. string dataset_id = 2;
  142. // The ID of the reference set that defines the coordinate space for this
  143. // set's annotations.
  144. string reference_set_id = 3;
  145. // The display name for this annotation set.
  146. string name = 4;
  147. // The source URI describing the file from which this annotation set was
  148. // generated, if any.
  149. string source_uri = 5;
  150. // The type of annotations contained within this set.
  151. AnnotationType type = 6;
  152. // A map of additional read alignment information. This must be of the form
  153. // map<string, string[]> (string key mapping to a list of string values).
  154. map<string, google.protobuf.ListValue> info = 17;
  155. }
  156. // An annotation describes a region of reference genome. The value of an
  157. // annotation may be one of several canonical types, supplemented by arbitrary
  158. // info tags. An annotation is not inherently associated with a specific
  159. // sample or individual (though a client could choose to use annotations in
  160. // this way). Example canonical annotation types are `GENE` and
  161. // `VARIANT`.
  162. message Annotation {
  163. // The server-generated annotation ID, unique across all annotations.
  164. string id = 1;
  165. // The annotation set to which this annotation belongs.
  166. string annotation_set_id = 2;
  167. // The display name of this annotation.
  168. string name = 3;
  169. // The ID of the Google Genomics reference associated with this range.
  170. string reference_id = 4;
  171. // The display name corresponding to the reference specified by
  172. // `referenceId`, for example `chr1`, `1`, or `chrX`.
  173. string reference_name = 5;
  174. // The start position of the range on the reference, 0-based inclusive.
  175. int64 start = 6;
  176. // The end position of the range on the reference, 0-based exclusive.
  177. int64 end = 7;
  178. // Whether this range refers to the reverse strand, as opposed to the forward
  179. // strand. Note that regardless of this field, the start/end position of the
  180. // range always refer to the forward strand.
  181. bool reverse_strand = 8;
  182. // The data type for this annotation. Must match the containing annotation
  183. // set's type.
  184. AnnotationType type = 9;
  185. oneof value {
  186. // A variant annotation, which describes the effect of a variant on the
  187. // genome, the coding sequence, and/or higher level consequences at the
  188. // organism level e.g. pathogenicity. This field is only set for annotations
  189. // of type `VARIANT`.
  190. VariantAnnotation variant = 10;
  191. // A transcript value represents the assertion that a particular region of
  192. // the reference genome may be transcribed as RNA. An alternative splicing
  193. // pattern would be represented as a separate transcript object. This field
  194. // is only set for annotations of type `TRANSCRIPT`.
  195. Transcript transcript = 11;
  196. }
  197. // A map of additional read alignment information. This must be of the form
  198. // map<string, string[]> (string key mapping to a list of string values).
  199. map<string, google.protobuf.ListValue> info = 12;
  200. }
  201. message VariantAnnotation {
  202. message ClinicalCondition {
  203. // A set of names for the condition.
  204. repeated string names = 1;
  205. // The set of external IDs for this condition.
  206. repeated ExternalId external_ids = 2;
  207. // The MedGen concept id associated with this gene.
  208. // Search for these IDs at http://www.ncbi.nlm.nih.gov/medgen/
  209. string concept_id = 3;
  210. // The OMIM id for this condition.
  211. // Search for these IDs at http://omim.org/
  212. string omim_id = 4;
  213. }
  214. enum Type {
  215. TYPE_UNSPECIFIED = 0;
  216. // `TYPE_OTHER` should be used when no other Type will suffice.
  217. // Further explanation of the variant type may be included in the
  218. // [info][google.genomics.v1.Annotation.info] field.
  219. TYPE_OTHER = 1;
  220. // `INSERTION` indicates an insertion.
  221. INSERTION = 2;
  222. // `DELETION` indicates a deletion.
  223. DELETION = 3;
  224. // `SUBSTITUTION` indicates a block substitution of
  225. // two or more nucleotides.
  226. SUBSTITUTION = 4;
  227. // `SNP` indicates a single nucleotide polymorphism.
  228. SNP = 5;
  229. // `STRUCTURAL` indicates a large structural variant,
  230. // including chromosomal fusions, inversions, etc.
  231. STRUCTURAL = 6;
  232. // `CNV` indicates a variation in copy number.
  233. CNV = 7;
  234. }
  235. enum Effect {
  236. EFFECT_UNSPECIFIED = 0;
  237. // `EFFECT_OTHER` should be used when no other Effect
  238. // will suffice.
  239. EFFECT_OTHER = 1;
  240. // `FRAMESHIFT` indicates a mutation in which the insertion or
  241. // deletion of nucleotides resulted in a frameshift change.
  242. FRAMESHIFT = 2;
  243. // `FRAME_PRESERVING_INDEL` indicates a mutation in which a
  244. // multiple of three nucleotides has been inserted or deleted, resulting
  245. // in no change to the reading frame of the coding sequence.
  246. FRAME_PRESERVING_INDEL = 3;
  247. // `SYNONYMOUS_SNP` indicates a single nucleotide polymorphism
  248. // mutation that results in no amino acid change.
  249. SYNONYMOUS_SNP = 4;
  250. // `NONSYNONYMOUS_SNP` indicates a single nucleotide
  251. // polymorphism mutation that results in an amino acid change.
  252. NONSYNONYMOUS_SNP = 5;
  253. // `STOP_GAIN` indicates a mutation that leads to the creation
  254. // of a stop codon at the variant site. Frameshift mutations creating
  255. // downstream stop codons do not count as `STOP_GAIN`.
  256. STOP_GAIN = 6;
  257. // `STOP_LOSS` indicates a mutation that eliminates a
  258. // stop codon at the variant site.
  259. STOP_LOSS = 7;
  260. // `SPLICE_SITE_DISRUPTION` indicates that this variant is
  261. // found in a splice site for the associated transcript, and alters the
  262. // normal splicing pattern.
  263. SPLICE_SITE_DISRUPTION = 8;
  264. }
  265. enum ClinicalSignificance {
  266. CLINICAL_SIGNIFICANCE_UNSPECIFIED = 0;
  267. // `OTHER` should be used when no other clinical significance
  268. // value will suffice.
  269. CLINICAL_SIGNIFICANCE_OTHER = 1;
  270. UNCERTAIN = 2;
  271. BENIGN = 3;
  272. LIKELY_BENIGN = 4;
  273. LIKELY_PATHOGENIC = 5;
  274. PATHOGENIC = 6;
  275. DRUG_RESPONSE = 7;
  276. HISTOCOMPATIBILITY = 8;
  277. CONFERS_SENSITIVITY = 9;
  278. RISK_FACTOR = 10;
  279. ASSOCIATION = 11;
  280. PROTECTIVE = 12;
  281. // `MULTIPLE_REPORTED` should be used when multiple clinical
  282. // signficances are reported for a variant. The original clinical
  283. // significance values may be provided in the `info` field.
  284. MULTIPLE_REPORTED = 13;
  285. }
  286. // Type has been adapted from ClinVar's list of variant types.
  287. Type type = 1;
  288. // Effect of the variant on the coding sequence.
  289. Effect effect = 2;
  290. // The alternate allele for this variant. If multiple alternate alleles
  291. // exist at this location, create a separate variant for each one, as they
  292. // may represent distinct conditions.
  293. string alternate_bases = 3;
  294. // Google annotation ID of the gene affected by this variant. This should
  295. // be provided when the variant is created.
  296. string gene_id = 4;
  297. // Google annotation IDs of the transcripts affected by this variant. These
  298. // should be provided when the variant is created.
  299. repeated string transcript_ids = 5;
  300. // The set of conditions associated with this variant.
  301. // A condition describes the way a variant influences human health.
  302. repeated ClinicalCondition conditions = 6;
  303. // Describes the clinical significance of a variant.
  304. // It is adapted from the ClinVar controlled vocabulary for clinical
  305. // significance described at:
  306. // http://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/
  307. ClinicalSignificance clinical_significance = 7;
  308. }
  309. // A transcript represents the assertion that a particular region of the
  310. // reference genome may be transcribed as RNA.
  311. message Transcript {
  312. message Exon {
  313. // The start position of the exon on this annotation's reference sequence,
  314. // 0-based inclusive. Note that this is relative to the reference start, and
  315. // **not** the containing annotation start.
  316. int64 start = 1;
  317. // The end position of the exon on this annotation's reference sequence,
  318. // 0-based exclusive. Note that this is relative to the reference start, and
  319. // *not* the containing annotation start.
  320. int64 end = 2;
  321. // The frame of this exon. Contains a value of 0, 1, or 2, which indicates
  322. // the offset of the first coding base of the exon within the reading frame
  323. // of the coding DNA sequence, if any. This field is dependent on the
  324. // strandedness of this annotation (see
  325. // [Annotation.reverse_strand][google.genomics.v1.Annotation.reverse_strand]).
  326. // For forward stranded annotations, this offset is relative to the
  327. // [exon.start][google.genomics.v1.Transcript.Exon.start]. For reverse
  328. // strand annotations, this offset is relative to the
  329. // [exon.end][google.genomics.v1.Transcript.Exon.end] `- 1`.
  330. //
  331. // Unset if this exon does not intersect the coding sequence. Upon creation
  332. // of a transcript, the frame must be populated for all or none of the
  333. // coding exons.
  334. google.protobuf.Int32Value frame = 3;
  335. }
  336. message CodingSequence {
  337. // The start of the coding sequence on this annotation's reference sequence,
  338. // 0-based inclusive. Note that this position is relative to the reference
  339. // start, and *not* the containing annotation start.
  340. int64 start = 1;
  341. // The end of the coding sequence on this annotation's reference sequence,
  342. // 0-based exclusive. Note that this position is relative to the reference
  343. // start, and *not* the containing annotation start.
  344. int64 end = 2;
  345. }
  346. // The annotation ID of the gene from which this transcript is transcribed.
  347. string gene_id = 1;
  348. // The <a href="http://en.wikipedia.org/wiki/Exon">exons</a> that compose
  349. // this transcript. This field should be unset for genomes where transcript
  350. // splicing does not occur, for example prokaryotes.
  351. //
  352. // Introns are regions of the transcript that are not included in the
  353. // spliced RNA product. Though not explicitly modeled here, intron ranges can
  354. // be deduced; all regions of this transcript that are not exons are introns.
  355. //
  356. // Exonic sequences do not necessarily code for a translational product
  357. // (amino acids). Only the regions of exons bounded by the
  358. // [codingSequence][google.genomics.v1.Transcript.coding_sequence] correspond
  359. // to coding DNA sequence.
  360. //
  361. // Exons are ordered by start position and may not overlap.
  362. repeated Exon exons = 2;
  363. // The range of the coding sequence for this transcript, if any. To determine
  364. // the exact ranges of coding sequence, intersect this range with those of the
  365. // [exons][google.genomics.v1.Transcript.exons], if any. If there are any
  366. // [exons][google.genomics.v1.Transcript.exons], the
  367. // [codingSequence][google.genomics.v1.Transcript.coding_sequence] must start
  368. // and end within them.
  369. //
  370. // Note that in some cases, the reference genome will not exactly match the
  371. // observed mRNA transcript e.g. due to variance in the source genome from
  372. // reference. In these cases,
  373. // [exon.frame][google.genomics.v1.Transcript.Exon.frame] will not necessarily
  374. // match the expected reference reading frame and coding exon reference bases
  375. // cannot necessarily be concatenated to produce the original transcript mRNA.
  376. CodingSequence coding_sequence = 3;
  377. }
  378. message ExternalId {
  379. // The name of the source of this data.
  380. string source_name = 1;
  381. // The id used by the source of this data.
  382. string id = 2;
  383. }
  384. message CreateAnnotationSetRequest {
  385. // The annotation set to create.
  386. AnnotationSet annotation_set = 1;
  387. }
  388. message GetAnnotationSetRequest {
  389. // The ID of the annotation set to be retrieved.
  390. string annotation_set_id = 1;
  391. }
  392. message UpdateAnnotationSetRequest {
  393. // The ID of the annotation set to be updated.
  394. string annotation_set_id = 1;
  395. // The new annotation set.
  396. AnnotationSet annotation_set = 2;
  397. // An optional mask specifying which fields to update. Mutable fields are
  398. // [name][google.genomics.v1.AnnotationSet.name],
  399. // [source_uri][google.genomics.v1.AnnotationSet.source_uri], and
  400. // [info][google.genomics.v1.AnnotationSet.info]. If unspecified, all
  401. // mutable fields will be updated.
  402. google.protobuf.FieldMask update_mask = 3;
  403. }
  404. message DeleteAnnotationSetRequest {
  405. // The ID of the annotation set to be deleted.
  406. string annotation_set_id = 1;
  407. }
  408. message SearchAnnotationSetsRequest {
  409. // Required. The dataset IDs to search within. Caller must have `READ` access
  410. // to these datasets.
  411. repeated string dataset_ids = 1;
  412. // If specified, only annotation sets associated with the given reference set
  413. // are returned.
  414. string reference_set_id = 2;
  415. // Only return annotations sets for which a substring of the name matches this
  416. // string (case insensitive).
  417. string name = 3;
  418. // If specified, only annotation sets that have any of these types are
  419. // returned.
  420. repeated AnnotationType types = 4;
  421. // The continuation token, which is used to page through large result sets.
  422. // To get the next page of results, set this parameter to the value of
  423. // `nextPageToken` from the previous response.
  424. string page_token = 5;
  425. // The maximum number of results to return in a single page. If unspecified,
  426. // defaults to 128. The maximum value is 1024.
  427. int32 page_size = 6;
  428. }
  429. message SearchAnnotationSetsResponse {
  430. // The matching annotation sets.
  431. repeated AnnotationSet annotation_sets = 1;
  432. // The continuation token, which is used to page through large result sets.
  433. // Provide this value in a subsequent request to return the next page of
  434. // results. This field will be empty if there aren't any additional results.
  435. string next_page_token = 2;
  436. }
  437. message CreateAnnotationRequest {
  438. // The annotation to be created.
  439. Annotation annotation = 1;
  440. }
  441. message BatchCreateAnnotationsRequest {
  442. // The annotations to be created. At most 4096 can be specified in a single
  443. // request.
  444. repeated Annotation annotations = 1;
  445. // A unique request ID which enables the server to detect duplicated requests.
  446. // If provided, duplicated requests will result in the same response; if not
  447. // provided, duplicated requests may result in duplicated data. For a given
  448. // annotation set, callers should not reuse `request_id`s when writing
  449. // different batches of annotations - behavior in this case is undefined.
  450. // A common approach is to use a UUID. For batch jobs where worker crashes are
  451. // a possibility, consider using some unique variant of a worker or run ID.
  452. string request_id = 2;
  453. }
  454. message BatchCreateAnnotationsResponse {
  455. message Entry {
  456. // The creation status.
  457. google.rpc.Status status = 1;
  458. // The created annotation, if creation was successful.
  459. Annotation annotation = 2;
  460. }
  461. // The resulting per-annotation entries, ordered consistently with the
  462. // original request.
  463. repeated Entry entries = 1;
  464. }
  465. message GetAnnotationRequest {
  466. // The ID of the annotation to be retrieved.
  467. string annotation_id = 1;
  468. }
  469. message UpdateAnnotationRequest {
  470. // The ID of the annotation to be updated.
  471. string annotation_id = 1;
  472. // The new annotation.
  473. Annotation annotation = 2;
  474. // An optional mask specifying which fields to update. Mutable fields are
  475. // [name][google.genomics.v1.Annotation.name],
  476. // [variant][google.genomics.v1.Annotation.variant],
  477. // [transcript][google.genomics.v1.Annotation.transcript], and
  478. // [info][google.genomics.v1.Annotation.info]. If unspecified, all mutable
  479. // fields will be updated.
  480. google.protobuf.FieldMask update_mask = 3;
  481. }
  482. message DeleteAnnotationRequest {
  483. // The ID of the annotation to be deleted.
  484. string annotation_id = 1;
  485. }
  486. message SearchAnnotationsRequest {
  487. // Required. The annotation sets to search within. The caller must have
  488. // `READ` access to these annotation sets.
  489. // All queried annotation sets must have the same type.
  490. repeated string annotation_set_ids = 1;
  491. // Required. `reference_id` or `reference_name` must be set.
  492. oneof reference {
  493. // The ID of the reference to query.
  494. string reference_id = 2;
  495. // The name of the reference to query, within the reference set associated
  496. // with this query.
  497. string reference_name = 3;
  498. }
  499. // The start position of the range on the reference, 0-based inclusive. If
  500. // specified,
  501. // [referenceId][google.genomics.v1.SearchAnnotationsRequest.reference_id] or
  502. // [referenceName][google.genomics.v1.SearchAnnotationsRequest.reference_name]
  503. // must be specified. Defaults to 0.
  504. int64 start = 4;
  505. // The end position of the range on the reference, 0-based exclusive. If
  506. // [referenceId][google.genomics.v1.SearchAnnotationsRequest.reference_id] or
  507. // [referenceName][google.genomics.v1.SearchAnnotationsRequest.reference_name]
  508. // must be specified, Defaults to the length of the reference.
  509. int64 end = 5;
  510. // The continuation token, which is used to page through large result sets.
  511. // To get the next page of results, set this parameter to the value of
  512. // `nextPageToken` from the previous response.
  513. string page_token = 6;
  514. // The maximum number of results to return in a single page. If unspecified,
  515. // defaults to 256. The maximum value is 2048.
  516. int32 page_size = 7;
  517. }
  518. message SearchAnnotationsResponse {
  519. // The matching annotations.
  520. repeated Annotation annotations = 1;
  521. // The continuation token, which is used to page through large result sets.
  522. // Provide this value in a subsequent request to return the next page of
  523. // results. This field will be empty if there aren't any additional results.
  524. string next_page_token = 2;
  525. }
  526. // When an [Annotation][google.genomics.v1.Annotation] or
  527. // [AnnotationSet][google.genomics.v1.AnnotationSet] is created, if `type` is
  528. // not specified it will be set to `GENERIC`.
  529. enum AnnotationType {
  530. ANNOTATION_TYPE_UNSPECIFIED = 0;
  531. // A `GENERIC` annotation type should be used when no other annotation
  532. // type will suffice. This represents an untyped annotation of the reference
  533. // genome.
  534. GENERIC = 1;
  535. // A `VARIANT` annotation type.
  536. VARIANT = 2;
  537. // A `GENE` annotation type represents the existence of a gene at the
  538. // associated reference coordinates. The start coordinate is typically the
  539. // gene's transcription start site and the end is typically the end of the
  540. // gene's last exon.
  541. GENE = 3;
  542. // A `TRANSCRIPT` annotation type represents the assertion that a
  543. // particular region of the reference genome may be transcribed as RNA.
  544. TRANSCRIPT = 4;
  545. }