Skip to content

get_reference async

get_reference(
    id: ReferenceId,
    reference_store_id: ReferenceStoreId,
    part_number: int,
    *,
    config_overrides: Optional[AsyncOmicsClientConfig] = None,
    range: Optional[Range] = None,
    file: Optional[ReferenceFile] = None,
) -> AsyncGenerator[GetReferenceResponse]

Downloads parts of data from a reference genome and returns the reference file in the same format that it was uploaded.

For more information, see Creating a HealthOmics reference store in the Amazon Web Services HealthOmics User Guide.

Parameters:

Raises:

Source code in docs_src/capo_omics/_services/async_omics.py
@asynccontextmanager
async def get_reference(
    self,
    id: "capo_omics.types.reference_id.ReferenceId",
    reference_store_id: "capo_omics.types.reference_store_id.ReferenceStoreId",
    part_number: int,
    *,
    config_overrides: Optional[AsyncOmicsClientConfig] = None,
    range: Optional["capo_omics.types.range.Range"] = None,
    file: Optional["capo_omics.types.reference_file.ReferenceFile"] = None,
) -> "AsyncGenerator[capo_omics.types.get_reference_response.GetReferenceResponse]":
    """<p>Downloads parts of data from a reference genome and returns the reference file in the same format that it was uploaded.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/omics/latest/dev/create-reference-store.html">Creating a HealthOmics reference store</a> in the <i>Amazon Web Services HealthOmics User Guide</i>.</p>

    Args:
        id: <p>The reference's ID.</p>
        reference_store_id: <p>The reference's store ID.</p>
        range: <p>The range to retrieve.</p>
        part_number: <p>The part number to retrieve.</p>
        file: <p>The file to retrieve.</p>

    Raises:
        capo_omics.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_omics.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred. Try the request again.</p>
        capo_omics.errors.range_not_satisfiable_exception.RangeNotSatisfiableException: <p>The ranges specified in the request are not valid.</p>
        capo_omics.errors.request_timeout_exception.RequestTimeoutException: <p>The request timed out.</p>
        capo_omics.errors.resource_not_found_exception.ResourceNotFoundException: <p>The target resource was not found in the current Region.</p>
        capo_omics.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_omics.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_omics.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_omics.types.get_reference_request.GetReferenceRequest]",
    ) -> AsyncOperationResponse[
        "capo_omics.types.get_reference_response.GetReferenceResponse"
    ]:
        import capo_omics._operations.omics.get_reference

        (
            output,
            http_response,
        ) = await capo_omics._operations.omics.get_reference.async_get_reference(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_omics.types.get_reference_response.GetReferenceResponse",
    ) -> dict[str, Any]:
        import capo_omics.types.get_reference_response

        return capo_omics.types.get_reference_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetReference", redact_output=_redact_output),
    )
    input_: capo_omics.types.get_reference_request.GetReferenceRequest = {
        "id": id,
        "reference_store_id": reference_store_id,
        "part_number": part_number,
    }
    if range is not None:
        input_["range"] = range
    if file is not None:
        input_["file"] = file

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    try:
        yield response.output
    finally:
        await response.response.aclose()