{"id":15,"date":"2021-03-04T12:07:35","date_gmt":"2021-03-04T12:07:35","guid":{"rendered":"http:\/\/imdeafoodcompubio.com\/?page_id=15"},"modified":"2023-08-03T08:25:14","modified_gmt":"2023-08-03T08:25:14","slug":"gene_sets","status":"publish","type":"page","link":"https:\/\/imdeafoodcompubio.com\/index.php\/gene_sets\/","title":{"rendered":"Gene Sets"},"content":{"rendered":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title><\/title>\n\n  <link rel=\"stylesheet\" href=\"\/\/code.jquery.com\/ui\/1.13.2\/themes\/base\/jquery-ui.css\">\n<script src=\"https:\/\/code.jquery.com\/jquery-3.6.0.min.js\"><\/script>\n<script src=\"https:\/\/code.jquery.com\/jquery-migrate-1.4.1.min.js\"><\/script>\n  <script src=\"https:\/\/code.jquery.com\/ui\/1.13.2\/jquery-ui.js\"><\/script>\n\n\n\n<link rel=\"stylesheet\" href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@4.5.3\/dist\/css\/bootstrap.min.css\" integrity=\"sha384-TX8t27EcRE3e\/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2\" crossorigin=\"anonymous\">\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@4.5.3\/dist\/js\/bootstrap.bundle.min.js\" integrity=\"sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ\/JpcUGGOn+Y7RsweNrtN\/tE3MoK7ZeZDyx\" crossorigin=\"anonymous\"><\/script>\n\n<link rel=\"stylesheet\" type=\"text\/css\" href=\"https:\/\/cdn.datatables.net\/v\/dt\/dt-1.13.1\/datatables.min.css\"\/>\n \n<script type=\"text\/javascript\" src=\"https:\/\/cdn.datatables.net\/v\/dt\/dt-1.13.1\/datatables.min.js\"><\/script>\n\n\n<style>\n    body{\n        font-family: Arial, sans-serif;\n    }\n\n.search-box , .div-py{\n    margin:5%;\n    margin-left:10%;\n    width: 80%;\n        position: relative;\n        display:inline-block;\n        font-size: 22px;\n        padding-bottom: 0px;\n    }\n            .search-box select , .div-py select {\n        height: 60px;\n        padding: 5px 10px;\n        border: 1px solid #CCCCCC;\n        font-size: 22px;\n        max-height: 100px;\n        background-color:#DFDEDE;\n    }\n    .search-box input[type=\"text\"] {\n        height: 60px;\n        padding: 5px 10px;\n        border: 1px solid #CCCCCC;\n        font-size: 22px;\n        max-height: 100px;\n        background-color:#DFDEDE;\n    }\n       .search-box input[type=\"number\"] { \n        height: 60px;\n        padding: 5px 10px;\n        border: 1px solid #CCCCCC;\n        font-size: 22px;\n        max-height: 100px;\n        background-color:##DFDEDE;\n    }\n    .result{\n        z-index: 999;\n        top: 100%;\n        left: 0;\n        overflow: auto;\n        opacity: 1;\n    }\n    .search-box input[type=\"text\"], .result{\n        width: 100%;\n        box-sizing: border-box;\n        max-height: 115px;\n        opacity: 1;\n    }\n    .result p{\n        margin: 0;\n        padding: 7px 10px;\n        border: 1px solid #CCCCCC;\n        border-top: none;\n        cursor: pointer;\n        max-height: 100px;\n    }\n    .result p:hover{\n        background: #f2f2f2;\n        max-height: 100px;\n    }\n\n        .button{         \n            float:right; \n  background-color: #4CAF50; \n  border: none;\n  color: white;\n  height: 10%;\n  text-align: center;\n  text-decoration: none;\n  font-size: 10px;\n        }\n#carouseldiv{\n    display: inline-block;\n}\n\ninput[type=\"radio\"]{\n    height: 20px;\n  width: 15px;\n}\n.site-content{\n    height: auto;\n}\n\n\n#selectdata h3{\n    display:inline;\n}\n\n\n    #gifbt {\n  position: absolute;\n  left: 45%;\n  top: 60%;\n  width: 5%;\n  height: 50%;\n    }\n       #gifbt2 {\n             position: absolute;\n           left: 45%;\n           top:40%;\n  width: 5%;\n  height: 10%;\n    }\n    \n\n    .form-control:focus {\n  border-color: #0000FF;\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102,205,170, 0.6);\n}\n\n       #column , .search-py{\n                background-color:white;\n            width: 100%;\n            border-radius: 10px;\n              \/*box-shadow: 5px 10px #f1f1f1;*\/\n        \n }\n \n #divtable ,#divtable2 , #divtable3{\n    background-color:white; \n                border-radius: 10px;\n                font-size:22px; \nwidth:auto;   \nmargin-top:2%;\n }\n \n\n #titletable{\n     margin-top:2%;\n  text-align:center;   \n }\n #selectdata h2{\n     display:inline; \n       text-align:center;   \n           font-size:2em;\n\n\n }\n #divtable h2 , #divtable2 h2 , #divtable3 h2 {\n    display:inline; \n }\n#divtable .dataTables_wrapper,\n#divtable2 .dataTables_wrapper ,\n#divtable3 .dataTables_wrapper{\n    width: 80%;\n    margin: 2%;\n    margin-left: 10%;\n        margin-right: 10%;\n    font-size:22px;\n}\nh1 {\n    font-size:2em;\n}\n\n        .helpresult{\n        z-index: 999;\n        top: 100%;\n        left: 10%;\n        overflow: auto;\n        opacity: 1;\n    }\n           #divtable p , #divtable2 p ,  #divtable3 p {\n     color: black !important ;\n    }\n        .helpresult p , .helpresult h2 , #enrichp{\n            font-size:0.9vw;\n        margin: 0;\n        margin-left:2%;\n        font-style:italic;\n        max-height: 100px;\n    }\n    \n    .dataTables_length, .dataTables_length select\n    { \n        font-size: 1.5em;\n        \n    }\n    .popover{\n                font-size: 2em;\n\n    }\n    caption {\n        text-align:center;\n                font-style:italic;\n                caption-side:top;\n    }\n    #modaldesc , #modaldesc2 {\ntop:10%;\n}\n.btn-secondary{\n            width:20%;\n        font-size:16px;\n        margin-left:10%;\n}\n\n.btn-primary {\n        width:10%;\n        font-size:16px;\n        margin-left:40%;\n        }\n\n\n    \n<\/style>\n<\/head>\n<body>\n\n\n\n<!-- Initialize the popover -->\n<script>\njQuery(document).ready(function($) {\n    $('[data-toggle=\"popover\"]').popover();\n        var info = $('.info');\n    info.mouseenter(function() {\n      $(this).popover('show');\n    });\n    \/\/ Hide the popover when the user's mouse leaves the button\n    info.mouseleave(function() {\n      $(this).popover('hide');\n    });\n    \n      var thead = $('th');\n    thead.mouseenter(function() {\n      $(this).popover('show');\n    });\n        thead.mouseleave(function() {\n      $(this).popover('hide');\n    });\n  })\n<\/script>\n\n<div id=\"column\">\n\n<div class=\"search-box\">\n\n          Food or bioactive compound  <img id=\"datahelp1\" class=\"help \"src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\"   width=\"15\" \/>\n          <div class=\"helpresult\" id=\"help1\"><\/div>\n            <input type=\"text\" id=\"key\" class=\"key form-control\" placeholder='Resveratrol'>\n            <div class=\"result\" id=\"result\"><\/div>\n            <br>\n           Cell line\/Sample type <img id=\"datahelpsample\" class=\"help \"src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\"   width=\"15\" \/>\n          <div class=\"helpresult\" id=\"helpsample\"><\/div>\n                        <input type=\"text\" id=\"origen\" class=\"key form-control\" placeholder=''>\n            <div class=\"result\" id=\"result2\"><\/div>\n<\/div>      \n        <\/div>\n\n                <div id='divtable'>\n\n<table id=\"table\" class=\"hover\" style=\"width:100%\">\n    <caption> Click in the row of interest to get more information  <\/caption>\n    <thead><\/thead>\n<\/table>\n<\/div>\n\n        <img decoding=\"async\" id=\"gifbt2\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/2\/2a\/Loading_Key.gif\"   width=\"250\" \/>\n\n\n                <div id='divtable2'>\n                    <div class=\"modal fade\" id=\"modaldesc\"  role=\"dialog\">\n  <div class=\"modal-dialog\">\n    <div class=\"modal-content\">\n      <div class=\"modal-header\">\n        <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n          <span aria-hidden=\"true\">&times;<\/span>\n        <\/button>\n      <\/div>\n      <div class=\"modal-body\">\n        <button type=\"button\" id='copy' class=\"btn btn-secondary\">copy\n         <img id=\"datahelpcopy\" class=\"help \"src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\"   width=\"15\" \/> \n         <\/button>\n        <button type=\"button\" id='tsv' class=\"btn btn-secondary\">TSV<\/button>\n        <button type=\"button\" id='csv' class=\"btn btn-secondary\">CSV<\/button>\n        \n                  <div class=\"helpresult\" id=\"helpcopy\"><\/div>\n\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>\n\n                    <br>\n<h1 id='titletable'>Upregulated genes<\/h1>\n<button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#modaldesc\">\nDownload\n<\/button>\n<table id=\"table1\" class=\"stripe\" style=\"width:100%\">\n<\/table>\n<\/div>\n\n                <div id='divtable3'>\n                                  <div class=\"modal fade\" id=\"modaldesc2\"  role=\"dialog\">\n  <div class=\"modal-dialog\">\n    <div class=\"modal-content\">\n      <div class=\"modal-header\">\n        <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n          <span aria-hidden=\"true\">&times;<\/span>\n        <\/button>\n      <\/div>\n      <div class=\"modal-body\">\n        <button type=\"button\" id='copy' class=\"btn btn-secondary\">copy\n         <img id=\"datahelpcopy2\" class=\"help \"src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\"   width=\"15\" \/> \n         <\/button>\n        <button type=\"button\" id='tsv' class=\"btn btn-secondary\">TSV<\/button>\n        <button type=\"button\" id='csv' class=\"btn btn-secondary\">CSV<\/button>\n        \n                  <div class=\"helpresult\" id=\"helpcopy2\"><\/div>\n\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>\n\n                    <br>\n<h1 id='titletable'>Downregulated genes<\/h1>\n<button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#modaldesc2\">\nDownload\n<\/button>\n<table id=\"table2\" class=\"stripe\" style=\"width:100%\">\n\n    \n<\/table>\n    <\/div>\n\n        <div  class=\"search-py\">\n            <div class=\"div-py\">\n    <div id=\"selectdata\"><h2>Pathway enrichment analysis<\/h2> <img id=\"datahelpenrich\" class=\"help \"src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\"   width=\"15\" \/>\n          <div class=\"helpresult\" id=\"helpenrich\"><\/div>\n          <p id='enrichp'>Click on the box to display the differents pathways options<\/p>\n<select id=\"selecten\">\n    <option value=\"wiky\">WIKIPATHWAYS<\/option>\n<option value=\"molecular\">GO MOLECULAR FUNCTION<\/option>\n<option value=\"biological\">GO BIOLOGICAL PROCESS<\/option>\n<option value=\"celullar\">GO CELULAR COMPONENT<\/option>\n<option value=\"reactome\">REACTOME<\/option>\n<\/select>\n<img decoding=\"async\" id=\"gifbt\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/2\/2a\/Loading_Key.gif\"   width=\"250\" \/>\n<br>\n<button id=\"enrichment\" class=\"button\" >Run enrichment analysis<\/button>\n<br>\n<\/div>\n<\/div>\n\n\n\n\n\n\n\n\n\n<script>\n    \/\/ Define variables and set hide values for css\n$(\"#gifbt\").hide();\n$(\".search-py\").hide();\n$(\"#gifbt2\").hide();\n\n    $(\"#divtable\").hide();\n        $(\"#divtable2\").hide();\n        $(\"#divtable3\").hide();\n\n    $(\"#headertable\").hide();\n    $(\"#data\").hide();\n    $(\"#data2\").hide();\n    $(\"#data3\").hide();\n    var valortrue = false;\n     $(\".tituloupdn\").hide();\n    var datosup=[];\n    var datosdn=[];\n    var d2=[];\n    $(\".descarga\").hide();\n    var arraynom = [\"accession\"  ,\"node_id\",\"treatment\",\"time_point\",\"concentration\", \"origin_name\"];\n    var arraynom2 = [\"Entrezgene_ID\",\"External_Gene_Name\",\"Description\"];\nvar verdadero=false;\nvar idloaddata2 =1;\nvar pathway;\nvar longi2;\nvar nregis=2;\nvar dataset;\nvar nregis2=10;\nvar nregis3=10;\nvar datasecure2={};\nvar datasecure3={};\nvar datanew = {};\nvar datanew2 = {};\nvar datanew3 = {};\nvar datos={};\nvar datos2={};\nvar datos4={};\nvar type=2;\nvar botonvalor =\"fdrug\";\nvar provisional=1;\nvar datacharge=true;\nvar datacharge2=true;\nvar datacharge3=true;\nvar table;\nvar table2;\nvar table3;\nvar orden=\"\";\n    var datadescarga2 ={};\n    var datadescarga={};\n    \n        \n    \njQuery(document).ready(function($) {\n\n\n    \/\/Keyup event to fill the div which will show the autocomplete suggestions\n    $('.key').on('keyup input', function() {        \n                \/\/We get the value and the id of the input.\nvar key = $(this).val();\norden = $(this).attr(\"id\");\n\/\/We check that the value is not null or empty\nif(key != \"\"){\n    \/\/We make a request to ajax that redirects us to another script where the Mysql query will be executed and will return the first 5 records similar to what is being searched for\n    jQuery.ajax({\n        url:'https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/geneset\/ajaxsql.php',\n        type: 'post',\n        data: {search:key, type:1,orden:orden},\n        dataType: 'json',\n        success:function(response){\n            \/\/Here in this if we check which of the two inputs is the one being written\n            \/\/We get the length of the response and add one by one the response in the div\n            if (orden==\"key\") {\n                var len = response.length;\n                $(\"#result\").empty();\n                for( var i = 0; i<len; i++){\n                    var name = response[i]['name'];\n                    $(\"#result\").append(\"<p>\"+name+\"<\/p>\");\n                }   \n            }else {\n                var len = response.length;\n                $(\"#result2\").empty();\n                for( var i = 0; i<len; i++){\n                    var name = response[i]['name'];\n                    $(\"#result2\").append(\"<p>\"+name+\"<\/p>\");\n            }\n        }\n        }, error: function(XMLHttpRequest, textStatus, errorThrown) { \n        alert(\"Status: \" + textStatus); alert(\"Error: \" + errorThrown); \n    }  \n    });\n}else {\n        \/\/If the answer is empty, the result is cleaned\n    $(\".result\").empty();\n}\n})\n\n\/\/Help events, when the event is activated the text is shown to indicate the instructions and when it ends everything is hidden\n\n$(document).on(\"mouseenter\", \".help\", function(){\n$(\".helpresult\").empty();\nvar idhelp = $(this).attr(\"id\");\nif (idhelp==\"datahelp1\") {\n            $(\"#help1\").append(\"<p>Type the term of interest. If FooDrugs database doesn't have experiments with the query term a \u201cNo Results Found\u201d message will appear.<\/p>\");\n                    \n}   else if  (idhelp==\"datahelpsample\") {\n                $(\"#helpsample\").append(\"<p>Allow you to filter by cell line or sample type. If FooDrugs database doesn't have cell lines or sample types with the query term a \u201cNo Results Found\u201d message will appear.<\/p>\");\n\n}\nelse if (idhelp==\"datahelpentries\") {\n            $(\"#helpentries\").append(\"<p>Allow you to filter the number of studies to display<\/p>\");\n                    \n}   \nelse if (idhelp==\"datahelpfilter\") {\n            $(\"#helpfilter\").append(\"<p>Allow you to filter with free text on the table by any field<\/p>\");\n                    \n} else if (idhelp==\"datahelpentries2\") {\n            $(\"#helpentries2\").append(\"<p>Allow you to filter the number of studies to display<\/p>\");\n                    \n}   \nelse if (idhelp==\"datahelpfilter2\") {\n            $(\"#helpfilter2\").append(\"<p>Allow you to filter with free text on the table by any field<\/p>\");\n                    \n}else if (idhelp==\"datahelpentries3\") {\n            $(\"#helpentries3\").append(\"<p>Allow you to filter the number of studies to display<\/p>\");\n                    \n}   \nelse if (idhelp==\"datahelpfilter3\") {\n            $(\"#helpfilter3\").append(\"<p>Allow you to filter with free text on the table by any field<\/p>\");\n                    \n}\nelse if(idhelp==\"datahelpenrich\"){\n                $(\"#helpenrich\").append(\"<p>Allow to perform enrichment analysis with the top overexpressed and underexpressed genes showed in the tables.<\/p>\");\n\n}else if (idhelp==\"datahelpcopy\"){\n                $(\"#helpcopy\").append(\"<p>Allow to copy the information on the clipboard<\/p>\");\n\n}else if (idhelp==\"datahelpcopy2\"){\n                $(\"#helpcopy2\").append(\"<p>Allow to copy the information on the clipboard<\/p>\");\n\n}\n\n\n\n});\n\n $(document).on(\"mouseleave\", \".help\", function(){\n    $(\".helpresult\").empty();\n        });\n\n\/\/Events to go up or down in the page\n $(document).on(\"mouseover\", \"#gncontainer3\", function(){\n    $(\"#cambioupdn\").text(\"UP\");\n    $(\"#cambioupdn\").attr('href', '#headertable2');\n        });\n        \n    $(document).on(\"mouseover\", \"#gncontainer2\", function(){\n    $(\"#cambioupdn\").text(\"DN\");\n    $(\"#cambioupdn\").attr('href', '#headertable3');\n        });\n \n\/\/CLICK event on any of the input options\n$(document).on(\"click\", \".result p\", function(){\n        \/\/Check what input is clicked and call showtables function\n    if (orden==\"key\") {\n        $('#result').empty();     \n         $('#'+orden).val($(this).text());\n         mostrartablas();\n\n    }else{\n        $('#result2').empty();     \n        $('#'+orden).val($(this).text());\n                \/\/Check the value of the first input to call the function\n        if ($('#key').val()!=null) {\n            mostrartablas();\n        }\n    }\n        });\n\n\n\n\n\n\n\/\/Function mostrartablas \n\nfunction mostrartablas(){\n    \/\/Get the value of the two inputs\n\n    var key = $('#key').val();\n    var key2 = $(\"#origen\").val();\n    valortrue = false;\n    $.ajax({\n    url:'https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/geneset\/ajaxsql.php',\n    type: 'post',\n    data: {search:key,search2:key2, type:3},\n    dataType: 'json',\n    success:function(response){\n        console.log(response)\n        \/\/Get the values \u200b\u200bfrom the ajax response and set, check and display the various parameters\/variables\n        let pages = 0;\n        datos['a']=response;\n        datanew=response;\n        datos['type']=type;\n        $(\"#headertable\").show();\n        $(\"#pagination_data\").empty();\n        $(\"#content\").empty();\n        var len = response.length;\n        if ((response[0]['compound'] != undefined && response[0]['treatment'] == undefined) || (response[0]['treatment'] != undefined && response[0]['compound'] == undefined) ) {\n              var datatable = [];\n              \n              \n    for (let index = 0; index < response.length; index++) {\n    datatable[index]=[];\nfor (var value in response[index]){ \n    datatable[index].push(response[index][value]);\n}\n}\nif(datacharge==true){\n    datacharge=false;\n}else {\n    table.destroy();\n}\n                            $(\"#table\").show();\n\n  table = $('#table').DataTable({\n      \n\n        data: datatable,\n        \n        columns: [\n            { title: \"<span  tabindex='0' data-toggle='popover' data-content='GEO study identifier  click on the word to go to the original information source'> Accession <img  src='http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png'   width='15' \/> <\/span>\" ,\n                     \"render\": function (data, type, row) {\n                    return '<a href=\"https:\/\/www.ncbi.nlm.nih.gov\/geo\/query\/acc.cgi?acc=GSE' + data + '\" target=\"no_blank\">' + data + '<\/a>';\n                }\n            },\n            { title: \"Treatment\" },\n            { title: \"Time Point\" },\n            { title: \"Concentration\" },\n            { title: \"Cell line\/Sample type\" },\n           \n        ],\n                 language: {\n        \"lengthMenu\": '<h2> Show entries <\/h2> <img decoding=\"async\" class=\"help\" id=\"datahelpentries\" src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\" width=\"15\"><\/img>   <div class=\"helpresult\" id=\"helpentries\"><\/div> _MENU_ ' ,\n    \"search\": ' <h2> Filter Records<\/h2> <img decoding=\"async\" class=\"help\" id=\"datahelpfilter\" src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\" width=\"15\"><\/img>  <div class=\"helpresult\" id=\"helpfilter\"><\/div> _INPUT_' \n    },\n    });\n  \n    $('[data-toggle=\"popover\"]').popover({\n    'trigger': 'hover',\n});\n$(\"#divtable\").show();\n        }\n    } ,error: function(XMLHttpRequest, textStatus, errorThrown) { \n        alert(\"Status: \" + textStatus); alert(\"Error: \" + errorThrown); \n    }  \n    });\n}\n\n\n\n\n\n\/\/--->\n\/\/Function load_data , load_data2  and load_data3 are used to load the information to the tables shown on the page a is equal to the current page\n\/\/the same for all functions\n\n\n        function load_data2(){\n                $(\"#divtable2\").show();\n    var d2 = [];\n     var ids = [];\n    j=0;\n        for( var i = 0; i<datanew2.length; i++){\n             d2[j]=datanew2[i].split('\\t');\n            id=d2[j][0];\n            if(!ids.includes(id)){\n                           ids.push(id);\n            for (var key in datosresponse['up'][id]) { \n                d2[j].push(datosresponse['up'][id][key]);\n            }\n            }\n         if(d2[j].length!=6){\n               d2.splice(j, 1);\n               \n               j--\n               \n           }\n                           j++;\n\n\n        }\n        datanew2=d2;\n        if(datacharge2==true){\n    datacharge2=false;\n}else {\n    table2.destroy();\n}\n\n        table2 = $('#table1').DataTable({\n        data: d2,\n                columns: [\n               { title: \"<span  id='tablepopover' tabindex='0' data-toggle='popover' data-content='To know more about the gene click on it '> EntrezGene ID <img  src='http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png'   width='15' \/> <\/span>\" ,\n            \"render\": function (data, type, row) {\n                    return '<a href=\"https:\/\/www.ncbi.nlm.nih.gov\/gene\/' + data + '\" target=\"no_blank\">' + data + '<\/a>';\n                }\n                \n            },\n            { title: \"External Gene Name\" },\n            { title: \"Description \", \"width\": \"25%\" },\n            { title: \"logFC\" ,\n                            \"render\": function (data, type, row) {\n                    return round(data);\n                }\n            },\n            { title: \"Adjusted P_Value\",\n                        \"render\": function (data, type, row) {\n                    return round(data);\n                }},\n            { title: \"P_Value\" ,\n                            \"render\": function (data, type, row) {\n                    return round(data);\n                }\n            },\n        ],\n                 language: {\n        \"lengthMenu\": '<h2> Show entries <\/h2> <img decoding=\"async\" class=\"help\" id=\"datahelpentries2\" src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\" width=\"15\"><\/img>   <div class=\"helpresult\" id=\"helpentries2\"><\/div> _MENU_' ,\n    \"search\": ' <h2> Filter Records<\/h2> <img decoding=\"async\" class=\"help\" id=\"datahelpfilter2\" src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\" width=\"15\"><\/img>  <div class=\"helpresult\" id=\"helpfilter2\"><\/div> _INPUT_' \n    },\n    });\n    \n    $('[data-toggle=\"popover\"]').popover({\n    'trigger': 'hover',\n});\n                }\n        \nfunction round(num) {\n    var m = Number((Math.abs(num) * 1000).toPrecision(15));\n    return Math.round(m) \/ 1000 * Math.sign(num);\n}\n        function load_data3(){\n                            $(\"#divtable3\").show();\n\n    var d3 = [];\n    j=0\n     var ids = [];\n        for( var i = 0; i<datanew3.length; i++){\n             d3[j]=datanew3[i].split('\\t');\n            id=d3[j][0];\n                        if(!ids.includes(id)){\n                                                       ids.push(id);\n            for (var key in datosresponse['dn'][id]) { \n                d3[j].push(datosresponse['dn'][id][key]);\n            }\n                        }\n           if(d3[j].length!=6){\n               d3.splice(j, 1);\n               j--\n               \n           }\n                           j++;\n           \n               \n        }\n        \n        if(datacharge3==true){\n    datacharge3=false;\n}else {\n    table3.destroy();\n}\n        table3 = $('#table2').DataTable({\n        data: d3,\n                        columns: [\n                         { title: \"<span  id='tablepopover' tabindex='0' data-toggle='popover' data-content='To know more about the gene click on it '> EntrezGene ID <img  src='http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png'   width='15' \/> <\/span>\" ,\n            \"render\": function (data, type, row) {\n                    return '<a href=\"https:\/\/www.ncbi.nlm.nih.gov\/gene\/' + data + '\" target=\"no_blank\">' + data + '<\/a>';\n                }\n                \n            },\n            { title: \"External Gene Name\" },\n            { title: \"Description \", \"width\": \"25%\" },\n{ title: \"logFC\" ,\n                            \"render\": function (data, type, row) {\n                    return round(data);\n                }\n            },\n            { title: \"Adjusted P_Value\",\n                        \"render\": function (data, type, row) {\n                    return round(data);\n                }},\n            { title: \"P_Value\" ,\n                            \"render\": function (data, type, row) {\n                    return round(data);\n                }\n            },\n        ],\n                 language: {\n        \"lengthMenu\": '<h2> Show entries <\/h2> <img decoding=\"async\" class=\"help\" id=\"datahelpentries3\" src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\" width=\"15\"><\/img>   <div class=\"helpresult\" id=\"helpentries3\"><\/div> _MENU_' ,\n    \"search\": ' <h2> Filter Records<\/h2> <img decoding=\"async\" class=\"help\" id=\"datahelpfilter3\" src=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/06\/icon1.png\" width=\"15\"><\/img>  <div class=\"helpresult\" id=\"helpfilter3\"><\/div> _INPUT_' \n    },\n    });\n        $('[data-toggle=\"popover\"]').popover({\n    'trigger': 'hover',\n});\n                }\n\/\/<---\n\n\n\/\/table click event \n    $(document).on('click', '#table tbody tr', function() { \n$(\".highlight\").css({'background-color': \"transparent\" });\n    $( '.highlight' ).removeClass( \"highlight\" );\n        $(this).css(\"background-color\",\"#CDCDCD\");\n        var row = table.row( this ).data()\n        $( this ).addClass( \"highlight\" );\n        var nodeid = row[5];\n       var x;\n        $(\"#gifbt2\").show();\n\/\/First make an ajax request and get the up and dn nodes\n        \/\/These data are stored in an array and sent to a script that will obtain and save the information obtained\n        \/\/Then we make another request to read the created file\n        $.ajax({\n            url:'https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/geneset\/ajaxsql.php',\n            type: 'post',\n            data: {search:nodeid, type:2},\n            dataType: 'json',\n            success:function(response){\n                datos2={};\n                datosresponse={}\n                datos2=response;\n                 datosresponse['up']={};\n                 console.log(datos2.length);\n                 datosresponse['dn']={};\n                 for( var i = 0; i< datos2.length; i++){\n                     iddn=\"\";\n                    if(datos2[i]['up']!=null){\n                        idup=\"\";\n                        idup=datos2[i]['up']['id'];\n                     datosup[i]=idup;\n                      datosresponse['up'][idup]=datos2[i]['up'][idup];\n                    }\n                    if(datos2[i]['dn']!=null){\n                                             iddn=\"\";\n                                            iddn=datos2[i]['dn']['id'];\n                     datosdn[i]=iddn;\n                      datosresponse['dn'][iddn]=datos2[i]['dn'][iddn];\n                                }\n                }\n                 console.log(datosdn);\n                valortrue = true;\n                 $.post('https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/geneset\/python.php', {idup:datosup,iddn:datosdn,type:1}).done(function(data){\n                        x=true;\n                       \n                });\n                \n                 $.ajax({\n    url:'https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/geneset\/lectura.php',\n    type: 'post',\n    dataType: 'json',\n    success:function(response){\n        datanew2=\"\";\n                datanew3=\"\";\n\/\/ The data is parsed to save it in an array and the blank spaces are deleted\ndatanew2=response['up'].split('\\n');\n datanew3=response['dn'].split('\\n');\n datanew2=datanew2.filter(function(n){return n; });\n datanew3=datanew3.filter(function(n){return n; });\n  fundatadescarga();\nload_data2();\nload_data3();\n        $(\"#gifbt2\").hide();\n        $(\".search-py\").show();\n    }  }); \n    \n              }});\n        }); \n\n\n\n\n\n\n\n\n\/\/Enrichment event\n$(document).on(\"click\", \"#enrichment\", function(){\n\/\/First it is verified that the things have been executed, then the values \u200b\u200bof the select are obtained\n    if(valortrue==true){\n        $(\"#gifbt\").show();\n        var select = $(\"#selecten\");\n         pathway=\"\";\n        id=select.val();\n\/\/Depending on the id you have, one thing or another is executed\n\/\/type 2 for any of the options except for reactome\n    if (id==\"molecular\") {\ntype=2;\ndataset=\"0003674\";\nenviar(dataset,type,pathway);\n    }else if (id==\"biological\") {\n       type=2; \n       dataset=\"0008150\";\n       enviar(dataset,type,pathway);\n    }else if (id==\"celullar\") {\n        type=2;\n        dataset=\"0005575\";\n        enviar(dataset,type,pathway);\n    }else if (id==\"reactome\"){\n\/\/A first connection is made with reactome to obtain the token and be able to obtain all the pertinent data later\n        var reactomeURI = 'https:\/\/reactome.org\/AnalysisService\/identifiers\/projection\/\\?pageSize\\=1\\&page\\=1';\n        var dupnew =  datosup.join(\"\\n\")\n\t\t\t\tvar dataUrl = '#EntrezGene\\n'+dupnew;\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: \"post\",\n\t\t\t\t\turl: reactomeURI,\n\t\t\t\t\tdata: dataUrl,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t\"Content-Type\": \"text\/plain\"\n\t\t\t\t\t},\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\tsuccess:function(response){\n\t\t\t\tpathway=(response.pathwaysFound);\n\t            dataset=response.summary.token;\n\/\/The second connection is made with reactome in type 3 obtaining the up genes\n\t             $.post('https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/geneset\/python.php', {idup:datosup,iddn:datosdn,type:3,dataset:dataset,pathway:pathway}).done(function(data){\n\t             });\n\t\t\t\t}\n\t\t\t\t});\n\t\t\t\n        var ddnnew =  datosdn.join(\"\\n\")\n\t\t\t\tvar dataUrl2 = '#EntrezGene\\n'+ddnnew;\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: \"post\",\n\t\t\t\t\turl: reactomeURI,\n\t\t\t\t\tdata: dataUrl2,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t\"Content-Type\": \"text\/plain\"\n\t\t\t\t\t},\n\t\t\t\t\tdataType: \"json\",\n\t\t\t\tsuccess:function(response){\n\/\/Type 4 is executed to obtain the dn genes\n\t\t\t\tpathway=(response.pathwaysFound);\n\t            dataset=response.summary.token;\n\t            type=4;\n\t            \n\t            enviar(dataset,type,pathway);\n\t\t\t\t}\n\t\t\t\t});\n    }\n    else if (id==\"wiky\") {\n        $.post('https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/enrichment\/install.php').done(function(data){\n var url = 'http:\/\/imdeafoodcompubio.com\/index.php\/enrichment_geneset\/' ;\n                var form = $('<form action=\"' + url + '\" method=\"post\" target=\"_blank\">' +\n                '<input type=\"text\" name=\"text\"\/>' +\n                '<\/form>');\n                form.hide();\n        $('body').append(form);\n        form.submit(); \n               $(\"#gifbt\").hide();\n               });\n    }\n    }\n});\n\n\n\/\/ Send function is passed the dataset that has the database, the type that has to execute the script\n\/\/ and the pathway that only works for the reactome option\nfunction enviar(dataset,type,pathway){\n         $.post('https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/geneset\/python.php', {idup:datosup,iddn:datosdn,type:type,dataset:dataset,pathway:pathway,database:id}).done(function(data){\n\/\/after obtaining the data, a form is executed that leads us to a page with the new information\n                var url = 'http:\/\/imdeafoodcompubio.com\/index.php\/enrichment_geneset\/' ;\n                var form = $('<form action=\"' + url + '\" method=\"post\" target=\"_blank\">' +\n                '<input type=\"text\" name=\"text\"\/>' +\n                '<\/form>');\n                form.hide();\n        $('body').append(form);\n        form.submit(); \n               $(\"#gifbt\").hide();\n                    });\n        \n    }\n    \n\n\n\n\n\/\/Funcion para parsear la informacion para que el usuario pueda descargarla\n\/\/Se realiza un split de la informacion del array se almacena en una matriz\nfunction fundatadescarga (){\n    \n            for( var i = 0; i<datasecure2.length; i++){\n            var d2=datasecure2[i].split('\\t'); \n            datadescarga[i]=[];\n                for (let j = 0; j < d2.length; j++) {\n                    \n                    \n                    datadescarga[i][j]=d2[j];\n                    \n                \n        }\n            }\n                    for( var i = 0; i<datasecure3.length; i++){\n            var d2=datasecure3[i].split('\\t'); \n             datadescarga2[i]=[];\n                for (let j = 0; j < d2.length; j++) {\n                    \n                    datadescarga2[i][j]=d2[j];\n                }\n        }\n\n}\n\n\n\/*\n$('.key').on('keyup click', function() {  \n    var key = $(this).val();\n    if (key=='') {\n    var stringclick = '';\n    orden = $(this).attr(\"id\");\n    jQuery.ajax({\n        url:'https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/geneset\/ajaxsql.php',\n        type: 'post',\n        data: {search:stringclick, type:1,orden:orden},\n        dataType: 'json',\n        success:function(response){\n            \/\/Here in this if we check which of the two inputs is the one being written\n            \/\/We get the length of the response and add one by one the response in the div\n            if (orden==\"key\") {\n                var len = response.length;\n                $(\"#result\").empty();\n                for( var i = 0; i<len; i++){\n                    var name = response[i]['name'];\n                    $(\"#result\").append(\"<p>\"+name+\"<\/p>\");\n                }   \n            }else {\n                var len = response.length;\n                $(\"#result2\").empty();\n                for( var i = 0; i<len; i++){\n                    var name = response[i]['name'];\n                    $(\"#result2\").append(\"<p>\"+name+\"<\/p>\");\n            }\n        }\n        }, error: function(XMLHttpRequest, textStatus, errorThrown) { \n        alert(\"Status: \" + textStatus); alert(\"Error: \" + errorThrown); \n        }\n    });\n    }\n});  *\/\n\n$(document).on('click', '#modaldesc .btn-secondary', function() {\n        \/\/Get the page where you are and what type of download it iss\n           var subid= $(this).attr(\"id\");\n\/\/Copy with the obtained data, with this it is added to an input and the copy command is executed later the input is deleted\n            \/\/ With this is on the clipboard\n\/\/We remove the fields from the strati num text yendi array so that there is no information \/\/irrelevant for the user\n            if (subid == \"copy\" ) {\n                dataacopiar=[];\n                copy=\"\";\n                            for (let i = 0; i < datanew2.length || i  < 10 ; i++) {\n                                dataacopiar[i]={};\n            for (var  dato in datanew2[i]){\n            copy=copy+datanew2[i][dato];\n\n}\n}\n                    $('<input id=\"textcopy\">').val(copy).appendTo('body').select();         \n            document.execCommand('copy'); \n            var el = document.getElementById('textcopy');\n            el.remove();\n            }\n                                    \/\/TSV OR CSV the file is sent to descargararchivo.php and the associative array is sent\n            else {\n                dataacopiar=[];\n                console.log(datanew2);\n                            for (let i = 0; i < datanew2.length; i++) {\n                                dataacopiar[i]={};\n            for (var  dato in datanew2[i]){\n    dataacopiar[i][dato]=datanew2[i][dato];\n\n}\n}\n                $.ajax({\n            url:'https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/descargararchivo.php',\n            type: 'post',\n            data: {key:subid,data:dataacopiar,name:\"tablegenesetup\",arrkeys:arraynom2},\n            dataType: 'json',\n            success:function(response){\n                                \/\/Get the name of the file which is on the response and create an element <a> and add the attribute\n                \/\/'download'  and indicate where the file is located and order the element to be clicked\n                \/\/and start the download\n                fileName=response;\n                        fileUrl=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/desc\/\"+fileName;\n  var a = document.createElement(\"a\");\n  a.href = fileUrl;\n  a.setAttribute(\"download\", fileName);\n  a.click();\n            }\n                });\n            }\n            });\n\n\n$(document).on('click', '#modaldesc2 .btn-secondary', function() {\n        \/\/Get the page where you are and what type of download it iss\n           var subid= $(this).attr(\"id\");\n\/\/Copy with the obtained data, with this it is added to an input and the copy command is executed later the input is deleted\n            \/\/ With this is on the clipboard\n\/\/We remove the fields from the strati num text yendi array so that there is no information \/\/irrelevant for the user\n            if (subid == \"copy\" ) {\n                dataacopiar=[];\n                copy=\"\";\n                            for (let i = 0; i < datanew3.length || i  < 10 ; i++) {\n                                dataacopiar[i]={};\n            for (var  dato in datanew3[i]){\n            copy=copy+datanew3[i][dato];\n\n}\n}\n                    $('<input id=\"textcopy\">').val(copy).appendTo('body').select();         \n            document.execCommand('copy'); \n            var el = document.getElementById('textcopy');\n            el.remove();\n            }\n                                    \/\/TSV OR CSV the file is sent to descargararchivo.php and the associative array is sent\n            else {\n                dataacopiar=[];\n                console.log(datanew2);\n                            for (let i = 0; i < datanew3.length; i++) {\n                                dataacopiar[i]={};\n            for (var  dato in datanew3[i]){\n    dataacopiar[i][dato]=datanew3[i][dato];\n\n}\n}\n                $.ajax({\n            url:'https:\/\/imdeafoodcompubio.com\/wp-content\/themes\/bento-child\/descargararchivo.php',\n            type: 'post',\n            data: {key:subid,data:dataacopiar,name:\"tablegenesetdn\",arrkeys:arraynom2},\n            dataType: 'json',\n            success:function(response){\n                                \/\/Get the name of the file which is on the response and create an element <a> and add the attribute\n                \/\/'download'  and indicate where the file is located and order the element to be clicked\n                \/\/and start the download\n                fileName=response;\n                        fileUrl=\"http:\/\/imdeafoodcompubio.com\/wp-content\/uploads\/2022\/desc\/\"+fileName;\n  var a = document.createElement(\"a\");\n  a.href = fileUrl;\n  a.setAttribute(\"download\", fileName);\n  a.click();\n            }\n                });\n            }\n            });\n\n\n    });\n\n <\/script>\n\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-15","page","type-page","status-publish","hentry","no-thumb"],"_links":{"self":[{"href":"https:\/\/imdeafoodcompubio.com\/index.php\/wp-json\/wp\/v2\/pages\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imdeafoodcompubio.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/imdeafoodcompubio.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/imdeafoodcompubio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imdeafoodcompubio.com\/index.php\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":3,"href":"https:\/\/imdeafoodcompubio.com\/index.php\/wp-json\/wp\/v2\/pages\/15\/revisions"}],"predecessor-version":[{"id":604,"href":"https:\/\/imdeafoodcompubio.com\/index.php\/wp-json\/wp\/v2\/pages\/15\/revisions\/604"}],"wp:attachment":[{"href":"https:\/\/imdeafoodcompubio.com\/index.php\/wp-json\/wp\/v2\/media?parent=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}