From 13428f9d9496dc2af44065f03fc7fc747a5a0ea9 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Sat, 6 Mar 2021 17:45:34 +0300 Subject: Update jupyter notebook with more endpoints --- docs/gemma.ipynb | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/docs/gemma.ipynb b/docs/gemma.ipynb index b7796e3..4c5f9a6 100644 --- a/docs/gemma.ipynb +++ b/docs/gemma.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "#### Running GEMMA from GN3\n", + "# Running GEMMA from GN3\n", "\n", "This document outlines how to use gemma from Genenetwork3." ] @@ -25,7 +25,9 @@ { "cell_type": "code", "execution_count": 2, - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [ { "name": "stdout", @@ -37,21 +39,72 @@ ], "source": [ "import requests\n", - "r = requests.get(\"http://127.0.0.1:8080/gemma/version\")\n", + "r = requests.get(\"http://127.0.0.1:8080/api/gemma/version\")\n", "print(r.json())" ] }, { "cell_type": "markdown", "metadata": {}, - "source": [] + "source": [ + "## Uploading data\n", + "\n", + "Before you perform any computation, you need to ensure you have your data uploaded\n", + "\n", + "TODO" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## K-Computation\n", + "\n", + "Make sure that your metadata file is up to date!\n", + "You need the genofile, traitfile, and snpsfile. You also need a token provided when you first uploaded your metadata file." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Computing K-Values (no loco, no cavariates): \n", + "##### POST /gemma/k-compute/:token\n", + "The end command will look something like:\n", + "\n", + "```\n", + "gemma-wrapper --json -- -debug \\\n", + " -g genotype-file -p traitfile \\\n", + " -a genotypte-snps -gk > input-hash-k-output-filename\"\n", + "```" + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "# Demo\n", + "import requests\n", + "r = requests.post(\"localhost:8080/api/gemma/k-compute/abcde-abcde\")\n", + "print(r.json())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### POST /gemma/k-compute/:chromosomes/:token\n", + "\n", + "Cqmpute K values with chromosomes. The end command will look similar to:\n", + "\n", + "```\n", + " gemma-wrapper --json --loco 1,2,3,4 \\\n", + " -debug -g genotypefile -p traitfile \\\n", + " -a genotype-snps -gk > k_output_filename.json\n", + "```" + ] } ], "metadata": { -- cgit v1.2.3