<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# pyOpenCGA Basic User Usage\n",
    "\n",
    "------\n",
    "\n",
    "\n",
    "**[NOTE]** The server methods used by pyopencga client are defined in the following swagger URL:\n",
    "- http://bioinfodev.hpc.cam.ac.uk/opencga-test/webservices\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "current_dir: ..../notebooks\n",
      "base_modules_dir: ..../pyOpenCGA\n"
     ]
    }
   ],
   "source": [
    "# Initialize PYTHONPATH for pyopencga\n",
    "import sys\n",
    "import os\n",
    "\n",
    "cwd = os.getcwd()\n",
    "print(\"current_dir: ....\"+cwd[-10:])\n",
    "\n",
    "base_modules_dir = os.path.dirname(cwd)\n",
    "print(\"base_modules_dir: ....\"+base_modules_dir[-10:])\n",
    "\n",
    "sys.path.append(base_modules_dir)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyopencga.opencga_config import ConfigClient\n",
    "from pyopencga.opencga_client import OpenCGAClient\n",
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",<commit_msg>[pyopencga] updated comment in notebook 002<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# pyOpenCGA Basic User Usage\n",
    "\n",
    "------\n",
    "\n",
    "\n",
    "**[NOTE]** The server methods used by pyopencga client are defined in the following swagger URL:\n",
    "- http://bioinfodev.hpc.cam.ac.uk/opencga-test/webservices\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "current_dir: ..../notebooks\n",
      "base_modules_dir: ..../pyOpenCGA\n"
     ]
    }
   ],
   "source": [
    "# Initialize PYTHONPATH for pyopencga\n",
    "import sys\n",
    "import os\n",
    "\n",
    "cwd = os.getcwd()\n",
    "print(\"current_dir: ....\"+cwd[-10:])\n",
    "\n",
    "base_modules_dir = os.path.dirname(cwd)\n",
    "print(\"base_modules_dir: ....\"+base_modules_dir[-10:])\n",
    "\n",
    "sys.path.append(base_modules_dir)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyopencga.opencga_config import ConfigClient\n",
    "from pyopencga.opencga_client import OpenCGAClient\n",
    "import json"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Credentials** \n",
    "\n",
    "Plese add the credentials for opencga login into a file in json format and read them from there.\n",
    "\n",
    "i.e:\n",
    "file: \\__user_config.json\n",
    "flie_content: {\"user\":\"xxx\",\"pwd\":\"<PASSWORD>\"}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
{'fraction_non_alphanumeric': 0.22218730358265243, 'fraction_numerical': 0.005342551854179761, 'mean_word_length': 2.456026058631922, 'pattern_counts': {'":': 51, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3755111', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1239, 'n_words': 221}