From 9e9117e74477b548ba0885d7bfd7e187a12b404c Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 13 Mar 2020 19:02:42 +0530 Subject: Added Colab notebook --- COVID_19.ipynb | 756 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 756 insertions(+) create mode 100644 COVID_19.ipynb diff --git a/COVID_19.ipynb b/COVID_19.ipynb new file mode 100644 index 0000000..431cf4f --- /dev/null +++ b/COVID_19.ipynb @@ -0,0 +1,756 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "COVID-19.ipynb", + "provenance": [], + "collapsed_sections": [] + }, + "kernelspec": { + "name": "ir", + "display_name": "R" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "5QHd73zDF7AQ", + "colab_type": "text" + }, + "source": [ + "# Possible Drugs for Combating COVID-19\n", + "\n", + "The base code is a fork of Tinka Vidovic's submission for Sage Health Competition" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ZbxnissApuJx", + "colab_type": "text" + }, + "source": [ + "## Dependencies\n", + "\n", + "To access the Connectivity Map Data, we need to install the PharmacoGx library" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "Jw7YDVZhCq1R", + "colab_type": "code", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 68 + }, + "outputId": "efb69b26-6403-480f-e88c-02c1ffafdbf5" + }, + "source": [ + "if (!requireNamespace(\"BiocManager\", quietly = TRUE))\n", + " install.packages(\"BiocManager\")" + ], + "execution_count": 1, + "outputs": [ + { + "output_type": "stream", + "text": [ + "Installing package into ‘/usr/local/lib/R/site-library’\n", + "(as ‘lib’ is unspecified)\n", + "\n" + ], + "name": "stderr" + } + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "mfQEYHamDD3j", + "colab_type": "code", + "outputId": "7ad00184-2a5a-4bd9-9f5f-6755863ab9f9", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 241 + } + }, + "source": [ + "BiocManager::install(\"PharmacoGx\")" + ], + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "text": [ + "Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.3 (2020-02-29)\n", + "\n", + "Installing package(s) 'BiocVersion', 'PharmacoGx'\n", + "\n", + "also installing the dependencies ‘formatR’, ‘lambda.r’, ‘futile.options’, ‘futile.logger’, ‘snow’, ‘gtools’, ‘gdata’, ‘slam’, ‘sets’, ‘limma’, ‘data.table’, ‘BiocParallel’, ‘gridExtra’, ‘fastmatch’, ‘RANN’, ‘NISTunits’, ‘pracma’, ‘maps’, ‘BiocGenerics’, ‘gplots’, ‘igraph’, ‘relations’, ‘marray’, ‘fgsea’, ‘shinyjs’, ‘shinydashboard’, ‘visNetwork’, ‘celestial’, ‘plotrix’, ‘sm’, ‘mapproj’, ‘bitops’, ‘SnowballC’, ‘Biobase’, ‘piano’, ‘magicaxis’, ‘caTools’, ‘downloader’, ‘lsa’\n", + "\n", + "\n", + "Old packages: 'broom', 'covr', 'crosstalk', 'curl', 'dplyr', 'farver',\n", + " 'forcats', 'fs', 'ggplot2', 'glue', 'lifecycle', 'plyr', 'processx', 'rlang',\n", + " 'roxygen2', 'rprojroot', 'shiny', 'testthat', 'vctrs', 'xfun', 'xml2',\n", + " 'xtable', 'foreign', 'nlme', 'survival'\n", + "\n" + ], + "name": "stderr" + } + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "GzheUFgYDRdI", + "colab_type": "code", + "outputId": "53c655a6-3581-49bb-9791-4844256fb89d", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 119 + } + }, + "source": [ + "library(PharmacoGx)" + ], + "execution_count": 3, + "outputs": [ + { + "output_type": "stream", + "text": [ + "Warning message:\n", + "“no DISPLAY variable so Tk is not available”\n", + "Registered S3 method overwritten by 'ggplot2':\n", + " method from\n", + " print.element sets\n", + "\n" + ], + "name": "stderr" + } + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "dPXPIiVjDZPd", + "colab_type": "code", + "outputId": "0063c9e9-34ff-4f7a-d8ea-e2c3f3fd68c8", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 516 + } + }, + "source": [ + "availablePSets()" + ], + "execution_count": 4, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + " PSet.Name Dataset.Type Available.Molecular.Profiles\n", + "CCLE_2013 CCLE_2013 sensitivity rna/mutation \n", + "CCLE CCLE sensitivity rna/rnaseq/mutation/cnv \n", + "GDSC_2013 GDSC_2013 sensitivity rna/mutation \n", + "GDSC GDSC sensitivity rna/rna2/mutation/fusion/cnv\n", + "GDSC1000 GDSC1000 sensitivity rna \n", + "gCSI gCSI sensitivity rnaseq/cnv \n", + "FIMM FIMM sensitivity \n", + "CTRPv2 CTRPv2 sensitivity \n", + "CMAP CMAP perturbation rna \n", + "L1000_compounds L1000_compounds perturbation rna \n", + "L1000_genetic L1000_genetic perturbation rna \n", + " Date.Updated \n", + "CCLE_2013 Tue Sep 15 18:50:07 2015\n", + "CCLE Thu Dec 10 18:17:14 2015\n", + "GDSC_2013 Mon Oct 5 16:07:54 2015\n", + "GDSC Wed Dec 30 10:44:21 2015\n", + "GDSC1000 Thu Aug 25 11:13:00 2016\n", + "gCSI Mon Jun 13 18:50:12 2016\n", + "FIMM Mon Oct 3 17:14:00 2016 \n", + "CTRPv2 Thu Aug 25 11:15:00 2016\n", + "CMAP Mon Sep 21 02:38:45 2015\n", + "L1000_compounds Mon Jan 25 12:51:00 2016\n", + "L1000_genetic Mon Jan 25 12:51:00 2016\n", + " URL \n", + "CCLE_2013 https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CCLE_Nature2013.RData\n", + "CCLE https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CCLE.RData \n", + "GDSC_2013 https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CGP_Nature2013.RData \n", + "GDSC https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/GDSC.RData \n", + "GDSC1000 https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/GDSC1000.RData \n", + "gCSI https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/gCSI.RData \n", + "FIMM https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/FIMM.RData \n", + "CTRPv2 https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CTRPv2.RData \n", + "CMAP https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CMAP.RData \n", + "L1000_compounds https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/L1000_compounds.RData\n", + "L1000_genetic https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/L1000_genetic.RData " + ], + "text/latex": "A data.frame: 11 × 5\n\\begin{tabular}{r|lllll}\n & PSet.Name & Dataset.Type & Available.Molecular.Profiles & Date.Updated & URL\\\\\n & & & & & \\\\\n\\hline\n\tCCLE\\_2013 & CCLE\\_2013 & sensitivity & rna/mutation & Tue Sep 15 18:50:07 2015 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CCLE\\_Nature2013.RData\\\\\n\tCCLE & CCLE & sensitivity & rna/rnaseq/mutation/cnv & Thu Dec 10 18:17:14 2015 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CCLE.RData \\\\\n\tGDSC\\_2013 & GDSC\\_2013 & sensitivity & rna/mutation & Mon Oct 5 16:07:54 2015 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CGP\\_Nature2013.RData \\\\\n\tGDSC & GDSC & sensitivity & rna/rna2/mutation/fusion/cnv & Wed Dec 30 10:44:21 2015 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/GDSC.RData \\\\\n\tGDSC1000 & GDSC1000 & sensitivity & rna & Thu Aug 25 11:13:00 2016 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/GDSC1000.RData \\\\\n\tgCSI & gCSI & sensitivity & rnaseq/cnv & Mon Jun 13 18:50:12 2016 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/gCSI.RData \\\\\n\tFIMM & FIMM & sensitivity & & Mon Oct 3 17:14:00 2016 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/FIMM.RData \\\\\n\tCTRPv2 & CTRPv2 & sensitivity & & Thu Aug 25 11:15:00 2016 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CTRPv2.RData \\\\\n\tCMAP & CMAP & perturbation & rna & Mon Sep 21 02:38:45 2015 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CMAP.RData \\\\\n\tL1000\\_compounds & L1000\\_compounds & perturbation & rna & Mon Jan 25 12:51:00 2016 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/L1000\\_compounds.RData\\\\\n\tL1000\\_genetic & L1000\\_genetic & perturbation & rna & Mon Jan 25 12:51:00 2016 & https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/L1000\\_genetic.RData \\\\\n\\end{tabular}\n", + "text/markdown": "\nA data.frame: 11 × 5\n\n| | PSet.Name <fct> | Dataset.Type <fct> | Available.Molecular.Profiles <fct> | Date.Updated <fct> | URL <fct> |\n|---|---|---|---|---|---|\n| CCLE_2013 | CCLE_2013 | sensitivity | rna/mutation | Tue Sep 15 18:50:07 2015 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CCLE_Nature2013.RData |\n| CCLE | CCLE | sensitivity | rna/rnaseq/mutation/cnv | Thu Dec 10 18:17:14 2015 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CCLE.RData |\n| GDSC_2013 | GDSC_2013 | sensitivity | rna/mutation | Mon Oct 5 16:07:54 2015 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CGP_Nature2013.RData |\n| GDSC | GDSC | sensitivity | rna/rna2/mutation/fusion/cnv | Wed Dec 30 10:44:21 2015 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/GDSC.RData |\n| GDSC1000 | GDSC1000 | sensitivity | rna | Thu Aug 25 11:13:00 2016 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/GDSC1000.RData |\n| gCSI | gCSI | sensitivity | rnaseq/cnv | Mon Jun 13 18:50:12 2016 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/gCSI.RData |\n| FIMM | FIMM | sensitivity | | Mon Oct 3 17:14:00 2016 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/FIMM.RData |\n| CTRPv2 | CTRPv2 | sensitivity | | Thu Aug 25 11:15:00 2016 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CTRPv2.RData |\n| CMAP | CMAP | perturbation | rna | Mon Sep 21 02:38:45 2015 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CMAP.RData |\n| L1000_compounds | L1000_compounds | perturbation | rna | Mon Jan 25 12:51:00 2016 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/L1000_compounds.RData |\n| L1000_genetic | L1000_genetic | perturbation | rna | Mon Jan 25 12:51:00 2016 | https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/L1000_genetic.RData |\n\n", + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\n", + "
A data.frame: 11 × 5
PSet.NameDataset.TypeAvailable.Molecular.ProfilesDate.UpdatedURL
<fct><fct><fct><fct><fct>
CCLE_2013CCLE_2013 sensitivity rna/mutation Tue Sep 15 18:50:07 2015https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CCLE_Nature2013.RData
CCLECCLE sensitivity rna/rnaseq/mutation/cnv Thu Dec 10 18:17:14 2015https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CCLE.RData
GDSC_2013GDSC_2013 sensitivity rna/mutation Mon Oct 5 16:07:54 2015https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CGP_Nature2013.RData
GDSCGDSC sensitivity rna/rna2/mutation/fusion/cnvWed Dec 30 10:44:21 2015https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/GDSC.RData
GDSC1000GDSC1000 sensitivity rna Thu Aug 25 11:13:00 2016https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/GDSC1000.RData
gCSIgCSI sensitivity rnaseq/cnv Mon Jun 13 18:50:12 2016https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/gCSI.RData
FIMMFIMM sensitivity Mon Oct 3 17:14:00 2016 https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/FIMM.RData
CTRPv2CTRPv2 sensitivity Thu Aug 25 11:15:00 2016https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CTRPv2.RData
CMAPCMAP perturbationrna Mon Sep 21 02:38:45 2015https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/CMAP.RData
L1000_compoundsL1000_compoundsperturbationrna Mon Jan 25 12:51:00 2016https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/L1000_compounds.RData
L1000_geneticL1000_genetic perturbationrna Mon Jan 25 12:51:00 2016https://www.pmgenomics.ca/bhklab/sites/default/files/downloads/L1000_genetic.RData
\n" + ] + }, + "metadata": { + "tags": [] + } + } + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Cv2ZRsi7BJ4I", + "colab_type": "text" + }, + "source": [ + "## Downloading Dataset" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "uwzHt0hdGPk7", + "colab_type": "code", + "colab": {} + }, + "source": [ + "drugPerturbation = downloadPertSig(\"CMAP\")" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "pMkDzmNTFvgW", + "colab_type": "text" + }, + "source": [ + "## SARS" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "XAqpzSUbHZqk", + "colab_type": "code", + "colab": {} + }, + "source": [ + "download.file(url = \"https://raw.githubusercontent.com/navanchauhan/COVID-19/master/icSARS_Cov_Day7_None_GSE50000.csv\", destfile = \"SARS.csv\", method = \"wget\")" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "shz9Xd-mHgqL", + "colab_type": "code", + "colab": {} + }, + "source": [ + "sars_genes = read.csv(\"SARS.csv\", header = T, stringsAsFactors=F)\n", + "rownames(sars_genes) = sars_genes$Feature\n", + "sars = sars_genes$Direction\n", + "names(sars) = sars_genes$Feature" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "Ske4-qlhIV95", + "colab_type": "code", + "colab": {} + }, + "source": [ + "result_SARS = apply(\n", + " drugPerturbation[,,c(\"tstat\", \"fdr\")],\n", + " 2,\n", + " function(x, sars){\n", + " return(\n", + " connectivityScore(\n", + " x=x,\n", + " y=sars,\n", + " method=\"fgsea\",\n", + " nperm=100\n", + " )\n", + " )\n", + " },sars = sars\n", + " )" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "C--r-iYCIYsl", + "colab_type": "code", + "colab": {} + }, + "source": [ + "rownames(result_SARS) = c(\"Connectivity\", \"P_value\")\n", + "result_SARS = t(result_SARS)" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "K1BfNGY2JBPI", + "colab_type": "code", + "colab": {} + }, + "source": [ + "p_value_sars = result_SARS[order((result_SARS[,2]),decreasing = F),]" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "fUrHWW-WJC-_", + "colab_type": "code", + "outputId": "924918ce-ac98-486b-8bf4-0c838da624e1", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + } + }, + "source": [ + "p_value_sars" + ], + "execution_count": 26, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + " Connectivity P_value \n", + "rifabutin -0.340380 0.003296745\n", + "prochlorperazine -0.360245 0.003331658\n", + "phenazopyridine -0.321425 0.003346158\n", + "promazine -0.338460 0.003356367\n", + "syrosingopine -0.318895 0.003397262\n", + "levomepromazine -0.329905 0.003426580\n", + "nicergoline -0.297975 0.003437066\n", + "vorinostat -0.378310 0.003475393\n", + "maprotiline -0.345995 0.003528251\n", + "GW-8510 -0.365775 0.003659742\n", + "pyrvinium -0.312920 0.003809205\n", + "norcyclobenzaprine -0.319960 0.003837280\n", + "trifluoperazine -0.375195 0.004118781\n", + "ampyrone -0.302000 0.004346651\n", + "raloxifene -0.301795 0.004923140\n", + "fluphenazine -0.351740 0.005123401\n", + "methotrexate -0.336405 0.006074034\n", + "trichostatin A -0.330245 0.006293210\n", + "valproic acid -0.376625 0.006502227\n", + "rescinnamine -0.323295 0.006625811\n", + "nortriptyline -0.346990 0.006697707\n", + "eucatropine -0.288555 0.007156083\n", + "sirolimus -0.361685 0.007393165\n", + "Prestwick-559 -0.332285 0.008811770\n", + "4,5-dianilinophthalimide -0.809330 0.008840897\n", + "phenoxybenzamine -0.338050 0.008959175\n", + "resveratrol -0.350465 0.009149784\n", + "lycorine 0.319895 0.009335550\n", + "lasalocid -0.287965 0.009401784\n", + "HC toxin -0.371125 0.009747133\n", + "⋮ ⋮ ⋮ \n", + "PF-00562151-00 0 1 \n", + "pioglitazone 0 1 \n", + "PF-00539745-00 0 1 \n", + "valdecoxib 0 1 \n", + "PF-00539758-00 0 1 \n", + "orlistat 0 1 \n", + "5707885 0 1 \n", + "C-75 0 1 \n", + "5155877 0 1 \n", + "dinoprostone 0 1 \n", + "5194442 0 1 \n", + "AG-028671 0 1 \n", + "6-bromoindirubin-3'-oxime 0 1 \n", + "Gly-His-Lys 0 1 \n", + "STOCK1N-35696 0 1 \n", + "STOCK1N-28457 0 1 \n", + "H-89 0 1 \n", + "SB-202190 0 1 \n", + "NS-398 0 1 \n", + "SB-203580 0 1 \n", + "AH-6809 0 1 \n", + "alsterpaullone 0 1 \n", + "SC-19220 0 1 \n", + "0198306-0000 0 1 \n", + "AR-A014418 0 1 \n", + "semustine 0 1 \n", + "CP-944629 0 1 \n", + "irinotecan 0 1 \n", + "BCB000039 0 1 \n", + "11-deoxy-16,16-dimethylprostaglandin E2 0 1 " + ], + "text/latex": "A matrix: 1288 × 2 of type dbl\n\\begin{tabular}{r|ll}\n & Connectivity & P\\_value\\\\\n\\hline\n\trifabutin & -0.340380 & 0.003296745\\\\\n\tprochlorperazine & -0.360245 & 0.003331658\\\\\n\tphenazopyridine & -0.321425 & 0.003346158\\\\\n\tpromazine & -0.338460 & 0.003356367\\\\\n\tsyrosingopine & -0.318895 & 0.003397262\\\\\n\tlevomepromazine & -0.329905 & 0.003426580\\\\\n\tnicergoline & -0.297975 & 0.003437066\\\\\n\tvorinostat & -0.378310 & 0.003475393\\\\\n\tmaprotiline & -0.345995 & 0.003528251\\\\\n\tGW-8510 & -0.365775 & 0.003659742\\\\\n\tpyrvinium & -0.312920 & 0.003809205\\\\\n\tnorcyclobenzaprine & -0.319960 & 0.003837280\\\\\n\ttrifluoperazine & -0.375195 & 0.004118781\\\\\n\tampyrone & -0.302000 & 0.004346651\\\\\n\traloxifene & -0.301795 & 0.004923140\\\\\n\tfluphenazine & -0.351740 & 0.005123401\\\\\n\tmethotrexate & -0.336405 & 0.006074034\\\\\n\ttrichostatin A & -0.330245 & 0.006293210\\\\\n\tvalproic acid & -0.376625 & 0.006502227\\\\\n\trescinnamine & -0.323295 & 0.006625811\\\\\n\tnortriptyline & -0.346990 & 0.006697707\\\\\n\teucatropine & -0.288555 & 0.007156083\\\\\n\tsirolimus & -0.361685 & 0.007393165\\\\\n\tPrestwick-559 & -0.332285 & 0.008811770\\\\\n\t4,5-dianilinophthalimide & -0.809330 & 0.008840897\\\\\n\tphenoxybenzamine & -0.338050 & 0.008959175\\\\\n\tresveratrol & -0.350465 & 0.009149784\\\\\n\tlycorine & 0.319895 & 0.009335550\\\\\n\tlasalocid & -0.287965 & 0.009401784\\\\\n\tHC toxin & -0.371125 & 0.009747133\\\\\n\t⋮ & ⋮ & ⋮\\\\\n\tPF-00562151-00 & 0 & 1\\\\\n\tpioglitazone & 0 & 1\\\\\n\tPF-00539745-00 & 0 & 1\\\\\n\tvaldecoxib & 0 & 1\\\\\n\tPF-00539758-00 & 0 & 1\\\\\n\torlistat & 0 & 1\\\\\n\t5707885 & 0 & 1\\\\\n\tC-75 & 0 & 1\\\\\n\t5155877 & 0 & 1\\\\\n\tdinoprostone & 0 & 1\\\\\n\t5194442 & 0 & 1\\\\\n\tAG-028671 & 0 & 1\\\\\n\t6-bromoindirubin-3'-oxime & 0 & 1\\\\\n\tGly-His-Lys & 0 & 1\\\\\n\tSTOCK1N-35696 & 0 & 1\\\\\n\tSTOCK1N-28457 & 0 & 1\\\\\n\tH-89 & 0 & 1\\\\\n\tSB-202190 & 0 & 1\\\\\n\tNS-398 & 0 & 1\\\\\n\tSB-203580 & 0 & 1\\\\\n\tAH-6809 & 0 & 1\\\\\n\talsterpaullone & 0 & 1\\\\\n\tSC-19220 & 0 & 1\\\\\n\t0198306-0000 & 0 & 1\\\\\n\tAR-A014418 & 0 & 1\\\\\n\tsemustine & 0 & 1\\\\\n\tCP-944629 & 0 & 1\\\\\n\tirinotecan & 0 & 1\\\\\n\tBCB000039 & 0 & 1\\\\\n\t11-deoxy-16,16-dimethylprostaglandin E2 & 0 & 1\\\\\n\\end{tabular}\n", + "text/markdown": "\nA matrix: 1288 × 2 of type dbl\n\n| | Connectivity | P_value |\n|---|---|---|\n| rifabutin | -0.340380 | 0.003296745 |\n| prochlorperazine | -0.360245 | 0.003331658 |\n| phenazopyridine | -0.321425 | 0.003346158 |\n| promazine | -0.338460 | 0.003356367 |\n| syrosingopine | -0.318895 | 0.003397262 |\n| levomepromazine | -0.329905 | 0.003426580 |\n| nicergoline | -0.297975 | 0.003437066 |\n| vorinostat | -0.378310 | 0.003475393 |\n| maprotiline | -0.345995 | 0.003528251 |\n| GW-8510 | -0.365775 | 0.003659742 |\n| pyrvinium | -0.312920 | 0.003809205 |\n| norcyclobenzaprine | -0.319960 | 0.003837280 |\n| trifluoperazine | -0.375195 | 0.004118781 |\n| ampyrone | -0.302000 | 0.004346651 |\n| raloxifene | -0.301795 | 0.004923140 |\n| fluphenazine | -0.351740 | 0.005123401 |\n| methotrexate | -0.336405 | 0.006074034 |\n| trichostatin A | -0.330245 | 0.006293210 |\n| valproic acid | -0.376625 | 0.006502227 |\n| rescinnamine | -0.323295 | 0.006625811 |\n| nortriptyline | -0.346990 | 0.006697707 |\n| eucatropine | -0.288555 | 0.007156083 |\n| sirolimus | -0.361685 | 0.007393165 |\n| Prestwick-559 | -0.332285 | 0.008811770 |\n| 4,5-dianilinophthalimide | -0.809330 | 0.008840897 |\n| phenoxybenzamine | -0.338050 | 0.008959175 |\n| resveratrol | -0.350465 | 0.009149784 |\n| lycorine | 0.319895 | 0.009335550 |\n| lasalocid | -0.287965 | 0.009401784 |\n| HC toxin | -0.371125 | 0.009747133 |\n| ⋮ | ⋮ | ⋮ |\n| PF-00562151-00 | 0 | 1 |\n| pioglitazone | 0 | 1 |\n| PF-00539745-00 | 0 | 1 |\n| valdecoxib | 0 | 1 |\n| PF-00539758-00 | 0 | 1 |\n| orlistat | 0 | 1 |\n| 5707885 | 0 | 1 |\n| C-75 | 0 | 1 |\n| 5155877 | 0 | 1 |\n| dinoprostone | 0 | 1 |\n| 5194442 | 0 | 1 |\n| AG-028671 | 0 | 1 |\n| 6-bromoindirubin-3'-oxime | 0 | 1 |\n| Gly-His-Lys | 0 | 1 |\n| STOCK1N-35696 | 0 | 1 |\n| STOCK1N-28457 | 0 | 1 |\n| H-89 | 0 | 1 |\n| SB-202190 | 0 | 1 |\n| NS-398 | 0 | 1 |\n| SB-203580 | 0 | 1 |\n| AH-6809 | 0 | 1 |\n| alsterpaullone | 0 | 1 |\n| SC-19220 | 0 | 1 |\n| 0198306-0000 | 0 | 1 |\n| AR-A014418 | 0 | 1 |\n| semustine | 0 | 1 |\n| CP-944629 | 0 | 1 |\n| irinotecan | 0 | 1 |\n| BCB000039 | 0 | 1 |\n| 11-deoxy-16,16-dimethylprostaglandin E2 | 0 | 1 |\n\n", + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\n", + "
A matrix: 1288 × 2 of type dbl
ConnectivityP_value
rifabutin-0.3403800.003296745
prochlorperazine-0.3602450.003331658
phenazopyridine-0.3214250.003346158
promazine-0.3384600.003356367
syrosingopine-0.3188950.003397262
levomepromazine-0.3299050.003426580
nicergoline-0.2979750.003437066
vorinostat-0.3783100.003475393
maprotiline-0.3459950.003528251
GW-8510-0.3657750.003659742
pyrvinium-0.3129200.003809205
norcyclobenzaprine-0.3199600.003837280
trifluoperazine-0.3751950.004118781
ampyrone-0.3020000.004346651
raloxifene-0.3017950.004923140
fluphenazine-0.3517400.005123401
methotrexate-0.3364050.006074034
trichostatin A-0.3302450.006293210
valproic acid-0.3766250.006502227
rescinnamine-0.3232950.006625811
nortriptyline-0.3469900.006697707
eucatropine-0.2885550.007156083
sirolimus-0.3616850.007393165
Prestwick-559-0.3322850.008811770
4,5-dianilinophthalimide-0.8093300.008840897
phenoxybenzamine-0.3380500.008959175
resveratrol-0.3504650.009149784
lycorine 0.3198950.009335550
lasalocid-0.2879650.009401784
HC toxin-0.3711250.009747133
PF-00562151-0001
pioglitazone01
PF-00539745-0001
valdecoxib01
PF-00539758-0001
orlistat01
570788501
C-7501
515587701
dinoprostone01
519444201
AG-02867101
6-bromoindirubin-3'-oxime01
Gly-His-Lys01
STOCK1N-3569601
STOCK1N-2845701
H-8901
SB-20219001
NS-39801
SB-20358001
AH-680901
alsterpaullone01
SC-1922001
0198306-000001
AR-A01441801
semustine01
CP-94462901
irinotecan01
BCB00003901
11-deoxy-16,16-dimethylprostaglandin E201
\n" + ] + }, + "metadata": { + "tags": [] + } + } + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "BbC58sKwFyUi", + "colab_type": "text" + }, + "source": [ + "## MERS" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "7oFv2xQVJEsj", + "colab_type": "code", + "colab": {} + }, + "source": [ + "download.file(url = \"https://raw.githubusercontent.com/navanchauhan/COVID-19/master/HCoV_EMC2012_24Hour_23631916_GSE45042.csv\", destfile = \"MERS.csv\", method = \"wget\")" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "r3iLjkycKou9", + "colab_type": "code", + "colab": {} + }, + "source": [ + "mers_genes = read.csv(\"MERS.csv\",stringsAsFactors = F, header = T, sep=\",\")\n", + "rownames(mers_genes) = mers_genes$Feature\n", + "mers = mers_genes$Direction\n", + "names(mers) = mers_genes$Feature" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "uKfv_vOjKtcf", + "colab_type": "code", + "colab": {} + }, + "source": [ + "result_MERS = apply(\n", + " drugPerturbation[,,c(\"tstat\", \"fdr\")],\n", + " 2,\n", + " function(x, mers){\n", + " return(\n", + " connectivityScore(\n", + " x=x,\n", + " y=mers,\n", + " method=\"fgsea\",\n", + " nperm=100\n", + " )\n", + " )\n", + " }, mers = mers\n", + " )" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "TJaum6BnKvAP", + "colab_type": "code", + "colab": {} + }, + "source": [ + "rownames(result_MERS) = c(\"Connectivity\", \"P_value\")\n", + "result_MERS = t(result_MERS)" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "KkYUjIqmKwcu", + "colab_type": "code", + "colab": {} + }, + "source": [ + "p_value_mers = result_MERS[order((result_MERS[,2]),decreasing = F),]" + ], + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "V9XdAqjaKyVa", + "colab_type": "code", + "outputId": "55a67f34-85a5-4bd1-f28e-7c2b83dbf003", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + } + }, + "source": [ + "p_value_mers" + ], + "execution_count": 35, + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": [ + " Connectivity P_value \n", + "levomepromazine -0.329905 0.003302104\n", + "valproic acid -0.376625 0.003346158\n", + "syrosingopine -0.318895 0.003356370\n", + "resveratrol -0.350465 0.003504892\n", + "eucatropine -0.288555 0.003504892\n", + "prochlorperazine -0.360245 0.003519621\n", + "rescinnamine -0.323295 0.003554838\n", + "norcyclobenzaprine -0.319960 0.003584323\n", + "maprotiline -0.345995 0.003606370\n", + "nortriptyline -0.346990 0.003643482\n", + "ampyrone -0.302000 0.003951350\n", + "fluphenazine -0.351740 0.004253396\n", + "trifluoperazine -0.375195 0.004397685\n", + "vorinostat -0.378310 0.006276333\n", + "antimycin A -0.282915 0.006291056\n", + "CP-690334-01 -0.286560 0.006316860\n", + "phenazopyridine -0.321425 0.006486558\n", + "trichostatin A -0.330245 0.006587867\n", + "chlorpromazine -0.312550 0.006712225\n", + "lasalocid -0.287965 0.006791518\n", + "GW-8510 -0.365775 0.006879944\n", + "LY-294002 -0.358135 0.007161588\n", + "lycorine 0.319895 0.007339762\n", + "raloxifene -0.301795 0.007994990\n", + "promazine -0.338460 0.008005639\n", + "thioridazine -0.338605 0.008009466\n", + "metixene -0.288785 0.008806100\n", + "rifabutin -0.340380 0.008823347\n", + "vigabatrin 0.294850 0.009206287\n", + "Prestwick-559 -0.332285 0.009270520\n", + "⋮ ⋮ ⋮ \n", + "PF-00562151-00 0 1 \n", + "pioglitazone 0 1 \n", + "PF-00539745-00 0 1 \n", + "valdecoxib 0 1 \n", + "PF-00539758-00 0 1 \n", + "orlistat 0 1 \n", + "5707885 0 1 \n", + "C-75 0 1 \n", + "5155877 0 1 \n", + "dinoprostone 0 1 \n", + "5194442 0 1 \n", + "AG-028671 0 1 \n", + "6-bromoindirubin-3'-oxime 0 1 \n", + "Gly-His-Lys 0 1 \n", + "STOCK1N-35696 0 1 \n", + "STOCK1N-28457 0 1 \n", + "H-89 0 1 \n", + "SB-202190 0 1 \n", + "NS-398 0 1 \n", + "SB-203580 0 1 \n", + "AH-6809 0 1 \n", + "alsterpaullone 0 1 \n", + "SC-19220 0 1 \n", + "0198306-0000 0 1 \n", + "AR-A014418 0 1 \n", + "semustine 0 1 \n", + "CP-944629 0 1 \n", + "irinotecan 0 1 \n", + "BCB000039 0 1 \n", + "11-deoxy-16,16-dimethylprostaglandin E2 0 1 " + ], + "text/latex": "A matrix: 1288 × 2 of type dbl\n\\begin{tabular}{r|ll}\n & Connectivity & P\\_value\\\\\n\\hline\n\tlevomepromazine & -0.329905 & 0.003302104\\\\\n\tvalproic acid & -0.376625 & 0.003346158\\\\\n\tsyrosingopine & -0.318895 & 0.003356370\\\\\n\tresveratrol & -0.350465 & 0.003504892\\\\\n\teucatropine & -0.288555 & 0.003504892\\\\\n\tprochlorperazine & -0.360245 & 0.003519621\\\\\n\trescinnamine & -0.323295 & 0.003554838\\\\\n\tnorcyclobenzaprine & -0.319960 & 0.003584323\\\\\n\tmaprotiline & -0.345995 & 0.003606370\\\\\n\tnortriptyline & -0.346990 & 0.003643482\\\\\n\tampyrone & -0.302000 & 0.003951350\\\\\n\tfluphenazine & -0.351740 & 0.004253396\\\\\n\ttrifluoperazine & -0.375195 & 0.004397685\\\\\n\tvorinostat & -0.378310 & 0.006276333\\\\\n\tantimycin A & -0.282915 & 0.006291056\\\\\n\tCP-690334-01 & -0.286560 & 0.006316860\\\\\n\tphenazopyridine & -0.321425 & 0.006486558\\\\\n\ttrichostatin A & -0.330245 & 0.006587867\\\\\n\tchlorpromazine & -0.312550 & 0.006712225\\\\\n\tlasalocid & -0.287965 & 0.006791518\\\\\n\tGW-8510 & -0.365775 & 0.006879944\\\\\n\tLY-294002 & -0.358135 & 0.007161588\\\\\n\tlycorine & 0.319895 & 0.007339762\\\\\n\traloxifene & -0.301795 & 0.007994990\\\\\n\tpromazine & -0.338460 & 0.008005639\\\\\n\tthioridazine & -0.338605 & 0.008009466\\\\\n\tmetixene & -0.288785 & 0.008806100\\\\\n\trifabutin & -0.340380 & 0.008823347\\\\\n\tvigabatrin & 0.294850 & 0.009206287\\\\\n\tPrestwick-559 & -0.332285 & 0.009270520\\\\\n\t⋮ & ⋮ & ⋮\\\\\n\tPF-00562151-00 & 0 & 1\\\\\n\tpioglitazone & 0 & 1\\\\\n\tPF-00539745-00 & 0 & 1\\\\\n\tvaldecoxib & 0 & 1\\\\\n\tPF-00539758-00 & 0 & 1\\\\\n\torlistat & 0 & 1\\\\\n\t5707885 & 0 & 1\\\\\n\tC-75 & 0 & 1\\\\\n\t5155877 & 0 & 1\\\\\n\tdinoprostone & 0 & 1\\\\\n\t5194442 & 0 & 1\\\\\n\tAG-028671 & 0 & 1\\\\\n\t6-bromoindirubin-3'-oxime & 0 & 1\\\\\n\tGly-His-Lys & 0 & 1\\\\\n\tSTOCK1N-35696 & 0 & 1\\\\\n\tSTOCK1N-28457 & 0 & 1\\\\\n\tH-89 & 0 & 1\\\\\n\tSB-202190 & 0 & 1\\\\\n\tNS-398 & 0 & 1\\\\\n\tSB-203580 & 0 & 1\\\\\n\tAH-6809 & 0 & 1\\\\\n\talsterpaullone & 0 & 1\\\\\n\tSC-19220 & 0 & 1\\\\\n\t0198306-0000 & 0 & 1\\\\\n\tAR-A014418 & 0 & 1\\\\\n\tsemustine & 0 & 1\\\\\n\tCP-944629 & 0 & 1\\\\\n\tirinotecan & 0 & 1\\\\\n\tBCB000039 & 0 & 1\\\\\n\t11-deoxy-16,16-dimethylprostaglandin E2 & 0 & 1\\\\\n\\end{tabular}\n", + "text/markdown": "\nA matrix: 1288 × 2 of type dbl\n\n| | Connectivity | P_value |\n|---|---|---|\n| levomepromazine | -0.329905 | 0.003302104 |\n| valproic acid | -0.376625 | 0.003346158 |\n| syrosingopine | -0.318895 | 0.003356370 |\n| resveratrol | -0.350465 | 0.003504892 |\n| eucatropine | -0.288555 | 0.003504892 |\n| prochlorperazine | -0.360245 | 0.003519621 |\n| rescinnamine | -0.323295 | 0.003554838 |\n| norcyclobenzaprine | -0.319960 | 0.003584323 |\n| maprotiline | -0.345995 | 0.003606370 |\n| nortriptyline | -0.346990 | 0.003643482 |\n| ampyrone | -0.302000 | 0.003951350 |\n| fluphenazine | -0.351740 | 0.004253396 |\n| trifluoperazine | -0.375195 | 0.004397685 |\n| vorinostat | -0.378310 | 0.006276333 |\n| antimycin A | -0.282915 | 0.006291056 |\n| CP-690334-01 | -0.286560 | 0.006316860 |\n| phenazopyridine | -0.321425 | 0.006486558 |\n| trichostatin A | -0.330245 | 0.006587867 |\n| chlorpromazine | -0.312550 | 0.006712225 |\n| lasalocid | -0.287965 | 0.006791518 |\n| GW-8510 | -0.365775 | 0.006879944 |\n| LY-294002 | -0.358135 | 0.007161588 |\n| lycorine | 0.319895 | 0.007339762 |\n| raloxifene | -0.301795 | 0.007994990 |\n| promazine | -0.338460 | 0.008005639 |\n| thioridazine | -0.338605 | 0.008009466 |\n| metixene | -0.288785 | 0.008806100 |\n| rifabutin | -0.340380 | 0.008823347 |\n| vigabatrin | 0.294850 | 0.009206287 |\n| Prestwick-559 | -0.332285 | 0.009270520 |\n| ⋮ | ⋮ | ⋮ |\n| PF-00562151-00 | 0 | 1 |\n| pioglitazone | 0 | 1 |\n| PF-00539745-00 | 0 | 1 |\n| valdecoxib | 0 | 1 |\n| PF-00539758-00 | 0 | 1 |\n| orlistat | 0 | 1 |\n| 5707885 | 0 | 1 |\n| C-75 | 0 | 1 |\n| 5155877 | 0 | 1 |\n| dinoprostone | 0 | 1 |\n| 5194442 | 0 | 1 |\n| AG-028671 | 0 | 1 |\n| 6-bromoindirubin-3'-oxime | 0 | 1 |\n| Gly-His-Lys | 0 | 1 |\n| STOCK1N-35696 | 0 | 1 |\n| STOCK1N-28457 | 0 | 1 |\n| H-89 | 0 | 1 |\n| SB-202190 | 0 | 1 |\n| NS-398 | 0 | 1 |\n| SB-203580 | 0 | 1 |\n| AH-6809 | 0 | 1 |\n| alsterpaullone | 0 | 1 |\n| SC-19220 | 0 | 1 |\n| 0198306-0000 | 0 | 1 |\n| AR-A014418 | 0 | 1 |\n| semustine | 0 | 1 |\n| CP-944629 | 0 | 1 |\n| irinotecan | 0 | 1 |\n| BCB000039 | 0 | 1 |\n| 11-deoxy-16,16-dimethylprostaglandin E2 | 0 | 1 |\n\n", + "text/html": [ + "\n", + "\n", + "\n", + "\t\n", + "\n", + "\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\t\n", + "\n", + "
A matrix: 1288 × 2 of type dbl
ConnectivityP_value
levomepromazine-0.3299050.003302104
valproic acid-0.3766250.003346158
syrosingopine-0.3188950.003356370
resveratrol-0.3504650.003504892
eucatropine-0.2885550.003504892
prochlorperazine-0.3602450.003519621
rescinnamine-0.3232950.003554838
norcyclobenzaprine-0.3199600.003584323
maprotiline-0.3459950.003606370
nortriptyline-0.3469900.003643482
ampyrone-0.3020000.003951350
fluphenazine-0.3517400.004253396
trifluoperazine-0.3751950.004397685
vorinostat-0.3783100.006276333
antimycin A-0.2829150.006291056
CP-690334-01-0.2865600.006316860
phenazopyridine-0.3214250.006486558
trichostatin A-0.3302450.006587867
chlorpromazine-0.3125500.006712225
lasalocid-0.2879650.006791518
GW-8510-0.3657750.006879944
LY-294002-0.3581350.007161588
lycorine 0.3198950.007339762
raloxifene-0.3017950.007994990
promazine-0.3384600.008005639
thioridazine-0.3386050.008009466
metixene-0.2887850.008806100
rifabutin-0.3403800.008823347
vigabatrin 0.2948500.009206287
Prestwick-559-0.3322850.009270520
PF-00562151-0001
pioglitazone01
PF-00539745-0001
valdecoxib01
PF-00539758-0001
orlistat01
570788501
C-7501
515587701
dinoprostone01
519444201
AG-02867101
6-bromoindirubin-3'-oxime01
Gly-His-Lys01
STOCK1N-3569601
STOCK1N-2845701
H-8901
SB-20219001
NS-39801
SB-20358001
AH-680901
alsterpaullone01
SC-1922001
0198306-000001
AR-A01441801
semustine01
CP-94462901
irinotecan01
BCB00003901
11-deoxy-16,16-dimethylprostaglandin E201
\n" + ] + }, + "metadata": { + "tags": [] + } + } + ] + } + ] +} \ No newline at end of file -- cgit v1.2.3