Skip to content
Snippets Groups Projects
Supplemental_Analyses.ipynb 501 KiB
Newer Older
Shengpu Tang (tangsp)'s avatar
Shengpu Tang (tangsp) committed
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
Shengpu Tang (tangsp)'s avatar
Shengpu Tang (tangsp) committed
   "metadata": {},
   "outputs": [],
   "source": [
    "%config InlineBackend.figure_formats = ['svg']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
Shengpu Tang (tangsp)'s avatar
Shengpu Tang (tangsp) committed
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from joblib import dump, load\n",
    "np.random.seed(42)\n",
    "random.seed(42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
Shengpu Tang (tangsp)'s avatar
Shengpu Tang (tangsp) committed
   "metadata": {},
   "outputs": [],
   "source": [
    "data_dir = './data/'\n",
    "with np.load('data/Xy.npz') as f:\n",
    "    X = f['X']\n",
    "    y = f['y']\n",
    "    y34 = f['y34']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
Shengpu Tang (tangsp)'s avatar
Shengpu Tang (tangsp) committed
   "metadata": {},
   "outputs": [],
   "source": [
    "# Perform temporal split of data into train/test sets\n",
    "pop = pd.read_csv(data_dir + 'population/d10_with_vitals.csv').set_index('BMT_ID')\n",
    "\n",
    "split_date = 201701001\n",
    "split_idx = -85\n",
    "\n",
    "assert (pop[:split_idx].index < split_date).all()\n",
    "assert (pop[split_idx:].index >= split_date).all()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
Shengpu Tang (tangsp)'s avatar
Shengpu Tang (tangsp) committed
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import preprocessing, model_selection, metrics, utils\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "from tqdm import tqdm\n",
    "from joblib import Parallel, delayed\n",
    "from sklearn.base import clone"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
Shengpu Tang (tangsp)'s avatar
Shengpu Tang (tangsp) committed
   "metadata": {},
   "outputs": [],
   "source": [
    "# Specify hyperparameters and cv parameters\n",
    "base_estimator = LogisticRegression(penalty='l2', class_weight='balanced', solver='liblinear')\n",
    "param_grid = {\n",
    "    'C': [10. ** n for n in range(-6, 7)],\n",
    "    'penalty': ['l2'],\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Alternative label definition\n",
    "{0,1,2} -> negative, {3,4} -> positive"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 472,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.31790123456790126, 0.13580246913580246)"
      ]
     },
     "execution_count": 472,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.mean(), y34.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 376,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/data4/tangsp/venv/lib/python3.7/site-packages/sklearn/model_selection/_search.py:814: DeprecationWarning: The default of the `iid` parameter will change from True to False in version 0.22 and will be removed in 0.24. This will change numeric results when test-set sizes are unequal.\n",
      "  DeprecationWarning)\n"
     ]
    }
   ],
   "source": [
    "Xtr, Xte = X[:split_idx], X[split_idx:]\n",
    "ytr, yte = y34[:split_idx], y34[split_idx:]\n",
    "\n",
    "cv_splits, cv_repeat = 5, 20\n",
    "cv = model_selection.RepeatedStratifiedKFold(cv_splits, cv_repeat, random_state=0)\n",
    "clf = model_selection.GridSearchCV(\n",
    "    clone(base_estimator), param_grid, \n",
    "    cv=cv, scoring='roc_auc', n_jobs=5,\n",
    ")\n",
    "clf.fit(Xtr, ytr)\n",
    "test_score = metrics.roc_auc_score(yte, clf.decision_function(Xte))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 377,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "                                                  \r"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test AUC: 0.596 (0.423, 0.761)\n"
     ]
    }
   ],
   "source": [
    "y_true = yte\n",
    "y_score = clf.decision_function(Xte)\n",
    "\n",
    "def boostrap_func(i, y_true, y_score):\n",
    "    yte_true_b, yte_pred_b = utils.resample(y_true, y_score, replace=True, random_state=i)\n",
    "    return metrics.roc_curve(yte_true_b, yte_pred_b), metrics.roc_auc_score(yte_true_b, yte_pred_b)\n",
    "\n",
    "roc_curves, auc_scores = zip(*Parallel(n_jobs=4)(delayed(boostrap_func)(i, y_true, y_score) for i in tqdm(range(1000), leave=False)))\n",
    "print('Test AUC: {:.3f} ({:.3f}, {:.3f})'.format(np.median(auc_scores), np.percentile(auc_scores, 2.5), np.percentile(auc_scores, 97.5)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Random Forest model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 378,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import RandomizedSearchCV\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "import scipy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 379,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RandomizedSearchCV(cv=<sklearn.model_selection._split.RepeatedStratifiedKFold object at 0x7f9b8ffacc50>,\n",
       "                   error_score='raise-deprecating',\n",
       "                   estimator=RandomForestClassifier(bootstrap=True,\n",
       "                                                    class_weight=None,\n",
       "                                                    criterion='gini',\n",
       "                                                    max_depth=None,\n",
       "                                                    max_features='auto',\n",
       "                                                    max_leaf_nodes=None,\n",
       "                                                    min_impurity_decrease=0.0,\n",
       "                                                    min_impurity_split=None,\n",
       "                                                    min_samples_leaf=1,\n",
       "                                                    min_sample...\n",
       "                                        'min_samples_leaf': <scipy.stats._distn_infrastructure.rv_frozen object at 0x7f9b8ffad050>,\n",
       "                                        'min_samples_split': <scipy.stats._distn_infrastructure.rv_frozen object at 0x7f9b8ffadc10>,\n",
       "                                        'n_estimators': <scipy.stats._distn_infrastructure.rv_frozen object at 0x7f9b8ffad490>},\n",
       "                   pre_dispatch='2*n_jobs', random_state=None, refit=True,\n",
       "                   return_train_score=False, scoring='roc_auc', verbose=0)"
      ]
     },
     "execution_count": 379,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Xtr, Xte = X[:split_idx], X[split_idx:]\n",
    "ytr, yte = y[:split_idx], y[split_idx:]\n",
    "\n",
    "cv_splits, cv_repeat = 5, 20\n",
    "cv = model_selection.RepeatedStratifiedKFold(cv_splits, cv_repeat, random_state=0)\n",
    "clf = RandomizedSearchCV(\n",
    "        RandomForestClassifier(), \n",
    "        {\n",
    "            \"criterion\": [\"gini\", \"entropy\"],\n",
    "            \"max_depth\": [4, 8, 16, 32, None],\n",
    "            \"max_features\": scipy.stats.randint(1, 100),\n",
    "            \"min_samples_split\": scipy.stats.randint(2, 11),\n",
    "            \"min_samples_leaf\": scipy.stats.randint(1, 11),\n",
    "            \"n_estimators\": scipy.stats.randint(50,500),\n",
    "            \"bootstrap\": [True],\n",
    "        },\n",
    "        n_iter=10,\n",
    "        cv=cv,\n",
    "        scoring='roc_auc',\n",
    "        n_jobs=5,\n",
    "    )\n",
    "\n",
    "clf.fit(Xtr, ytr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 380,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_score = metrics.roc_auc_score(yte, clf.predict_proba(Xte)[:,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 381,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "                                                  \r"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test AUC: 0.651 (0.525, 0.768)\n"
     ]
    }
   ],
   "source": [
    "y_true = yte\n",
    "y_score = clf.predict_proba(Xte)[:,1]\n",
    "\n",
    "def boostrap_func(i, y_true, y_score):\n",
    "    yte_true_b, yte_pred_b = utils.resample(y_true, y_score, replace=True, random_state=i)\n",
    "    return metrics.roc_curve(yte_true_b, yte_pred_b), metrics.roc_auc_score(yte_true_b, yte_pred_b)\n",
    "\n",
    "_, auc_scores_rf = zip(*Parallel(n_jobs=4)(delayed(boostrap_func)(i, y_true, y_score) for i in tqdm(range(1000), leave=False)))\n",
    "print('Test AUC: {:.3f} ({:.3f}, {:.3f})'.format(np.median(auc_scores_rf), np.percentile(auc_scores_rf, 2.5), np.percentile(auc_scores_rf, 97.5)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 382,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "                                                    \r"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test AUC: 0.658 (0.536, 0.784)\n"
     ]
    }
   ],
   "source": [
    "clf_main = load('data/model_combined.joblib')\n",
    "y_score = clf_main.predict_proba(Xte)[:,1]\n",
    "_, auc_scores_main = zip(*Parallel(n_jobs=4)(delayed(boostrap_func)(i, y_true, y_score) for i in tqdm(range(1000), leave=False)))\n",
    "print('Test AUC: {:.3f} ({:.3f}, {:.3f})'.format(\n",
    "    np.median(auc_scores_main), np.percentile(auc_scores_main, 2.5), np.percentile(auc_scores_main, 97.5)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 383,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.782"
      ]
     },
     "execution_count": 383,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# H0: proposed == baseline\n",
    "# H1: proposed != baseline\n",
    "# resampling test, two-sided p-value\n",
    "2 * min(\n",
    "    (np.array(auc_scores_main) < np.array(auc_scores_rf)).mean(),\n",
    "    (np.array(auc_scores_main) > np.array(auc_scores_rf)).mean()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Kaplan Meier plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
Shengpu Tang (tangsp)'s avatar
Shengpu Tang (tangsp) committed
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from sklearn import utils"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 482,
   "metadata": {},
   "outputs": [],
   "source": [
    "Xtr, Xte = X[:split_idx], X[split_idx:]\n",
    "ytr, yte = y[:split_idx], y[split_idx:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 483,
   "metadata": {},
   "outputs": [],
   "source": [
    "pop = pd.read_csv(data_dir + 'population/d10_with_vitals.csv').set_index('BMT_ID')\n",
    "labels = pd.read_csv(data_dir + 'prep/label.csv').set_index('BMT_ID')\n",
    "IDs = pop.index[split_idx:]\n",
    "onset = labels.loc[IDs, 'GVHD_onset_day'].replace(np.nan, np.inf)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 484,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "IntervalIndex([(0.234, 0.539], (0.539, 0.74]],\n",
      "              closed='right',\n",
      "              dtype='interval[float64]')\n"
     ]
    }
   ],
   "source": [
    "clf = load('data/model_combined.joblib')\n",
    "threshold = np.percentile(clf.predict_proba(Xtr)[:,1], [0, 70, 100])\n",
    "y_prob = clf.predict_proba(Xte)[:,1]\n",
    "y_group = pd.cut(y_prob, threshold)\n",
    "print(y_group.categories)\n",
    "y_group = y_group.codes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 485,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Standard errors calculated via the Greenwood's formula\n",
    "# http://sphweb.bumc.bu.edu/otlt/MPH-Modules/BS/BS704_Survival/BS704_Survival4.html\n",
    "def calculate_survival_curve_se(onset_m, times):\n",
    "    surv_probs = [(onset_m > 0).mean()]\n",
    "    stderrs = [0]\n",
    "    quotients = []\n",
    "    for day in sorted(times):\n",
    "        if np.isfinite(day):\n",
    "            Nt, Dt = (onset_m >= day).sum(), (onset_m == day).sum()\n",
    "            St = (onset_m > day).mean()\n",
    "            quotients.append(Dt / (Nt * (Nt - Dt)))\n",
    "            surv_probs.append(St)\n",
    "            stderrs.append(St * np.sqrt(np.sum(quotients)))\n",
    "    return np.array(surv_probs), np.array(stderrs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 486,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Created with matplotlib (https://matplotlib.org/) -->\n",
       "<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 395.325 262.19625\" width=\"395.325pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <defs>\n",
       "  <style type=\"text/css\">\n",
       "*{stroke-linecap:butt;stroke-linejoin:round;}\n",
       "  </style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 262.19625 \n",
       "L 395.325 262.19625 \n",
       "L 395.325 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "L 43.78125 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"PolyCollection_1\">\n",
       "    <path clip-path=\"url(#p835b299284)\" d=\"M 43.78125 17.083636 \n",
       "L 43.78125 17.083636 \n",
       "L 83.95725 27.056768 \n",
       "L 97.34925 27.056768 \n",
       "L 104.04525 33.099522 \n",
       "L 110.74125 38.474442 \n",
       "L 114.08925 43.49501 \n",
       "L 117.43725 48.283507 \n",
       "L 120.78525 52.903038 \n",
       "L 124.13325 52.903038 \n",
       "L 127.48125 57.391293 \n",
       "L 134.17725 57.391293 \n",
       "L 137.52525 57.391293 \n",
       "L 140.87325 57.391293 \n",
       "L 144.22125 61.77295 \n",
       "L 150.91725 66.065217 \n",
       "L 157.61325 74.428802 \n",
       "L 160.96125 82.551225 \n",
       "L 164.30925 86.536158 \n",
       "L 167.65725 86.536158 \n",
       "L 171.00525 90.475742 \n",
       "L 174.35325 94.373235 \n",
       "L 184.39725 98.231374 \n",
       "L 191.09325 102.052478 \n",
       "L 194.44125 105.838525 \n",
       "L 201.13725 109.591214 \n",
       "L 231.26925 113.312002 \n",
       "L 251.35725 117.002149 \n",
       "L 274.79325 120.662743 \n",
       "L 281.48925 124.29472 \n",
       "L 288.18525 124.29472 \n",
       "L 301.57725 127.898887 \n",
       "L 325.01325 131.475934 \n",
       "L 351.79725 135.026445 \n",
       "L 365.18925 138.550912 \n",
       "L 395.32125 142.049736 \n",
       "L 395.32125 88.526025 \n",
       "L 395.32125 88.526025 \n",
       "L 365.18925 85.252143 \n",
       "L 351.79725 82.003903 \n",
       "L 325.01325 78.781708 \n",
       "L 301.57725 75.586048 \n",
       "L 288.18525 72.417509 \n",
       "L 281.48925 72.417509 \n",
       "L 274.79325 69.276779 \n",
       "L 251.35725 66.164667 \n",
       "L 231.26925 63.082108 \n",
       "L 201.13725 60.030189 \n",
       "L 194.44125 57.010171 \n",
       "L 191.09325 54.023512 \n",
       "L 184.39725 51.07191 \n",
       "L 174.35325 48.157342 \n",
       "L 171.00525 45.282128 \n",
       "L 167.65725 42.449006 \n",
       "L 164.30925 42.449006 \n",
       "L 160.96125 39.661232 \n",
       "L 157.61325 34.238243 \n",
       "L 150.91725 29.056414 \n",
       "L 144.22125 26.575974 \n",
       "L 140.87325 24.184925 \n",
       "L 137.52525 24.184925 \n",
       "L 134.17725 24.184925 \n",
       "L 127.48125 24.184925 \n",
       "L 124.13325 21.900474 \n",
       "L 120.78525 21.900474 \n",
       "L 117.43725 19.747298 \n",
       "L 114.08925 17.763089 \n",
       "L 110.74125 17.083636 \n",
       "L 104.04525 17.083636 \n",
       "L 97.34925 17.083636 \n",
       "L 83.95725 17.083636 \n",
       "L 43.78125 17.083636 \n",
       "z\n",
       "\" style=\"fill:#1f77b4;fill-opacity:0.12;\"/>\n",
       "   </g>\n",
       "   <g id=\"PolyCollection_2\">\n",
       "    <path clip-path=\"url(#p835b299284)\" d=\"M 43.78125 17.083636 \n",
       "L 43.78125 17.083636 \n",
       "L 83.95725 17.083636 \n",
       "L 97.34925 53.151181 \n",
       "L 104.04525 74.365683 \n",
       "L 110.74125 74.365683 \n",
       "L 114.08925 92.813053 \n",
       "L 117.43725 92.813053 \n",
       "L 120.78525 109.675864 \n",
       "L 124.13325 125.41342 \n",
       "L 127.48125 140.256592 \n",
       "L 134.17725 154.334897 \n",
       "L 137.52525 154.334897 \n",
       "L 140.87325 167.722706 \n",
       "L 144.22125 167.722706 \n",
       "L 150.91725 167.722706 \n",
       "L 157.61325 180.459002 \n",
       "L 160.96125 180.459002 \n",
       "L 164.30925 192.555963 \n",
       "L 167.65725 204.001412 \n",
       "L 171.00525 204.001412 \n",
       "L 174.35325 204.001412 \n",
       "L 184.39725 204.001412 \n",
       "L 191.09325 204.001412 \n",
       "L 194.44125 204.001412 \n",
       "L 201.13725 204.001412 \n",
       "L 231.26925 204.001412 \n",
       "L 251.35725 204.001412 \n",
       "L 274.79325 204.001412 \n",
       "L 281.48925 204.001412 \n",
       "L 288.18525 214.756364 \n",
       "L 301.57725 214.756364 \n",
       "L 325.01325 214.756364 \n",
       "L 351.79725 214.756364 \n",
       "L 365.18925 214.756364 \n",
       "L 395.32125 214.756364 \n",
       "L 395.32125 117.409995 \n",
       "L 395.32125 117.409995 \n",
       "L 365.18925 117.409995 \n",
       "L 351.79725 117.409995 \n",
       "L 325.01325 117.409995 \n",
       "L 301.57725 117.409995 \n",
       "L 288.18525 117.409995 \n",
       "L 281.48925 103.33169 \n",
       "L 274.79325 103.33169 \n",
       "L 251.35725 103.33169 \n",
       "L 231.26925 103.33169 \n",
       "L 201.13725 103.33169 \n",
       "L 194.44125 103.33169 \n",
       "L 191.09325 103.33169 \n",
       "L 184.39725 103.33169 \n",
       "L 174.35325 103.33169 \n",
       "L 171.00525 103.33169 \n",
       "L 167.65725 103.33169 \n",
       "L 164.30925 89.943881 \n",
       "L 160.96125 77.207586 \n",
       "L 157.61325 77.207586 \n",
       "L 150.91725 65.110624 \n",
       "L 144.22125 65.110624 \n",
       "L 140.87325 65.110624 \n",
       "L 137.52525 53.665176 \n",
       "L 134.17725 53.665176 \n",
       "L 127.48125 42.910224 \n",
       "L 124.13325 32.920139 \n",
       "L 120.78525 23.824437 \n",
       "L 117.43725 17.083636 \n",
       "L 114.08925 17.083636 \n",
       "L 110.74125 17.083636 \n",
       "L 104.04525 17.083636 \n",
       "L 97.34925 17.083636 \n",
       "L 83.95725 17.083636 \n",
       "L 43.78125 17.083636 \n",
       "z\n",
       "\" style=\"fill:#ff7f0e;fill-opacity:0.12;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"ma1c83b134d\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#ma1c83b134d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <defs>\n",
       "       <path d=\"M 31.78125 66.40625 \n",
       "Q 24.171875 66.40625 20.328125 58.90625 \n",
       "Q 16.5 51.421875 16.5 36.375 \n",
       "Q 16.5 21.390625 20.328125 13.890625 \n",
       "Q 24.171875 6.390625 31.78125 6.390625 \n",
       "Q 39.453125 6.390625 43.28125 13.890625 \n",
       "Q 47.125 21.390625 47.125 36.375 \n",
       "Q 47.125 51.421875 43.28125 58.90625 \n",
       "Q 39.453125 66.40625 31.78125 66.40625 \n",
       "z\n",
       "M 31.78125 74.21875 \n",
       "Q 44.046875 74.21875 50.515625 64.515625 \n",
       "Q 56.984375 54.828125 56.984375 36.375 \n",
       "Q 56.984375 17.96875 50.515625 8.265625 \n",
       "Q 44.046875 -1.421875 31.78125 -1.421875 \n",
       "Q 19.53125 -1.421875 13.0625 8.265625 \n",
       "Q 6.59375 17.96875 6.59375 36.375 \n",
       "Q 6.59375 54.828125 13.0625 64.515625 \n",
       "Q 19.53125 74.21875 31.78125 74.21875 \n",
       "z\n",
       "\" id=\"DejaVuSans-48\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(40.6 239.238437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"110.74125\" xlink:href=\"#ma1c83b134d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 20 -->\n",
       "      <defs>\n",
       "       <path d=\"M 19.1875 8.296875 \n",
       "L 53.609375 8.296875 \n",
       "L 53.609375 0 \n",
       "L 7.328125 0 \n",
       "L 7.328125 8.296875 \n",
       "Q 12.9375 14.109375 22.625 23.890625 \n",
       "Q 32.328125 33.6875 34.8125 36.53125 \n",
       "Q 39.546875 41.84375 41.421875 45.53125 \n",
       "Q 43.3125 49.21875 43.3125 52.78125 \n",
       "Q 43.3125 58.59375 39.234375 62.25 \n",
       "Q 35.15625 65.921875 28.609375 65.921875 \n",
       "Q 23.96875 65.921875 18.8125 64.3125 \n",
       "Q 13.671875 62.703125 7.8125 59.421875 \n",
       "L 7.8125 69.390625 \n",
       "Q 13.765625 71.78125 18.9375 73 \n",
       "Q 24.125 74.21875 28.421875 74.21875 \n",
       "Q 39.75 74.21875 46.484375 68.546875 \n",
       "Q 53.21875 62.890625 53.21875 53.421875 \n",
       "Q 53.21875 48.921875 51.53125 44.890625 \n",
       "Q 49.859375 40.875 45.40625 35.40625 \n",
       "Q 44.1875 33.984375 37.640625 27.21875 \n",
       "Q 31.109375 20.453125 19.1875 8.296875 \n",
       "z\n",
       "\" id=\"DejaVuSans-50\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(104.37875 239.238437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-50\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"177.70125\" xlink:href=\"#ma1c83b134d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 40 -->\n",
       "      <defs>\n",
       "       <path d=\"M 37.796875 64.3125 \n",
       "L 12.890625 25.390625 \n",
       "L 37.796875 25.390625 \n",
       "z\n",
       "M 35.203125 72.90625 \n",
       "L 47.609375 72.90625 \n",
       "L 47.609375 25.390625 \n",
       "L 58.015625 25.390625 \n",
       "L 58.015625 17.1875 \n",
       "L 47.609375 17.1875 \n",
       "L 47.609375 0 \n",
       "L 37.796875 0 \n",
       "L 37.796875 17.1875 \n",
       "L 4.890625 17.1875 \n",
       "L 4.890625 26.703125 \n",
       "z\n",
       "\" id=\"DejaVuSans-52\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(171.33875 239.238437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-52\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"244.66125\" xlink:href=\"#ma1c83b134d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 60 -->\n",
       "      <defs>\n",
       "       <path d=\"M 33.015625 40.375 \n",
       "Q 26.375 40.375 22.484375 35.828125 \n",
       "Q 18.609375 31.296875 18.609375 23.390625 \n",
       "Q 18.609375 15.53125 22.484375 10.953125 \n",
       "Q 26.375 6.390625 33.015625 6.390625 \n",
       "Q 39.65625 6.390625 43.53125 10.953125 \n",
       "Q 47.40625 15.53125 47.40625 23.390625 \n",
       "Q 47.40625 31.296875 43.53125 35.828125 \n",
       "Q 39.65625 40.375 33.015625 40.375 \n",
       "z\n",
       "M 52.59375 71.296875 \n",
       "L 52.59375 62.3125 \n",
       "Q 48.875 64.0625 45.09375 64.984375 \n",
       "Q 41.3125 65.921875 37.59375 65.921875 \n",
       "Q 27.828125 65.921875 22.671875 59.328125 \n",
       "Q 17.53125 52.734375 16.796875 39.40625 \n",
       "Q 19.671875 43.65625 24.015625 45.921875 \n",
       "Q 28.375 48.1875 33.59375 48.1875 \n",
       "Q 44.578125 48.1875 50.953125 41.515625 \n",
       "Q 57.328125 34.859375 57.328125 23.390625 \n",
       "Q 57.328125 12.15625 50.6875 5.359375 \n",
       "Q 44.046875 -1.421875 33.015625 -1.421875 \n",
       "Q 20.359375 -1.421875 13.671875 8.265625 \n",
       "Q 6.984375 17.96875 6.984375 36.375 \n",
       "Q 6.984375 53.65625 15.1875 63.9375 \n",
       "Q 23.390625 74.21875 37.203125 74.21875 \n",
       "Q 40.921875 74.21875 44.703125 73.484375 \n",
       "Q 48.484375 72.75 52.59375 71.296875 \n",
       "z\n",
       "\" id=\"DejaVuSans-54\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(238.29875 239.238437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-54\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"311.62125\" xlink:href=\"#ma1c83b134d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 80 -->\n",
       "      <defs>\n",
       "       <path d=\"M 31.78125 34.625 \n",
       "Q 24.75 34.625 20.71875 30.859375 \n",
       "Q 16.703125 27.09375 16.703125 20.515625 \n",
       "Q 16.703125 13.921875 20.71875 10.15625 \n",
       "Q 24.75 6.390625 31.78125 6.390625 \n",
       "Q 38.8125 6.390625 42.859375 10.171875 \n",
       "Q 46.921875 13.96875 46.921875 20.515625 \n",
       "Q 46.921875 27.09375 42.890625 30.859375 \n",
       "Q 38.875 34.625 31.78125 34.625 \n",
       "z\n",
       "M 21.921875 38.8125 \n",
       "Q 15.578125 40.375 12.03125 44.71875 \n",
       "Q 8.5 49.078125 8.5 55.328125 \n",
       "Q 8.5 64.0625 14.71875 69.140625 \n",
       "Q 20.953125 74.21875 31.78125 74.21875 \n",
       "Q 42.671875 74.21875 48.875 69.140625 \n",
       "Q 55.078125 64.0625 55.078125 55.328125 \n",
       "Q 55.078125 49.078125 51.53125 44.71875 \n",
       "Q 48 40.375 41.703125 38.8125 \n",
       "Q 48.828125 37.15625 52.796875 32.3125 \n",
       "Q 56.78125 27.484375 56.78125 20.515625 \n",
       "Q 56.78125 9.90625 50.3125 4.234375 \n",
       "Q 43.84375 -1.421875 31.78125 -1.421875 \n",
       "Q 19.734375 -1.421875 13.25 4.234375 \n",
       "Q 6.78125 9.90625 6.78125 20.515625 \n",
       "Q 6.78125 27.484375 10.78125 32.3125 \n",
       "Q 14.796875 37.15625 21.921875 38.8125 \n",
       "z\n",
       "M 18.3125 54.390625 \n",
       "Q 18.3125 48.734375 21.84375 45.5625 \n",
       "Q 25.390625 42.390625 31.78125 42.390625 \n",
       "Q 38.140625 42.390625 41.71875 45.5625 \n",
       "Q 45.3125 48.734375 45.3125 54.390625 \n",
       "Q 45.3125 60.0625 41.71875 63.234375 \n",
       "Q 38.140625 66.40625 31.78125 66.40625 \n",
       "Q 25.390625 66.40625 21.84375 63.234375 \n",
       "Q 18.3125 60.0625 18.3125 54.390625 \n",
       "z\n",
       "\" id=\"DejaVuSans-56\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(305.25875 239.238437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-56\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"378.58125\" xlink:href=\"#ma1c83b134d\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 100 -->\n",
       "      <defs>\n",
       "       <path d=\"M 12.40625 8.296875 \n",
       "L 28.515625 8.296875 \n",
       "L 28.515625 63.921875 \n",
       "L 10.984375 60.40625 \n",
       "L 10.984375 69.390625 \n",
       "L 28.421875 72.90625 \n",
       "L 38.28125 72.90625 \n",
       "L 38.28125 8.296875 \n",
       "L 54.390625 8.296875 \n",
       "L 54.390625 0 \n",
       "L 12.40625 0 \n",
       "z\n",
       "\" id=\"DejaVuSans-49\"/>\n",
       "      </defs>\n",
       "      <g transform=\"translate(369.0375 239.238437)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-49\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_7\">\n",
       "     <!-- Days post-transplant -->\n",
       "     <defs>\n",
       "      <path d=\"M 19.671875 64.796875 \n",
       "L 19.671875 8.109375 \n",
       "L 31.59375 8.109375 \n",
       "Q 46.6875 8.109375 53.6875 14.9375 \n",
       "Q 60.6875 21.78125 60.6875 36.53125 \n",
       "Q 60.6875 51.171875 53.6875 57.984375 \n",
       "Q 46.6875 64.796875 31.59375 64.796875 \n",
       "z\n",
       "M 9.8125 72.90625 \n",
       "L 30.078125 72.90625 \n",
       "Q 51.265625 72.90625 61.171875 64.09375 \n",
       "Q 71.09375 55.28125 71.09375 36.53125 \n",
       "Q 71.09375 17.671875 61.125 8.828125 \n",
       "Q 51.171875 0 30.078125 0 \n",
       "L 9.8125 0 \n",
       "z\n",
       "\" id=\"DejaVuSans-68\"/>\n",
       "      <path d=\"M 34.28125 27.484375 \n",
       "Q 23.390625 27.484375 19.1875 25 \n",
       "Q 14.984375 22.515625 14.984375 16.5 \n",
       "Q 14.984375 11.71875 18.140625 8.90625 \n",
       "Q 21.296875 6.109375 26.703125 6.109375 \n",
       "Q 34.1875 6.109375 38.703125 11.40625 \n",
       "Q 43.21875 16.703125 43.21875 25.484375 \n",
       "L 43.21875 27.484375 \n",
       "z\n",
       "M 52.203125 31.203125 \n",
       "L 52.203125 0 \n",
       "L 43.21875 0 \n",
       "L 43.21875 8.296875 \n",
       "Q 40.140625 3.328125 35.546875 0.953125 \n",
       "Q 30.953125 -1.421875 24.3125 -1.421875 \n",
       "Q 15.921875 -1.421875 10.953125 3.296875 \n",
       "Q 6 8.015625 6 15.921875 \n",
       "Q 6 25.140625 12.171875 29.828125 \n",
       "Q 18.359375 34.515625 30.609375 34.515625 \n",
       "L 43.21875 34.515625 \n",
       "L 43.21875 35.40625 \n",
       "Q 43.21875 41.609375 39.140625 45 \n",
       "Q 35.0625 48.390625 27.6875 48.390625 \n",
       "Q 23 48.390625 18.546875 47.265625 \n",
       "Q 14.109375 46.140625 10.015625 43.890625 \n",
       "L 10.015625 52.203125 \n",
       "Q 14.9375 54.109375 19.578125 55.046875 \n",
       "Q 24.21875 56 28.609375 56 \n",
       "Q 40.484375 56 46.34375 49.84375 \n",
       "Q 52.203125 43.703125 52.203125 31.203125 \n",
       "z\n",
       "\" id=\"DejaVuSans-97\"/>\n",
       "      <path d=\"M 32.171875 -5.078125 \n",
       "Q 28.375 -14.84375 24.75 -17.8125 \n",
       "Q 21.140625 -20.796875 15.09375 -20.796875 \n",
       "L 7.90625 -20.796875 \n",
       "L 7.90625 -13.28125 \n",
       "L 13.1875 -13.28125 \n",
       "Q 16.890625 -13.28125 18.9375 -11.515625 \n",
       "Q 21 -9.765625 23.484375 -3.21875 \n",
       "L 25.09375 0.875 \n",
       "L 2.984375 54.6875 \n",
       "L 12.5 54.6875 \n",
       "L 29.59375 11.921875 \n",
       "L 46.6875 54.6875 \n",
       "L 56.203125 54.6875 \n",
       "z\n",
       "\" id=\"DejaVuSans-121\"/>\n",
       "      <path d=\"M 44.28125 53.078125 \n",
       "L 44.28125 44.578125 \n",
       "Q 40.484375 46.53125 36.375 47.5 \n",
       "Q 32.28125 48.484375 27.875 48.484375 \n",
       "Q 21.1875 48.484375 17.84375 46.4375 \n",
       "Q 14.5 44.390625 14.5 40.28125 \n",
       "Q 14.5 37.15625 16.890625 35.375 \n",
       "Q 19.28125 33.59375 26.515625 31.984375 \n",
       "L 29.59375 31.296875 \n",
       "Q 39.15625 29.25 43.1875 25.515625 \n",
       "Q 47.21875 21.78125 47.21875 15.09375 \n",
       "Q 47.21875 7.46875 41.1875 3.015625 \n",
       "Q 35.15625 -1.421875 24.609375 -1.421875 \n",
       "Q 20.21875 -1.421875 15.453125 -0.5625 \n",
       "Q 10.6875 0.296875 5.421875 2 \n",
       "L 5.421875 11.28125 \n",
       "Q 10.40625 8.6875 15.234375 7.390625 \n",
       "Q 20.0625 6.109375 24.8125 6.109375 \n",
       "Q 31.15625 6.109375 34.5625 8.28125 \n",
       "Q 37.984375 10.453125 37.984375 14.40625 \n",
       "Q 37.984375 18.0625 35.515625 20.015625 \n",
       "Q 33.0625 21.96875 24.703125 23.78125 \n",
       "L 21.578125 24.515625 \n",
       "Q 13.234375 26.265625 9.515625 29.90625 \n",
       "Q 5.8125 33.546875 5.8125 39.890625 \n",
       "Q 5.8125 47.609375 11.28125 51.796875 \n",
       "Q 16.75 56 26.8125 56 \n",
       "Q 31.78125 56 36.171875 55.265625 \n",
       "Q 40.578125 54.546875 44.28125 53.078125 \n",
       "z\n",
       "\" id=\"DejaVuSans-115\"/>\n",
       "      <path id=\"DejaVuSans-32\"/>\n",
       "      <path d=\"M 18.109375 8.203125 \n",
       "L 18.109375 -20.796875 \n",
       "L 9.078125 -20.796875 \n",
       "L 9.078125 54.6875 \n",
       "L 18.109375 54.6875 \n",
       "L 18.109375 46.390625 \n",
       "Q 20.953125 51.265625 25.265625 53.625 \n",
       "Q 29.59375 56 35.59375 56 \n",
       "Q 45.5625 56 51.78125 48.09375 \n",
       "Q 58.015625 40.1875 58.015625 27.296875 \n",
       "Q 58.015625 14.40625 51.78125 6.484375 \n",
       "Q 45.5625 -1.421875 35.59375 -1.421875 \n",
       "Q 29.59375 -1.421875 25.265625 0.953125 \n",
       "Q 20.953125 3.328125 18.109375 8.203125 \n",
       "z\n",
       "M 48.6875 27.296875 \n",
       "Q 48.6875 37.203125 44.609375 42.84375 \n",
       "Q 40.53125 48.484375 33.40625 48.484375 \n",
       "Q 26.265625 48.484375 22.1875 42.84375 \n",
       "Q 18.109375 37.203125 18.109375 27.296875 \n",
       "Q 18.109375 17.390625 22.1875 11.75 \n",
       "Q 26.265625 6.109375 33.40625 6.109375 \n",
       "Q 40.53125 6.109375 44.609375 11.75 \n",
       "Q 48.6875 17.390625 48.6875 27.296875 \n",
       "z\n",
       "\" id=\"DejaVuSans-112\"/>\n",
       "      <path d=\"M 30.609375 48.390625 \n",
       "Q 23.390625 48.390625 19.1875 42.75 \n",
       "Q 14.984375 37.109375 14.984375 27.296875 \n",
       "Q 14.984375 17.484375 19.15625 11.84375 \n",
       "Q 23.34375 6.203125 30.609375 6.203125 \n",
       "Q 37.796875 6.203125 41.984375 11.859375 \n",
       "Q 46.1875 17.53125 46.1875 27.296875 \n",
       "Q 46.1875 37.015625 41.984375 42.703125 \n",
       "Q 37.796875 48.390625 30.609375 48.390625 \n",
       "z\n",
       "M 30.609375 56 \n",
       "Q 42.328125 56 49.015625 48.375 \n",
       "Q 55.71875 40.765625 55.71875 27.296875 \n",
       "Q 55.71875 13.875 49.015625 6.21875 \n",
       "Q 42.328125 -1.421875 30.609375 -1.421875 \n",