{ "cells": [ { "cell_type": "markdown", "id": "d4caf19c", "metadata": {}, "source": [ "# Differential Analysis" ] }, { "cell_type": "markdown", "id": "0b2a6bf8", "metadata": {}, "source": [ "## Summary" ] }, { "cell_type": "markdown", "id": "3bed637b", "metadata": {}, "source": [ "Doing \"normal\" differential analyhsis programatically is a two-step process. In the first step, sets of metadata triplets are created. In the second step, those sets are used as input to the actual calculator." ] }, { "cell_type": "markdown", "id": "303d550e", "metadata": {}, "source": [ "## Step 1 - Triplets" ] }, { "cell_type": "markdown", "id": "847e2367", "metadata": {}, "source": [ "Making a post request to " ] }, { "cell_type": "markdown", "id": "0ac727a7", "metadata": {}, "source": [ "```\n", "http://bindiscover.metabolomics.us:4999/leafmetadataresource/\n", "```" ] }, { "cell_type": "markdown", "id": "cb3a44be", "metadata": {}, "source": [ "With the format " ] }, { "cell_type": "markdown", "id": "9d103ef0", "metadata": {}, "source": [ "```\n", "{\n", " \"triplet_from\": [\"zea mays - Plant Roots - No Disease\",\"citrus sinensis - Plant Roots - No Disease\"], #any triplet from our data\n", " \"triplet_to\": [\"arabidopsis thaliana - Plant Roots - No Disease\"]\n", "}\n", "```" ] }, { "cell_type": "markdown", "id": "3275c5e5", "metadata": {}, "source": [ "Where values are possible triplets will yield a record-oriented metadata table, e.g." ] }, { "cell_type": "markdown", "id": "91c07de8", "metadata": {}, "source": [ "```\n", "\"[\n", " {\\\"from_or_to\\\":\\\"from\\\",\\\"triplet_id\\\":\\\"zea mays - Plant Roots - No Disease\\\",\\\"sample_count\\\":359},{\\\"from_or_to\\\":\\\"from\\\",\\\"triplet_id\\\":\\\"citrus sinensis - Plant Roots - No Disease\\\",\\\"sample_count\\\":12},\n", " {\\\"from_or_to\\\":\\\"to\\\",\\\"triplet_id\\\":\\\"arabidopsis thaliana - Plant Roots - No Disease\\\",\\\"sample_count\\\":408}\n", "]\"\n", "```" ] }, { "cell_type": "markdown", "id": "ae81308c", "metadata": {}, "source": [ "### Note: Multiple Triplets" ] }, { "cell_type": "markdown", "id": "0eea74fb", "metadata": {}, "source": [ "Normal differential analysis compares one triplet to another triplet. We see that we can combine multiple triplets here, without thinking about their relative positions in an ontology" ] }, { "cell_type": "markdown", "id": "beb1cf89", "metadata": {}, "source": [ "## Step 2 - Differential Analysis " ] }, { "cell_type": "markdown", "id": "79b87016", "metadata": {}, "source": [ "Making a post request to " ] }, { "cell_type": "markdown", "id": "3d0c0e3b", "metadata": {}, "source": [ "```\n", "http://bindiscover.metabolomics.us:4999/hgdaresource/\n", "```" ] }, { "cell_type": "markdown", "id": "2b5ffc72", "metadata": {}, "source": [ "with the format" ] }, { "cell_type": "markdown", "id": "89322be5", "metadata": {}, "source": [ "```\n", "{\n", " \"metadata_datatable\":\n", " [\n", " {\\\"from_or_to\\\":\\\"from\\\",\\\"triplet_id\\\":\\\"zea mays - Plant Roots - No Disease\\\",\\\"sample_count\\\":359},{\\\"from_or_to\\\":\\\"from\\\",\\\"triplet_id\\\":\\\"citrus sinensis - Plant Roots - No Disease\\\",\\\"sample_count\\\":12},\n", " {\\\"from_or_to\\\":\\\"to\\\",\\\"triplet_id\\\":\\\"arabidopsis thaliana - Plant Roots - No Disease\\\",\\\"sample_count\\\":408}\n", " ],\n", " \"bin_type\":\"known\" #values are 'known', 'unknown', and 'class' (compound classes)\n", "}\n", "```" ] }, { "cell_type": "markdown", "id": "3623d251", "metadata": {}, "source": [ "will yield the core information for the differential analysis, eg" ] }, { "cell_type": "markdown", "id": "eacd6c15", "metadata": {}, "source": [ "```\n", "\"[\n", " {\\\"compound_id\\\": 14717, \\\"identifier\\\": \\\"OOWQBDFWEXAXPB-UHFFFAOYSA-N\\\", \\\"english_name\\\": \\\"hexadecylglycerol\\\", \\\"bin_type_dict\\\": \\\"known\\\", \\\"significance_welch\\\": 0.6109507199, \\\"fold_change_average\\\": 0.007302779200000001},\n", " {\\\"compound_id\\\": 2214, \\\"identifier\\\": \\\"LOLKAJARZKDJTD-UHFFFAOYSA-N\\\", \\\"english_name\\\": \\\"ethylsuccinate\\\", \\\"bin_type_dict\\\": \\\"known\\\", \\\"significance_welch\\\": 0.1504452139, \\\"fold_change_average\\\": -0.031181263}...\n", "\"\n", "```" ] } ], "metadata": { "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.8.8" } }, "nbformat": 4, "nbformat_minor": 5 }