{ "cells": [ { "cell_type": "markdown", "id": "9tcjtJ8cvaPv", "metadata": { "id": "9tcjtJ8cvaPv" }, "source": [ "# Simple query to OcéanIA Platform\n", "\n", "## This example shows how to extract arbitrary biological sub-sequences from a FASTA file available in the OcéanIA Platform.\n", "\n", "This example is not installing the oceania-query-fasta dependency, because we are asumming that is installed in the used Jupyter." ] }, { "cell_type": "markdown", "id": "5ea0f4b3", "metadata": {}, "source": [ "### 1. Prepare request params" ] }, { "cell_type": "code", "execution_count": null, "id": "4132badf", "metadata": {}, "outputs": [], "source": [ "TARA_SAMPLE_ID = \"TARA_A100000171\"\n", "\n", "# REQUEST_PARAMS is a list of tuples that identify subsequences to extract\n", "# each tuple must have the values (sequence_id, start_index, stop_index, sequence_type)\n", "# sequence type accepted values are [raw, complement, reverse_complement], optional value if ommited defaults to \"raw\".\n", "REQUEST_PARAMS = [\n", " (\"TARA_A100000171_G_scaffold48_1\", 10, 50, \"complement\"),\n", " (\"TARA_A100000171_G_scaffold48_1\", 10, 50),\n", " (\"TARA_A100000171_G_scaffold48_1\", 10, 50, \"reverse_complement\"),\n", " (\"TARA_A100000171_G_scaffold181_1\", 0, 50),\n", " (\"TARA_A100000171_G_scaffold181_1\", 100, 200),\n", " (\"TARA_A100000171_G_scaffold181_1\", 200, 230),\n", " (\"TARA_A100000171_G_scaffold493_2\", 54, 76),\n", " (\"TARA_A100000171_G_scaffold50396_2\", 87, 105),\n", " (\"TARA_A100000171_G_C2001995_1\", 20, 635),\n", " (\"TARA_A100000171_G_C2026460_1\", 0, 100),\n", " ]" ] }, { "cell_type": "markdown", "id": "0159d5e7", "metadata": {}, "source": [ "### 2. Perform call to the OcéanIA services" ] }, { "cell_type": "code", "execution_count": null, "id": "6344f9c6", "metadata": {}, "outputs": [], "source": [ "from oceania import get_sequences_from_fasta\n", "\n", "request_result = get_sequences_from_fasta(\n", " TARA_SAMPLE_ID,\n", " REQUEST_PARAMS\n", ")\n", "\n", "# get_sequences_from_fasta returns a pandas.DataFrame with the extracted sequences\n", "print(request_result)" ] } ], "metadata": { "colab": { "name": "Copia de query_dependecy.ipynb", "provenance": [ { "file_id": "https://github.com/Inria-Chile/oceania-lib-demo/blob/main/notebooks/query_dependecy.ipynb", "timestamp": 1623342428289 } ] }, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.5" } }, "nbformat": 4, "nbformat_minor": 5 }