<commit_before><%@ page import="org.mskcc.portal.servlet.ProteinArraySignificanceTestJSON" %>
<%@ page import="org.mskcc.portal.remote.GetProteinArrayData" %>
<%@ page import="java.util.Set" %>
<%
    Set<String> antibodyTypes = GetProteinArrayData.getProteinArrayTypes();
%>

<style type="text/css" title="currentStyle"> 
        @import "css/data_table_jui.css";
        @import "css/data_table_ColVis.css";
        .ColVis {
                float: left;
                margin-bottom: 0
        }
        .datatable-filter-custom {
                float: left
        }
        .dataTables_length {
                width: auto;
                float: right;
        }
        .dataTables_info {
                width: auto;
                float: right;
        }
        .div.datatable-paging {
                width: auto;
                float: right;
        }
        td.rppa-details {
                background-color : white;
        }
</style>

<script type="text/javascript" language="javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.ColVis.min.js"></script> 

<script type="text/javascript">
    function parsePValue(str) {
        return parseFloat(str.replace(/<[^>]*>/g,""));
    }
    
    jQuery.fn.dataTableExt.oSort['num-nan-col-asc']  = function(a,b) {
	var x = parsePValue(a);
	var y = parsePValue(b);
        if (isNaN(x)) {
            return isNaN(y) ? 0 : 1;
        }
        if (isNaN(y))
            return -1;
	return ((x < y) ? -1 : ((x > y) ?  1 : 0));
    };

    jQuery.fn.dataTableExt.oSort['num-nan-col-desc'] = function(a,b) {
	var x = parsePValue(a);
	var y = parsePValue(b);
        if (isNaN(x)) {
            return isNaN(y) ? 0 : 1;
        }
        if (isNaN(y))
            return -1;
	return ((x < y) ? 1 : ((x > y) ?  -1 : 0));
    };
    
    function getProteinArrayTypes() {
        var ret = Array();
        var i = 0;
        <%for (String type : antibodyTypes) {%>
                ret[i++] = "<%=type%>";
        <%}%>
        return ret;
    }

    function fnCreateSelect(aData, id, defaultOpt)
    {
            var r='<select id="'+id+'">', i, iLen=aData.length;
            for ( i=0 ; i<iLen ; i++ )
            {
                if (defaultOpt!=null && aData[i]==defaultOpt)
                    r += '<option value="'+aData[i]+'" selected="selected">'+aData[i]+'</option>';
                else
                    r += '<option value="'+aData[i]+'">'+aData[i]+'</option>';
            }
            return r+'</select>';
    }
    
    $(document).ready(function(){
        $('table#protein_expr_wrapper').hide();
        var params = {<%=ProteinArraySignificanceTestJSON.HEAT_MAP%>:$("textarea#heat_map").html(),
            <%=ProteinArraySignificanceTestJSON.GENE%>:'Any',
            <%=ProteinArraySignificanceTestJSON.ALTERATION_TYPE%>:'Any',
            <%=ProteinArraySignificanceTestJSON.ANTIBODY_TYPE%>:'phosphorylation'
        };
        if ($.browser.msie) //TODO: this is a temporary fix for bug #74
            params['<%=ProteinArraySignificanceTestJSON.DATA_SCALE%>'] = '100';
                        
        $.post("ProteinArraySignificanceTest.json", 
            params,
            function(aDataSet){
                //$("div#protein_exp").html(aDataSet);
                //alert(aDataSet);
                var aiExclude = [1,2,3,11];
                var oTable = $('table#protein_expr').dataTable( {
                        "sDom": '<"H"<"datatable-filter-custom">fr>t<"F"C<"datatable-paging"pil>>', // selectable columns
			"oColVis": {
                            //"aiExclude": aiExclude
                        },
                        "bJQueryUI": true,
                        "aaData": aDataSet,
                        "aoColumnDefs":[
                            { //"sTitle": "Gene",
                              "bVisible": false,
                              "aTargets": [ 0 ]
                            },
                            { //"sTitle": "Gene",
                              "bVisible": false,
                              "aTargets": [ 1 ]
                            },
                            { //"sTitle": "Alteration type",
                              "bVisible": false,
                              "aTargets": [ 2 ] 
                            },
                            { //"sTitle": "Type",
                              "bVisible": false,
                              "aTargets": [ 3 ]<commit_msg>RPPA datatable: destroy the old one if exist before initialization<commit_after><%@ page import="org.mskcc.portal.servlet.ProteinArraySignificanceTestJSON" %>
<%@ page import="org.mskcc.portal.remote.GetProteinArrayData" %>
<%@ page import="java.util.Set" %>
<%
    Set<String> antibodyTypes = GetProteinArrayData.getProteinArrayTypes();
%>

<style type="text/css" title="currentStyle"> 
        @import "css/data_table_jui.css";
        @import "css/data_table_ColVis.css";
        .ColVis {
                float: left;
                margin-bottom: 0
        }
        .datatable-filter-custom {
                float: left
        }
        .dataTables_length {
                width: auto;
                float: right;
        }
        .dataTables_info {
                width: auto;
                float: right;
        }
        .div.datatable-paging {
                width: auto;
                float: right;
        }
        td.rppa-details {
                background-color : white;
        }
</style>

<script type="text/javascript" language="javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.ColVis.min.js"></script> 

<script type="text/javascript">
    function parsePValue(str) {
        return parseFloat(str.replace(/<[^>]*>/g,""));
    }
    
    jQuery.fn.dataTableExt.oSort['num-nan-col-asc']  = function(a,b) {
	var x = parsePValue(a);
	var y = parsePValue(b);
        if (isNaN(x)) {
            return isNaN(y) ? 0 : 1;
        }
        if (isNaN(y))
            return -1;
	return ((x < y) ? -1 : ((x > y) ?  1 : 0));
    };

    jQuery.fn.dataTableExt.oSort['num-nan-col-desc'] = function(a,b) {
	var x = parsePValue(a);
	var y = parsePValue(b);
        if (isNaN(x)) {
            return isNaN(y) ? 0 : 1;
        }
        if (isNaN(y))
            return -1;
	return ((x < y) ? 1 : ((x > y) ?  -1 : 0));
    };
    
    function getProteinArrayTypes() {
        var ret = Array();
        var i = 0;
        <%for (String type : antibodyTypes) {%>
                ret[i++] = "<%=type%>";
        <%}%>
        return ret;
    }

    function fnCreateSelect(aData, id, defaultOpt)
    {
            var r='<select id="'+id+'">', i, iLen=aData.length;
            for ( i=0 ; i<iLen ; i++ )
            {
                if (defaultOpt!=null && aData[i]==defaultOpt)
                    r += '<option value="'+aData[i]+'" selected="selected">'+aData[i]+'</option>';
                else
                    r += '<option value="'+aData[i]+'">'+aData[i]+'</option>';
            }
            return r+'</select>';
    }
    
    $(document).ready(function(){
        $('table#protein_expr_wrapper').hide();
        var params = {<%=ProteinArraySignificanceTestJSON.HEAT_MAP%>:$("textarea#heat_map").html(),
            <%=ProteinArraySignificanceTestJSON.GENE%>:'Any',
            <%=ProteinArraySignificanceTestJSON.ALTERATION_TYPE%>:'Any',
            <%=ProteinArraySignificanceTestJSON.ANTIBODY_TYPE%>:'phosphorylation'
        };
        if ($.browser.msie) //TODO: this is a temporary fix for bug #74
            params['<%=ProteinArraySignificanceTestJSON.DATA_SCALE%>'] = '100';
                        
        $.post("ProteinArraySignificanceTest.json", 
            params,
            function(aDataSet){
                //$("div#protein_exp").html(aDataSet);
                //alert(aDataSet);
                var aiExclude = [1,2,3,11];
                var oTable = $('table#protein_expr').dataTable( {
                        "sDom": '<"H"<"datatable-filter-custom">fr>t<"F"C<"datatable-paging"pil>>', // selectable columns
			"oColVis": {
                            //"aiExclude": aiExclude
                        },
                        "bJQueryUI": true,
                        "bDestroy": true,
                        "aaData": aDataSet,
                        "aoColumnDefs":[
                            { //"sTitle": "Gene",
                              "bVisible": false,
                              "aTargets": [ 0 ]
                            },
                            { //"sTitle": "Gene",
                              "bVisible": false,
                              "aTargets": [ 1 ]
                            },
                            { //"sTitle": "Alteration type",
                              "bVisible": false,
                              "aTargets": [ 2 ] 
                            },
                            { //"sTitle": "Type",
                              "bVisible": false,
                              "aTargets": [ 3 ]
{'fraction_non_alphanumeric': 0.15417441733231207, 'fraction_numerical': 0.006346427399058978, 'mean_word_length': 1.4399359316604379, 'pattern_counts': {'":': 37, '<': 71, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4137532', 'n_tokens_mistral': 2850, 'n_tokens_neox': 2659, 'n_words': 453}