variants.proto 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  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/longrunning/operations.proto";
  18. import "google/protobuf/empty.proto";
  19. import "google/protobuf/field_mask.proto";
  20. import "google/protobuf/struct.proto";
  21. option cc_enable_arenas = true;
  22. option go_package = "google.golang.org/genproto/googleapis/genomics/v1;genomics";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "VariantsProto";
  25. option java_package = "com.google.genomics.v1";
  26. service StreamingVariantService {
  27. // Returns a stream of all the variants matching the search request, ordered
  28. // by reference name, position, and ID.
  29. rpc StreamVariants(StreamVariantsRequest)
  30. returns (stream StreamVariantsResponse) {
  31. option (google.api.http) = {
  32. post: "/v1/variants:stream"
  33. body: "*"
  34. };
  35. }
  36. }
  37. service VariantServiceV1 {
  38. // Creates variant data by asynchronously importing the provided information.
  39. //
  40. // For the definitions of variant sets and other genomics resources, see
  41. // [Fundamentals of Google
  42. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  43. //
  44. // The variants for import will be merged with any existing variant that
  45. // matches its reference sequence, start, end, reference bases, and
  46. // alternative bases. If no such variant exists, a new one will be created.
  47. //
  48. // When variants are merged, the call information from the new variant
  49. // is added to the existing variant, and Variant info fields are merged
  50. // as specified in
  51. // [infoMergeConfig][google.genomics.v1.ImportVariantsRequest.info_merge_config].
  52. // As a special case, for single-sample VCF files, QUAL and FILTER fields will
  53. // be moved to the call level; these are sometimes interpreted in a
  54. // call-specific context.
  55. // Imported VCF headers are appended to the metadata already in a variant set.
  56. rpc ImportVariants(ImportVariantsRequest)
  57. returns (google.longrunning.Operation) {
  58. option (google.api.http) = {
  59. post: "/v1/variants:import"
  60. body: "*"
  61. };
  62. }
  63. // Creates a new variant set.
  64. //
  65. // For the definitions of variant sets and other genomics resources, see
  66. // [Fundamentals of Google
  67. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  68. //
  69. // The provided variant set must have a valid `datasetId` set - all other
  70. // fields are optional. Note that the `id` field will be ignored, as this is
  71. // assigned by the server.
  72. rpc CreateVariantSet(CreateVariantSetRequest) returns (VariantSet) {
  73. option (google.api.http) = {
  74. post: "/v1/variantsets"
  75. body: "variant_set"
  76. };
  77. }
  78. // Exports variant set data to an external destination.
  79. //
  80. // For the definitions of variant sets and other genomics resources, see
  81. // [Fundamentals of Google
  82. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  83. rpc ExportVariantSet(ExportVariantSetRequest)
  84. returns (google.longrunning.Operation) {
  85. option (google.api.http) = {
  86. post: "/v1/variantsets/{variant_set_id}:export"
  87. body: "*"
  88. };
  89. }
  90. // Gets a variant set by ID.
  91. //
  92. // For the definitions of variant sets and other genomics resources, see
  93. // [Fundamentals of Google
  94. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  95. rpc GetVariantSet(GetVariantSetRequest) returns (VariantSet) {
  96. option (google.api.http) = {
  97. get: "/v1/variantsets/{variant_set_id}"
  98. };
  99. }
  100. // Returns a list of all variant sets matching search criteria.
  101. //
  102. // For the definitions of variant sets and other genomics resources, see
  103. // [Fundamentals of Google
  104. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  105. //
  106. // Implements
  107. // [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49).
  108. rpc SearchVariantSets(SearchVariantSetsRequest)
  109. returns (SearchVariantSetsResponse) {
  110. option (google.api.http) = {
  111. post: "/v1/variantsets/search"
  112. body: "*"
  113. };
  114. }
  115. // Deletes a variant set including all variants, call sets, and calls within.
  116. // This is not reversible.
  117. //
  118. // For the definitions of variant sets and other genomics resources, see
  119. // [Fundamentals of Google
  120. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  121. rpc DeleteVariantSet(DeleteVariantSetRequest)
  122. returns (google.protobuf.Empty) {
  123. option (google.api.http) = {
  124. delete: "/v1/variantsets/{variant_set_id}"
  125. };
  126. }
  127. // Updates a variant set using patch semantics.
  128. //
  129. // For the definitions of variant sets and other genomics resources, see
  130. // [Fundamentals of Google
  131. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  132. rpc UpdateVariantSet(UpdateVariantSetRequest) returns (VariantSet) {
  133. option (google.api.http) = {
  134. patch: "/v1/variantsets/{variant_set_id}"
  135. body: "variant_set"
  136. };
  137. }
  138. // Gets a list of variants matching the criteria.
  139. //
  140. // For the definitions of variants and other genomics resources, see
  141. // [Fundamentals of Google
  142. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  143. //
  144. // Implements
  145. // [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126).
  146. rpc SearchVariants(SearchVariantsRequest) returns (SearchVariantsResponse) {
  147. option (google.api.http) = {
  148. post: "/v1/variants/search"
  149. body: "*"
  150. };
  151. }
  152. // Creates a new variant.
  153. //
  154. // For the definitions of variants and other genomics resources, see
  155. // [Fundamentals of Google
  156. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  157. rpc CreateVariant(CreateVariantRequest) returns (Variant) {
  158. option (google.api.http) = {
  159. post: "/v1/variants"
  160. body: "variant"
  161. };
  162. }
  163. // Updates a variant.
  164. //
  165. // For the definitions of variants and other genomics resources, see
  166. // [Fundamentals of Google
  167. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  168. //
  169. // This method supports patch semantics. Returns the modified variant without
  170. // its calls.
  171. rpc UpdateVariant(UpdateVariantRequest) returns (Variant) {
  172. option (google.api.http) = {
  173. patch: "/v1/variants/{variant_id}"
  174. body: "variant"
  175. };
  176. }
  177. // Deletes a variant.
  178. //
  179. // For the definitions of variants and other genomics resources, see
  180. // [Fundamentals of Google
  181. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  182. rpc DeleteVariant(DeleteVariantRequest) returns (google.protobuf.Empty) {
  183. option (google.api.http) = {
  184. delete: "/v1/variants/{variant_id}"
  185. };
  186. }
  187. // Gets a variant by ID.
  188. //
  189. // For the definitions of variants and other genomics resources, see
  190. // [Fundamentals of Google
  191. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  192. rpc GetVariant(GetVariantRequest) returns (Variant) {
  193. option (google.api.http) = {
  194. get: "/v1/variants/{variant_id}"
  195. };
  196. }
  197. // Merges the given variants with existing variants.
  198. //
  199. // For the definitions of variants and other genomics resources, see
  200. // [Fundamentals of Google
  201. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  202. //
  203. // Each variant will be
  204. // merged with an existing variant that matches its reference sequence,
  205. // start, end, reference bases, and alternative bases. If no such variant
  206. // exists, a new one will be created.
  207. //
  208. // When variants are merged, the call information from the new variant
  209. // is added to the existing variant. Variant info fields are merged as
  210. // specified in the
  211. // [infoMergeConfig][google.genomics.v1.MergeVariantsRequest.info_merge_config]
  212. // field of the MergeVariantsRequest.
  213. //
  214. // Please exercise caution when using this method! It is easy to introduce
  215. // mistakes in existing variants and difficult to back out of them. For
  216. // example,
  217. // suppose you were trying to merge a new variant with an existing one and
  218. // both
  219. // variants contain calls that belong to callsets with the same callset ID.
  220. //
  221. // // Existing variant - irrelevant fields trimmed for clarity
  222. // {
  223. // "variantSetId": "10473108253681171589",
  224. // "referenceName": "1",
  225. // "start": "10582",
  226. // "referenceBases": "G",
  227. // "alternateBases": [
  228. // "A"
  229. // ],
  230. // "calls": [
  231. // {
  232. // "callSetId": "10473108253681171589-0",
  233. // "callSetName": "CALLSET0",
  234. // "genotype": [
  235. // 0,
  236. // 1
  237. // ],
  238. // }
  239. // ]
  240. // }
  241. //
  242. // // New variant with conflicting call information
  243. // {
  244. // "variantSetId": "10473108253681171589",
  245. // "referenceName": "1",
  246. // "start": "10582",
  247. // "referenceBases": "G",
  248. // "alternateBases": [
  249. // "A"
  250. // ],
  251. // "calls": [
  252. // {
  253. // "callSetId": "10473108253681171589-0",
  254. // "callSetName": "CALLSET0",
  255. // "genotype": [
  256. // 1,
  257. // 1
  258. // ],
  259. // }
  260. // ]
  261. // }
  262. //
  263. // The resulting merged variant would overwrite the existing calls with those
  264. // from the new variant:
  265. //
  266. // {
  267. // "variantSetId": "10473108253681171589",
  268. // "referenceName": "1",
  269. // "start": "10582",
  270. // "referenceBases": "G",
  271. // "alternateBases": [
  272. // "A"
  273. // ],
  274. // "calls": [
  275. // {
  276. // "callSetId": "10473108253681171589-0",
  277. // "callSetName": "CALLSET0",
  278. // "genotype": [
  279. // 1,
  280. // 1
  281. // ],
  282. // }
  283. // ]
  284. // }
  285. //
  286. // This may be the desired outcome, but it is up to the user to determine if
  287. // if that is indeed the case.
  288. rpc MergeVariants(MergeVariantsRequest) returns (google.protobuf.Empty) {
  289. option (google.api.http) = {
  290. post: "/v1/variants:merge"
  291. body: "*"
  292. };
  293. }
  294. // Gets a list of call sets matching the criteria.
  295. //
  296. // For the definitions of call sets and other genomics resources, see
  297. // [Fundamentals of Google
  298. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  299. //
  300. // Implements
  301. // [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178).
  302. rpc SearchCallSets(SearchCallSetsRequest) returns (SearchCallSetsResponse) {
  303. option (google.api.http) = {
  304. post: "/v1/callsets/search"
  305. body: "*"
  306. };
  307. }
  308. // Creates a new call set.
  309. //
  310. // For the definitions of call sets and other genomics resources, see
  311. // [Fundamentals of Google
  312. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  313. rpc CreateCallSet(CreateCallSetRequest) returns (CallSet) {
  314. option (google.api.http) = {
  315. post: "/v1/callsets"
  316. body: "call_set"
  317. };
  318. }
  319. // Updates a call set.
  320. //
  321. // For the definitions of call sets and other genomics resources, see
  322. // [Fundamentals of Google
  323. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  324. //
  325. // This method supports patch semantics.
  326. rpc UpdateCallSet(UpdateCallSetRequest) returns (CallSet) {
  327. option (google.api.http) = {
  328. patch: "/v1/callsets/{call_set_id}"
  329. body: "call_set"
  330. };
  331. }
  332. // Deletes a call set.
  333. //
  334. // For the definitions of call sets and other genomics resources, see
  335. // [Fundamentals of Google
  336. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  337. rpc DeleteCallSet(DeleteCallSetRequest) returns (google.protobuf.Empty) {
  338. option (google.api.http) = {
  339. delete: "/v1/callsets/{call_set_id}"
  340. };
  341. }
  342. // Gets a call set by ID.
  343. //
  344. // For the definitions of call sets and other genomics resources, see
  345. // [Fundamentals of Google
  346. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  347. rpc GetCallSet(GetCallSetRequest) returns (CallSet) {
  348. option (google.api.http) = {
  349. get: "/v1/callsets/{call_set_id}"
  350. };
  351. }
  352. }
  353. // Metadata describes a single piece of variant call metadata.
  354. // These data include a top level key and either a single value string (value)
  355. // or a list of key-value pairs (info.)
  356. // Value and info are mutually exclusive.
  357. message VariantSetMetadata {
  358. enum Type {
  359. TYPE_UNSPECIFIED = 0;
  360. INTEGER = 1;
  361. FLOAT = 2;
  362. FLAG = 3;
  363. CHARACTER = 4;
  364. STRING = 5;
  365. }
  366. // The top-level key.
  367. string key = 1;
  368. // The value field for simple metadata
  369. string value = 2;
  370. // User-provided ID field, not enforced by this API.
  371. // Two or more pieces of structured metadata with identical
  372. // id and key fields are considered equivalent.
  373. string id = 4;
  374. // The type of data. Possible types include: Integer, Float,
  375. // Flag, Character, and String.
  376. Type type = 5;
  377. // The number of values that can be included in a field described by this
  378. // metadata.
  379. string number = 8;
  380. // A textual description of this metadata.
  381. string description = 7;
  382. // Remaining structured metadata key-value pairs. This must be of the form
  383. // map<string, string[]> (string key mapping to a list of string values).
  384. map<string, google.protobuf.ListValue> info = 3;
  385. }
  386. // A variant set is a collection of call sets and variants. It contains summary
  387. // statistics of those contents. A variant set belongs to a dataset.
  388. //
  389. // For more genomics resource definitions, see [Fundamentals of Google
  390. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  391. message VariantSet {
  392. // The dataset to which this variant set belongs.
  393. string dataset_id = 1;
  394. // The server-generated variant set ID, unique across all variant sets.
  395. string id = 2;
  396. // The reference set to which the variant set is mapped. The reference set
  397. // describes the alignment provenance of the variant set, while the
  398. // `referenceBounds` describe the shape of the actual variant data. The
  399. // reference set's reference names are a superset of those found in the
  400. // `referenceBounds`.
  401. //
  402. // For example, given a variant set that is mapped to the GRCh38 reference set
  403. // and contains a single variant on reference 'X', `referenceBounds` would
  404. // contain only an entry for 'X', while the associated reference set
  405. // enumerates all possible references: '1', '2', 'X', 'Y', 'MT', etc.
  406. string reference_set_id = 6;
  407. // A list of all references used by the variants in a variant set
  408. // with associated coordinate upper bounds for each one.
  409. repeated ReferenceBound reference_bounds = 5;
  410. // The metadata associated with this variant set.
  411. repeated VariantSetMetadata metadata = 4;
  412. // User-specified, mutable name.
  413. string name = 7;
  414. // A textual description of this variant set.
  415. string description = 8;
  416. }
  417. // A variant represents a change in DNA sequence relative to a reference
  418. // sequence. For example, a variant could represent a SNP or an insertion.
  419. // Variants belong to a variant set.
  420. //
  421. // For more genomics resource definitions, see [Fundamentals of Google
  422. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  423. //
  424. // Each of the calls on a variant represent a determination of genotype with
  425. // respect to that variant. For example, a call might assign probability of 0.32
  426. // to the occurrence of a SNP named rs1234 in a sample named NA12345. A call
  427. // belongs to a call set, which contains related calls typically from one
  428. // sample.
  429. message Variant {
  430. // The ID of the variant set this variant belongs to.
  431. string variant_set_id = 15;
  432. // The server-generated variant ID, unique across all variants.
  433. string id = 2;
  434. // Names for the variant, for example a RefSNP ID.
  435. repeated string names = 3;
  436. // The date this variant was created, in milliseconds from the epoch.
  437. int64 created = 12;
  438. // The reference on which this variant occurs.
  439. // (such as `chr20` or `X`)
  440. string reference_name = 14;
  441. // The position at which this variant occurs (0-based).
  442. // This corresponds to the first base of the string of reference bases.
  443. int64 start = 16;
  444. // The end position (0-based) of this variant. This corresponds to the first
  445. // base after the last base in the reference allele. So, the length of
  446. // the reference allele is (end - start). This is useful for variants
  447. // that don't explicitly give alternate bases, for example large deletions.
  448. int64 end = 13;
  449. // The reference bases for this variant. They start at the given
  450. // position.
  451. string reference_bases = 6;
  452. // The bases that appear instead of the reference bases.
  453. repeated string alternate_bases = 7;
  454. // A measure of how likely this variant is to be real.
  455. // A higher value is better.
  456. double quality = 8;
  457. // A list of filters (normally quality filters) this variant has failed.
  458. // `PASS` indicates this variant has passed all filters.
  459. repeated string filter = 9;
  460. // A map of additional variant information. This must be of the form
  461. // map<string, string[]> (string key mapping to a list of string values).
  462. map<string, google.protobuf.ListValue> info = 10;
  463. // The variant calls for this particular variant. Each one represents the
  464. // determination of genotype with respect to this variant.
  465. repeated VariantCall calls = 11;
  466. }
  467. // A call represents the determination of genotype with respect to a particular
  468. // variant. It may include associated information such as quality and phasing.
  469. // For example, a call might assign a probability of 0.32 to the occurrence of
  470. // a SNP named rs1234 in a call set with the name NA12345.
  471. message VariantCall {
  472. // The ID of the call set this variant call belongs to.
  473. string call_set_id = 8;
  474. // The name of the call set this variant call belongs to.
  475. string call_set_name = 9;
  476. // The genotype of this variant call. Each value represents either the value
  477. // of the `referenceBases` field or a 1-based index into
  478. // `alternateBases`. If a variant had a `referenceBases`
  479. // value of `T` and an `alternateBases`
  480. // value of `["A", "C"]`, and the `genotype` was
  481. // `[2, 1]`, that would mean the call
  482. // represented the heterozygous value `CA` for this variant.
  483. // If the `genotype` was instead `[0, 1]`, the
  484. // represented value would be `TA`. Ordering of the
  485. // genotype values is important if the `phaseset` is present.
  486. // If a genotype is not called (that is, a `.` is present in the
  487. // GT string) -1 is returned.
  488. repeated int32 genotype = 7;
  489. // If this field is present, this variant call's genotype ordering implies
  490. // the phase of the bases and is consistent with any other variant calls in
  491. // the same reference sequence which have the same phaseset value.
  492. // When importing data from VCF, if the genotype data was phased but no
  493. // phase set was specified this field will be set to `*`.
  494. string phaseset = 5;
  495. // The genotype likelihoods for this variant call. Each array entry
  496. // represents how likely a specific genotype is for this call. The value
  497. // ordering is defined by the GL tag in the VCF spec.
  498. // If Phred-scaled genotype likelihood scores (PL) are available and
  499. // log10(P) genotype likelihood scores (GL) are not, PL scores are converted
  500. // to GL scores. If both are available, PL scores are stored in `info`.
  501. repeated double genotype_likelihood = 6;
  502. // A map of additional variant call information. This must be of the form
  503. // map<string, string[]> (string key mapping to a list of string values).
  504. map<string, google.protobuf.ListValue> info = 2;
  505. }
  506. // A call set is a collection of variant calls, typically for one sample. It
  507. // belongs to a variant set.
  508. //
  509. // For more genomics resource definitions, see [Fundamentals of Google
  510. // Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)
  511. message CallSet {
  512. // The server-generated call set ID, unique across all call sets.
  513. string id = 1;
  514. // The call set name.
  515. string name = 2;
  516. // The sample ID this call set corresponds to.
  517. string sample_id = 7;
  518. // The IDs of the variant sets this call set belongs to. This field must
  519. // have exactly length one, as a call set belongs to a single variant set.
  520. // This field is repeated for compatibility with the
  521. // [GA4GH 0.5.1
  522. // API](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76).
  523. repeated string variant_set_ids = 6;
  524. // The date this call set was created in milliseconds from the epoch.
  525. int64 created = 5;
  526. // A map of additional call set information. This must be of the form
  527. // map<string, string[]> (string key mapping to a list of string values).
  528. map<string, google.protobuf.ListValue> info = 4;
  529. }
  530. // ReferenceBound records an upper bound for the starting coordinate of
  531. // variants in a particular reference.
  532. message ReferenceBound {
  533. // The name of the reference associated with this reference bound.
  534. string reference_name = 1;
  535. // An upper bound (inclusive) on the starting coordinate of any
  536. // variant in the reference sequence.
  537. int64 upper_bound = 2;
  538. }
  539. // The variant data import request.
  540. message ImportVariantsRequest {
  541. enum Format {
  542. FORMAT_UNSPECIFIED = 0;
  543. // VCF (Variant Call Format). The VCF files may be gzip compressed. gVCF is
  544. // also supported.
  545. FORMAT_VCF = 1;
  546. // Complete Genomics masterVarBeta format. The masterVarBeta files may
  547. // be bzip2 compressed.
  548. FORMAT_COMPLETE_GENOMICS = 2;
  549. }
  550. // Required. The variant set to which variant data should be imported.
  551. string variant_set_id = 1;
  552. // A list of URIs referencing variant files in Google Cloud Storage. URIs can
  553. // include wildcards [as described
  554. // here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames).
  555. // Note that recursive wildcards ('**') are not supported.
  556. repeated string source_uris = 2;
  557. // The format of the variant data being imported. If unspecified, defaults to
  558. // to `VCF`.
  559. Format format = 3;
  560. // Convert reference names to the canonical representation.
  561. // hg19 haploytypes (those reference names containing "_hap")
  562. // are not modified in any way.
  563. // All other reference names are modified according to the following rules:
  564. // The reference name is capitalized.
  565. // The "chr" prefix is dropped for all autosomes and sex chromsomes.
  566. // For example "chr17" becomes "17" and "chrX" becomes "X".
  567. // All mitochondrial chromosomes ("chrM", "chrMT", etc) become "MT".
  568. bool normalize_reference_names = 5;
  569. // A mapping between info field keys and the InfoMergeOperations to
  570. // be performed on them. This is plumbed down to the MergeVariantRequests
  571. // generated by the resulting import job.
  572. map<string, InfoMergeOperation> info_merge_config = 6;
  573. }
  574. // The variant data import response.
  575. message ImportVariantsResponse {
  576. // IDs of the call sets created during the import.
  577. repeated string call_set_ids = 1;
  578. }
  579. // The CreateVariantSet request
  580. message CreateVariantSetRequest {
  581. // Required. The variant set to be created. Must have a valid `datasetId`.
  582. VariantSet variant_set = 1;
  583. }
  584. // The variant data export request.
  585. message ExportVariantSetRequest {
  586. enum Format {
  587. FORMAT_UNSPECIFIED = 0;
  588. // Export the data to Google BigQuery.
  589. FORMAT_BIGQUERY = 1;
  590. }
  591. // Required. The ID of the variant set that contains variant data which
  592. // should be exported. The caller must have READ access to this variant set.
  593. string variant_set_id = 1;
  594. // If provided, only variant call information from the specified call sets
  595. // will be exported. By default all variant calls are exported.
  596. repeated string call_set_ids = 2;
  597. // Required. The Google Cloud project ID that owns the destination
  598. // BigQuery dataset. The caller must have WRITE access to this project. This
  599. // project will also own the resulting export job.
  600. string project_id = 3;
  601. // The format for the exported data.
  602. Format format = 4;
  603. // Required. The BigQuery dataset to export data to. This dataset must already
  604. // exist. Note that this is distinct from the Genomics concept of "dataset".
  605. string bigquery_dataset = 5;
  606. // Required. The BigQuery table to export data to.
  607. // If the table doesn't exist, it will be created. If it already exists, it
  608. // will be overwritten.
  609. string bigquery_table = 6;
  610. }
  611. // The variant set request.
  612. message GetVariantSetRequest {
  613. // Required. The ID of the variant set.
  614. string variant_set_id = 1;
  615. }
  616. // The search variant sets request.
  617. message SearchVariantSetsRequest {
  618. // Exactly one dataset ID must be provided here. Only variant sets which
  619. // belong to this dataset will be returned.
  620. repeated string dataset_ids = 1;
  621. // The continuation token, which is used to page through large result sets.
  622. // To get the next page of results, set this parameter to the value of
  623. // `nextPageToken` from the previous response.
  624. string page_token = 2;
  625. // The maximum number of results to return in a single page. If unspecified,
  626. // defaults to 1024.
  627. int32 page_size = 3;
  628. }
  629. // The search variant sets response.
  630. message SearchVariantSetsResponse {
  631. // The variant sets belonging to the requested dataset.
  632. repeated VariantSet variant_sets = 1;
  633. // The continuation token, which is used to page through large result sets.
  634. // Provide this value in a subsequent request to return the next page of
  635. // results. This field will be empty if there aren't any additional results.
  636. string next_page_token = 2;
  637. }
  638. // The delete variant set request.
  639. message DeleteVariantSetRequest {
  640. // The ID of the variant set to be deleted.
  641. string variant_set_id = 1;
  642. }
  643. message UpdateVariantSetRequest {
  644. // The ID of the variant to be updated (must already exist).
  645. string variant_set_id = 1;
  646. // The new variant data. Only the variant_set.metadata will be considered
  647. // for update.
  648. VariantSet variant_set = 2;
  649. // An optional mask specifying which fields to update. Supported fields:
  650. //
  651. // * [metadata][google.genomics.v1.VariantSet.metadata].
  652. // * [name][google.genomics.v1.VariantSet.name].
  653. // * [description][google.genomics.v1.VariantSet.description].
  654. //
  655. // Leaving `updateMask` unset is equivalent to specifying all mutable
  656. // fields.
  657. google.protobuf.FieldMask update_mask = 5;
  658. }
  659. // The variant search request.
  660. message SearchVariantsRequest {
  661. // At most one variant set ID must be provided. Only variants from this
  662. // variant set will be returned. If omitted, a call set id must be included in
  663. // the request.
  664. repeated string variant_set_ids = 1;
  665. // Only return variants which have exactly this name.
  666. string variant_name = 2;
  667. // Only return variant calls which belong to call sets with these ids.
  668. // Leaving this blank returns all variant calls. If a variant has no
  669. // calls belonging to any of these call sets, it won't be returned at all.
  670. repeated string call_set_ids = 3;
  671. // Required. Only return variants in this reference sequence.
  672. string reference_name = 4;
  673. // The beginning of the window (0-based, inclusive) for which
  674. // overlapping variants should be returned. If unspecified, defaults to 0.
  675. int64 start = 5;
  676. // The end of the window, 0-based exclusive. If unspecified or 0, defaults to
  677. // the length of the reference.
  678. int64 end = 6;
  679. // The continuation token, which is used to page through large result sets.
  680. // To get the next page of results, set this parameter to the value of
  681. // `nextPageToken` from the previous response.
  682. string page_token = 7;
  683. // The maximum number of variants to return in a single page. If unspecified,
  684. // defaults to 5000. The maximum value is 10000.
  685. int32 page_size = 8;
  686. // The maximum number of calls to return in a single page. Note that this
  687. // limit may be exceeded in the event that a matching variant contains more
  688. // calls than the requested maximum. If unspecified, defaults to 5000. The
  689. // maximum value is 10000.
  690. int32 max_calls = 9;
  691. }
  692. // The variant search response.
  693. message SearchVariantsResponse {
  694. // The list of matching Variants.
  695. repeated Variant variants = 1;
  696. // The continuation token, which is used to page through large result sets.
  697. // Provide this value in a subsequent request to return the next page of
  698. // results. This field will be empty if there aren't any additional results.
  699. string next_page_token = 2;
  700. }
  701. message CreateVariantRequest {
  702. // The variant to be created.
  703. Variant variant = 1;
  704. }
  705. message UpdateVariantRequest {
  706. // The ID of the variant to be updated.
  707. string variant_id = 1;
  708. // The new variant data.
  709. Variant variant = 2;
  710. // An optional mask specifying which fields to update. At this time, mutable
  711. // fields are [names][google.genomics.v1.Variant.names] and
  712. // [info][google.genomics.v1.Variant.info]. Acceptable values are "names" and
  713. // "info". If unspecified, all mutable fields will be updated.
  714. google.protobuf.FieldMask update_mask = 3;
  715. }
  716. message DeleteVariantRequest {
  717. // The ID of the variant to be deleted.
  718. string variant_id = 1;
  719. }
  720. message GetVariantRequest {
  721. // The ID of the variant.
  722. string variant_id = 1;
  723. }
  724. message MergeVariantsRequest {
  725. // The destination variant set.
  726. string variant_set_id = 1;
  727. // The variants to be merged with existing variants.
  728. repeated Variant variants = 2;
  729. // A mapping between info field keys and the InfoMergeOperations to
  730. // be performed on them.
  731. map<string, InfoMergeOperation> info_merge_config = 3;
  732. }
  733. // The call set search request.
  734. message SearchCallSetsRequest {
  735. // Restrict the query to call sets within the given variant sets. At least one
  736. // ID must be provided.
  737. repeated string variant_set_ids = 1;
  738. // Only return call sets for which a substring of the name matches this
  739. // string.
  740. string name = 2;
  741. // The continuation token, which is used to page through large result sets.
  742. // To get the next page of results, set this parameter to the value of
  743. // `nextPageToken` from the previous response.
  744. string page_token = 3;
  745. // The maximum number of results to return in a single page. If unspecified,
  746. // defaults to 1024.
  747. int32 page_size = 4;
  748. }
  749. // The call set search response.
  750. message SearchCallSetsResponse {
  751. // The list of matching call sets.
  752. repeated CallSet call_sets = 1;
  753. // The continuation token, which is used to page through large result sets.
  754. // Provide this value in a subsequent request to return the next page of
  755. // results. This field will be empty if there aren't any additional results.
  756. string next_page_token = 2;
  757. }
  758. message CreateCallSetRequest {
  759. // The call set to be created.
  760. CallSet call_set = 1;
  761. }
  762. message UpdateCallSetRequest {
  763. // The ID of the call set to be updated.
  764. string call_set_id = 1;
  765. // The new call set data.
  766. CallSet call_set = 2;
  767. // An optional mask specifying which fields to update. At this time, the only
  768. // mutable field is [name][google.genomics.v1.CallSet.name]. The only
  769. // acceptable value is "name". If unspecified, all mutable fields will be
  770. // updated.
  771. google.protobuf.FieldMask update_mask = 3;
  772. }
  773. message DeleteCallSetRequest {
  774. // The ID of the call set to be deleted.
  775. string call_set_id = 1;
  776. }
  777. message GetCallSetRequest {
  778. // The ID of the call set.
  779. string call_set_id = 1;
  780. }
  781. // The stream variants request.
  782. message StreamVariantsRequest {
  783. // The Google Cloud project ID which will be billed
  784. // for this access. The caller must have WRITE access to this project.
  785. // Required.
  786. string project_id = 1;
  787. // The variant set ID from which to stream variants.
  788. string variant_set_id = 2;
  789. // Only return variant calls which belong to call sets with these IDs.
  790. // Leaving this blank returns all variant calls.
  791. repeated string call_set_ids = 3;
  792. // Required. Only return variants in this reference sequence.
  793. string reference_name = 4;
  794. // The beginning of the window (0-based, inclusive) for which
  795. // overlapping variants should be returned.
  796. int64 start = 5;
  797. // The end of the window (0-based, exclusive) for which overlapping
  798. // variants should be returned.
  799. int64 end = 6;
  800. }
  801. message StreamVariantsResponse {
  802. repeated Variant variants = 1;
  803. }
  804. // Operations to be performed during import on Variant info fields.
  805. // These operations are set for each info field in the info_merge_config
  806. // map of ImportVariantsRequest, which is plumbed down to the
  807. // MergeVariantRequests generated by the import job.
  808. enum InfoMergeOperation {
  809. INFO_MERGE_OPERATION_UNSPECIFIED = 0;
  810. // By default, Variant info fields are persisted if the Variant doesn't
  811. // already exist in the variantset. If the Variant is equivalent to a
  812. // Variant already in the variantset, the incoming Variant's info field
  813. // is ignored in favor of that of the already persisted Variant.
  814. IGNORE_NEW = 1;
  815. // This operation removes an info field from the incoming Variant
  816. // and persists this info field in each of the incoming Variant's Calls.
  817. MOVE_TO_CALLS = 2;
  818. }