Crate google_genomics1 [−] [src]
This documentation was generated from genomics crate version 1.0.6+20170520, where 20170520 is the exact revision of the genomics:v1 schema built by the mako code generator v1.0.6.
Everything else about the genomics v1 API can be found at the official documentation site. The original source code is on github.
Features
Handle the following Resources with ease from the central hub ...
- annotations
- annotationsets
- callsets
- datasets
- operations
- readgroupsets
- reads
- references
- bases list, get and search
- referencesets
- variants
- variantsets
Not what you are looking for ? Find all other Google APIs in their Rust documentation index.
Structure of this Library
The API is structured into the following primary items:
- Hub
- a central object to maintain state and allow accessing all Activities
- creates Method Builders which in turn allow access to individual Call Builders
- Resources
- primary types that you can apply Activities to
- a collection of properties and Parts
- Parts
- a collection of properties
- never directly used in Activities
- Activities
- operations to apply to Resources
All structures are marked with applicable traits to further categorize them and ease browsing.
Generally speaking, you can invoke Activities like this:
let r = hub.resource().activity(...).doit()
Or specifically ...
let r = hub.datasets().set_iam_policy(...).doit() let r = hub.datasets().delete(...).doit() let r = hub.datasets().get_iam_policy(...).doit() let r = hub.datasets().test_iam_permissions(...).doit() let r = hub.datasets().get(...).doit() let r = hub.datasets().undelete(...).doit() let r = hub.datasets().create(...).doit() let r = hub.datasets().patch(...).doit() let r = hub.datasets().list(...).doit()
The resource()
and activity(...)
calls create builders. The second one dealing with Activities
supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
specified right away (i.e. (...)
), whereas all optional ones can be build up as desired.
The doit()
method performs the actual communication with the server and returns the respective result.
Usage
Setting up your Project
To use this library, you would put the following lines into your Cargo.toml
file:
[dependencies]
google-genomics1 = "*"
A complete example
extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_genomics1 as genomics1; use genomics1::Dataset; use genomics1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; use genomics1::Genomics; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. let secret: ApplicationSecret = Default::default(); // Instantiate the authenticator. It will choose a suitable authentication flow for you, // unless you replace `None` with the desired Flow. // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and // retrieve them from storage. let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), <MemoryStorage as Default>::default(), None); let mut hub = Genomics::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); // As the method needs a request, you would usually fill it with the desired information // into the respective structure. Some of the parts shown here might not be applicable ! // Values shown here are possibly random and not representative ! let mut req = Dataset::default(); // You can configure optional parameters by calling the respective setters at will, and // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! let result = hub.datasets().patch(req, "datasetId") .update_mask("sed") .doit(); match result { Err(e) => match e { // The Error enum provides details about what exactly happened. // You can also just use its `Debug`, `Display` or `Error` traits Error::HttpError(_) |Error::MissingAPIKey |Error::MissingToken(_) |Error::Cancelled |Error::UploadSizeLimitExceeded(_, _) |Error::Failure(_) |Error::BadRequest(_) |Error::FieldClash(_) |Error::JsonDecodeError(_, _) => println!("{}", e), }, Ok(res) => println!("Success: {:?}", res), }
Handling Errors
All errors produced by the system are provided either as Result enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the Hub Delegate, or the Authenticator Delegate.
When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors.
Uploads and Downloads
If a method supports downloads, the response body, which is part of the Result, should be
read by you to obtain the media.
If such a method also supports a Response Result, it will return that by default.
You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
this call: .param("alt", "media")
.
Methods supporting uploads can do so using up to 2 different protocols:
simple and resumable. The distinctiveness of each is represented by customized
doit(...)
methods, which are then named upload(...)
and upload_resumable(...)
respectively.
Customization and Callbacks
You may alter the way an doit()
method is called by providing a delegate to the
Method Builder before making the final doit()
call.
Respective methods will be called to provide progress information, as well as determine whether the system should
retry on failure.
The delegate trait is default-implemented, allowing you to customize it with minimal effort.
Optional Parts in Server-Requests
All structures provided by this library are made to be enocodable and decodable via json. Optionals are used to indicate that partial requests are responses are valid. Most optionals are are considered Parts which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response.
Builder Arguments
Using method builders, you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true.
- PODs are handed by copy
- strings are passed as
&str
- request values are moved
Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
Structs
Annotation |
An annotation describes a region of reference genome. The value of an
annotation may be one of several canonical types, supplemented by arbitrary
info tags. An annotation is not inherently associated with a specific
sample or individual (though a client could choose to use annotations in
this way). Example canonical annotation types are |
AnnotationBatchCreateCall |
Creates one or more new annotations atomically. All annotations must belong to the same annotation set. Caller must have WRITE permission for this annotation set. For optimal performance, batch positionally adjacent annotations together. |
AnnotationCreateCall |
Creates a new annotation. Caller must have WRITE permission for the associated annotation set. |
AnnotationDeleteCall |
Deletes an annotation. Caller must have WRITE permission for the associated annotation set. |
AnnotationGetCall |
Gets an annotation. Caller must have READ permission for the associated annotation set. |
AnnotationMethods |
A builder providing access to all methods supported on annotation resources.
It is not used directly, but through the |
AnnotationSearchCall |
Searches for annotations that match the given criteria. Results are ordered by genomic coordinate (by reference sequence, then position). Annotations with equivalent genomic coordinates are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield annotations in the same order across their respective streams of paginated responses. Caller must have READ permission for the queried annotation sets. |
AnnotationSet |
An annotation set is a logical grouping of annotations that share consistent type information and provenance. Examples of annotation sets include 'all genes from refseq', and 'all variant annotations from ClinVar'. |
AnnotationUpdateCall |
Updates an annotation. Caller must have WRITE permission for the associated dataset. |
AnnotationsetCreateCall |
Creates a new annotation set. Caller must have WRITE permission for the associated dataset. |
AnnotationsetDeleteCall |
Deletes an annotation set. Caller must have WRITE permission for the associated annotation set. |
AnnotationsetGetCall |
Gets an annotation set. Caller must have READ permission for the associated dataset. |
AnnotationsetMethods |
A builder providing access to all methods supported on annotationset resources.
It is not used directly, but through the |
AnnotationsetSearchCall |
Searches for annotation sets that match the given criteria. Annotation sets are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield annotation sets in the same order across their respective streams of paginated responses. Caller must have READ permission for the queried datasets. |
AnnotationsetUpdateCall |
Updates an annotation set. The update must respect all mutability restrictions and other invariants described on the annotation set resource. Caller must have WRITE permission for the associated dataset. |
BatchCreateAnnotationsRequest |
There is no detailed description. |
BatchCreateAnnotationsResponse |
There is no detailed description. |
Binding |
Associates |
CallSet |
A call set is a collection of variant calls, typically for one sample. It belongs to a variant set. |
CallsetCreateCall |
Creates a new call set. |
CallsetDeleteCall |
Deletes a call set. |
CallsetGetCall |
Gets a call set by ID. |
CallsetMethods |
A builder providing access to all methods supported on callset resources.
It is not used directly, but through the |
CallsetPatchCall |
Updates a call set. |
CallsetSearchCall |
Gets a list of call sets matching the criteria. |
CancelOperationRequest |
The request message for Operations.CancelOperation. |
CigarUnit |
A single CIGAR operation. |
ClinicalCondition |
There is no detailed description. |
CodingSequence |
There is no detailed description. |
CoverageBucket |
A bucket over which read coverage has been precomputed. A bucket corresponds to a specific range of the reference sequence. |
Dataset |
A Dataset is a collection of genomic data. |
DatasetCreateCall |
Creates a new dataset. |
DatasetDeleteCall |
Deletes a dataset and all of its contents (all read group sets, reference sets, variant sets, call sets, annotation sets, etc.) This is reversible (up to one week after the deletion) via the datasets.undelete operation. |
DatasetGetCall |
Gets a dataset by ID. |
DatasetGetIamPolicyCall |
Gets the access control policy for the dataset. This is empty if the policy or resource does not exist. |
DatasetListCall |
Lists datasets within a project. |
DatasetMethods |
A builder providing access to all methods supported on dataset resources.
It is not used directly, but through the |
DatasetPatchCall |
Updates a dataset. |
DatasetSetIamPolicyCall |
Sets the access control policy on the specified dataset. Replaces any existing policy. |
DatasetTestIamPermissionCall |
Returns permissions that a caller has on the specified resource. See Testing Permissions for more information. |
DatasetUndeleteCall |
Undeletes a dataset by restoring a dataset which was deleted via this API. |
DefaultDelegate |
A delegate with a conservative default implementation, which is used if no other delegate is set. |
Empty |
A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: |
Entry |
There is no detailed description. |
ErrorResponse |
A utility to represent detailed errors we might see in case there are BadRequests. The latter happen if the sent parameters or request structures are unsound |
Exon |
There is no detailed description. |
Experiment |
There is no detailed description. |
ExportReadGroupSetRequest |
The read group set export request. |
ExportVariantSetRequest |
The variant data export request. |
ExternalId |
There is no detailed description. |
Genomics |
Central instance to access all Genomics related resource activities |
GetIamPolicyRequest |
Request message for |
ImportReadGroupSetsRequest |
The read group set import request. |
ImportVariantsRequest |
The variant data import request. |
LinearAlignment |
A linear alignment can be represented by one CIGAR string. Describes the mapped position and local alignment of the read to the reference. |
ListBasesResponse |
There is no detailed description. |
ListCoverageBucketsResponse |
There is no detailed description. |
ListDatasetsResponse |
The dataset list response. |
ListOperationsResponse |
The response message for Operations.ListOperations. |
MergeVariantsRequest |
There is no detailed description. |
MethodInfo |
Contains information about an API request. |
MultiPartReader |
Provides a |
Operation |
This resource represents a long-running operation that is the result of a network API call. |
OperationCancelCall |
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation. |
OperationGetCall |
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. |
OperationListCall |
Lists operations that match the specified filter in the request. |
OperationMethods |
A builder providing access to all methods supported on operation resources.
It is not used directly, but through the |
Policy |
Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. |
Position |
An abstraction for referring to a genomic position, in relation to some already known reference. For now, represents a genomic position as a reference name, a base number on that reference (0-based), and a determination of forward or reverse strand. |
Program |
There is no detailed description. |
Range |
A 0-based half-open genomic coordinate range for search requests. |
Read |
A read alignment describes a linear alignment of a string of DNA to a reference sequence, in addition to metadata about the fragment (the molecule of DNA sequenced) and the read (the bases which were read by the sequencer). A read is equivalent to a line in a SAM file. A read belongs to exactly one read group and exactly one read group set. |
ReadGroup |
A read group is all the data that's processed the same way by the sequencer. |
ReadGroupSet |
A read group set is a logical collection of read groups, which are collections of reads produced by a sequencer. A read group set typically models reads corresponding to one sample, sequenced one way, and aligned one way. |
ReadMethods |
A builder providing access to all methods supported on read resources.
It is not used directly, but through the |
ReadSearchCall |
Gets a list of reads for one or more read group sets. |
ReadgroupsetCoveragebucketListCall |
Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. |
ReadgroupsetDeleteCall |
Deletes a read group set. |
ReadgroupsetExportCall |
Exports a read group set to a BAM file in Google Cloud Storage. |
ReadgroupsetGetCall |
Gets a read group set by ID. |
ReadgroupsetImportCall |
Creates read group sets by asynchronously importing the provided information. |
ReadgroupsetMethods |
A builder providing access to all methods supported on readgroupset resources.
It is not used directly, but through the |
ReadgroupsetPatchCall |
Updates a read group set. |
ReadgroupsetSearchCall |
Searches for read group sets matching the criteria. |
Reference |
A reference is a canonical assembled DNA sequence, intended to act as a reference coordinate space for other genomic annotations. A single reference might represent the human chromosome 1 or mitochandrial DNA, for instance. A reference belongs to one or more reference sets. |
ReferenceBaseListCall |
Lists the bases in a reference, optionally restricted to a range. |
ReferenceBound |
ReferenceBound records an upper bound for the starting coordinate of variants in a particular reference. |
ReferenceGetCall |
Gets a reference. |
ReferenceMethods |
A builder providing access to all methods supported on reference resources.
It is not used directly, but through the |
ReferenceSearchCall |
Searches for references which match the given criteria. |
ReferenceSet |
A reference set is a set of references which typically comprise a reference
assembly for a species, such as |
ReferencesetGetCall |
Gets a reference set. |
ReferencesetMethods |
A builder providing access to all methods supported on referenceset resources.
It is not used directly, but through the |
ReferencesetSearchCall |
Searches for reference sets which match the given criteria. |
SearchAnnotationSetsRequest |
There is no detailed description. |
SearchAnnotationSetsResponse |
There is no detailed description. |
SearchAnnotationsRequest |
There is no detailed description. |
SearchAnnotationsResponse |
There is no detailed description. |
SearchCallSetsRequest |
The call set search request. |
SearchCallSetsResponse |
The call set search response. |
SearchReadGroupSetsRequest |
The read group set search request. |
SearchReadGroupSetsResponse |
The read group set search response. |
SearchReadsRequest |
The read search request. |
SearchReadsResponse |
The read search response. |
SearchReferenceSetsRequest |
There is no detailed description. |
SearchReferenceSetsResponse |
There is no detailed description. |
SearchReferencesRequest |
There is no detailed description. |
SearchReferencesResponse |
There is no detailed description. |
SearchVariantSetsRequest |
The search variant sets request. |
SearchVariantSetsResponse |
The search variant sets response. |
SearchVariantsRequest |
The variant search request. |
SearchVariantsResponse |
The variant search response. |
SetIamPolicyRequest |
Request message for |
Status |
The |
TestIamPermissionsRequest |
Request message for |
TestIamPermissionsResponse |
Response message for |
Transcript |
A transcript represents the assertion that a particular region of the reference genome may be transcribed as RNA. |
UndeleteDatasetRequest |
There is no detailed description. |
Variant |
A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. |
VariantAnnotation |
There is no detailed description. |
VariantCall |
A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345. |
VariantCreateCall |
Creates a new variant. |
VariantDeleteCall |
Deletes a variant. |
VariantGetCall |
Gets a variant by ID. |
VariantImportCall |
Creates variant data by asynchronously importing the provided information. |
VariantMergeCall |
Merges the given variants with existing variants. |
VariantMethods |
A builder providing access to all methods supported on variant resources.
It is not used directly, but through the |
VariantPatchCall |
Updates a variant. |
VariantSearchCall |
Gets a list of variants matching the criteria. |
VariantSet |
A variant set is a collection of call sets and variants. It contains summary statistics of those contents. A variant set belongs to a dataset. |
VariantSetMetadata |
Metadata describes a single piece of variant call metadata. These data include a top level key and either a single value string (value) or a list of key-value pairs (info.) Value and info are mutually exclusive. |
VariantsetCreateCall |
Creates a new variant set. |
VariantsetDeleteCall |
Deletes a variant set including all variants, call sets, and calls within. This is not reversible. |
VariantsetExportCall |
Exports variant set data to an external destination. |
VariantsetGetCall |
Gets a variant set by ID. |
VariantsetMethods |
A builder providing access to all methods supported on variantset resources.
It is not used directly, but through the |
VariantsetPatchCall |
Updates a variant set using patch semantics. |
VariantsetSearchCall |
Returns a list of all variant sets matching search criteria. |
Enums
Error | |
Scope |
Identifies the an OAuth2 authorization scope. A scope is needed when requesting an authorization token. |
Traits
CallBuilder |
Identifies types which represent builders for a particular resource method |
Delegate |
A trait specifying functionality to help controlling any request performed by the API. The trait has a conservative default implementation. |
Hub |
Identifies the Hub. There is only one per library, this trait is supposed to make intended use more explicit. The hub allows to access all resource methods more easily. |
MethodsBuilder |
Identifies types for building methods of a particular resource type |
NestedType |
Identifies types which are only used by other types internally. They have no special meaning, this trait just marks them for completeness. |
Part |
Identifies types which are only used as part of other types, which
usually are carrying the |
ReadSeek |
A utility to specify reader types which provide seeking capabilities too |
RequestValue |
Identifies types which are used in API requests. |
Resource |
Identifies types which can be inserted and deleted. Types with this trait are most commonly used by clients of this API. |
ResponseResult |
Identifies types which are used in API responses. |
ToParts |
A trait for all types that can convert themselves into a parts string |
Functions
remove_json_null_values |
Type Definitions
Result |
A universal result type used as return for all calls. |