<commit_before><%
    String cancerStudyName = "glioblastoma";
%>
<script type="text/javascript">
    var populateDrugTable = function() {
        var drugIds = [];
        drugIds = drugIds.concat(genomicEventObs.cnas.getDrugIDs());
        drugIds = drugIds.concat(genomicEventObs.mutations.getDrugIDs());

        var keywords = [];
        $.post("drugs.json",
                { drug_ids: drugIds.join(",") },
                function(data) {
                    for(var i=0; i < data.length; i++) {
                        var drug = data[i];
                        $("#pv-drugs-table").append(
                            '<tr>'
                                + '<td>' + drug[2] + '</td>'
                                + '<td>' + drug[1] + '</td>'
                                + '<td>' + drug[4] + '</td>'
                                + '<td>' + (drug[3] ? "yes" : "no") + '</td>'
                                + '<td>' + drug[7] + '</td>'
                            + '</tr>'
                        );

                        keywords.push(drug[2]);
                    }

                    $("pv-drugs-table").dataTable();
                    populateClinicalTrialsTable(keywords);
                }
        );
    };

    var populateClinicalTrialsTable = function(keywords) {
        keywords.push("<%=cancerStudyName%>");
        $.post("clinicaltrials.json",
                { keywords: keywords.join(",") },
                function(data) {
                    for(var i=0; i < data.length; i++) {
                        var trial = data[i];
                        $("#pv-trials-table").append(
                            '<tr>'
                                + '<td>' + trial[0] + '</td>'
                                + '<td>' + trial[1] + '</td>'
                                + '<td>' + trial[2] + '</td>'
                                + '<td>' + trial[3] + '</td>'
                                + '<td>' + trial[4] + '</td>'
                            + '</tr>'
                        );
                    }

                    $("pv-trials-table").dataTable();
                }
        );
    };

    $(document).ready(function() {
        genomicEventObs.subscribeMutCna(populateDrugTable);
    });
</script>


<h2 class="pv-drugs-header">Drugs of interest</h2>
<table id="pv-drugs-table">
   <thead>
    <tr>
        <th>Drug Name</th>
        <th>Drug Target</th>
        <th>Description</th>
        <th>FDA approved?</th>
        <th>Data Sources</th>
    </tr>
   </thead>

</table>


<h2 class="pv-drugs-header">Clinical trials of interest</h2>
<table id="pv-trials-table">
   <thead>
    <tr>
        <th>Trial ID</th>
        <th>Title</th>
        <th>Status</th>
        <th>Phase</th>
        <th>Location</th>
    </tr>
   </thead>
</table><commit_msg>make up to the drug/trial tables.<commit_after><%
    String cancerStudyName = "glioblastoma";
%>
<script type="text/javascript">
    var populateDrugTable = function() {
        var drugIds = [];
        drugIds = drugIds.concat(genomicEventObs.cnas.getDrugIDs());
        drugIds = drugIds.concat(genomicEventObs.mutations.getDrugIDs());

        var keywords = [];
        $.post("drugs.json",
                { drug_ids: drugIds.join(",") },
                function(data) {
                    for(var i=0; i < data.length; i++) {
                        var drug = data[i];

                        var xref = ["N/A"];
                        if (drug[7]) { // xref
                            xref = [];
                            var nci = drug[7]['NCI_Drug'];
                            if(nci)
                                xref.push("<a href='http://www.cancer.gov/drugdictionary?CdrID="+nci+"'>NCI</a>");
                            var pharmgkb = drug[7]['PharmGKB'];
                            if(pharmgkb)
                                xref.push("<a href='http://www.pharmgkb.org/views/index.jsp?objId="+pharmgkb+"'>PharmGKB</a>");
                            var drugbank = drug[7]['DrugBank'];
                            if(drugbank)
                                xref.push("<a href='http://www.drugbank.ca/drugs/"+drugbank+"'>DrugBank</a>");
                            var keggdrug = drug[7]['KEGG Drug'];
                            if(keggdrug)
                                xref.push("<a href='http://www.genome.jp/dbget-bin/www_bget?dr:"+keggdrug+"'>KEGG Drug</a>");
                        }

                        $("#pv-drugs-table").append(
                            '<tr>'
                                + '<td>' + drug[2] + '</td>'
                                + '<td>' + drug[3] + '</td>'
                                + '<td>' + drug[1] + '</td>'
                                + '<td>' + drug[5] + '</td>'
                                + '<td>' + (drug[4] ? "Yes" : "No") + '</td>'
                                + '<td>' + xref.join(",") + '</td>'
                            + '</tr>'
                        );

                        keywords.push(drug[2]);
                    }

                    $("#pv-drugs-table").dataTable();
                    populateClinicalTrialsTable(keywords);
                }
        );
    };

    var populateClinicalTrialsTable = function(keywords) {
        keywords.push("<%=cancerStudyName%>");
        $.post("clinicaltrials.json",
                { keywords: keywords.join(",") },
                function(data) {
                    for(var i=0; i < data.length; i++) {
                        var trial = data[i];
                        $("#pv-trials-table").append(
                            '<tr>'
                                + '<td>'
                                    + '<a href="http://clinicaltrials.gov/show/' + trial[0] + '" target="_blank">'
                                        + trial[0]
                                    + '</a>'
                                + '</td>'
                                + '<td>' + trial[1] + '</td>'
                                + '<td>' + trial[2] + '</td>'
                                + '<td>' + trial[3] + '</td>'
                                + '<td>' + trial[4] + '</td>'
                            + '</tr>'
                        );
                    }

                    $("#pv-trials-table").dataTable();
                }
        );
    };

    $(document).ready(function() {
        genomicEventObs.subscribeMutCna(populateDrugTable);
    });
</script>


<h2 class="pv-drugs-header">Drugs of interest</h2>
<table id="pv-drugs-table">
   <thead>
    <tr>
        <th>Drug Name</th>
        <th>Synonyms</th>
        <th>Drug Target(s)</th>
        <th>Description</th>
        <th>FDA approved?</th>
        <th>Data Sources</th>
    </tr>
   </thead>

</table>


<h2 class="pv-drugs-header">Clinical trials of interest</h2>
<table id="pv-trials-table">
   <thead>
    <tr>
        <th>Trial ID</th>
        <th>Title</th>
        <th>Status</th>
        <th>Phase</th>
        <th>Location</th>
    </tr>
   </thead>
</table>
{'fraction_non_alphanumeric': 0.17220801364023872, 'fraction_numerical': 0.005683432793407218, 'mean_word_length': 1.0636177074171798, 'pattern_counts': {'":': 0, '<': 149, '<?xml version=': 0, '>': 145, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 27, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3959141', 'n_tokens_mistral': 2123, 'n_tokens_neox': 1969, 'n_words': 302}