<commit_before>
<%@ page import="org.mskcc.cbio.portal.servlet.GisticJSON" %>
<%@ page import="org.mskcc.cbio.portal.util.SkinUtil" %>

<script type="text/javascript">   
    $(document).ready(function(){
        $('#gistic_wrapper_table').hide();
        loadGisticData(cancerStudyId);
    });
    
    function loadGisticData(cancerStudyId) {
        var params = {<%=GisticJSON.SELECTED_CANCER_STUDY%>: cancerStudyId};
        $.get("Gistic.json",
            params,
            function(data){
                if (data==null || (typeof data) != (typeof []) || data.length==0) {
                    $("#gistic-msg").html("Gistic data is not available for this cancer study.");
                    return;
                }
                $("#gistic-msg").hide();
                
                var ix = [];
                var n = data.length;
                for (var i=0; i<n; i++) {
                        ix.push([i]);
                }
                
                var oTable = $('#gistic_table').dataTable( {
                    "sDom": '<"H"<"gistic-table-name">fr>t<"F"<"datatable-paging"pil>>', // selectable columns
                    "bJQueryUI": true,
                    "bDestroy": true,
                    "aaData": ix,
                    "aoColumnDefs":[
                        {// data
                            "aTargets": [ 0 ],
                            "bVisible": false,
                            "mData" : 0
                        },
                        {// amp/del
                            "aTargets": [ 1 ],
                            "sClass": "center-align-td",
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else if (type==='display') {
                                    if (data[source[0]]['ampdel'])
                                        return "<font color='red'>AMP</font>";
                                    else
                                        return "<font color='blue'>DEL</font>";
                                } else {
                                    return data[source[0]]['ampdel'];
                                }
                            }
                        },
                        {// chr
                            "aTargets": [ 2 ],
                            "sClass": "right-align-td",
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else {
                                    return data[source[0]]['chromosome'];
                                }
                            }
                        },
                        {// cytoband
                            "aTargets": [ 3 ],
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else {
                                    return data[source[0]]['cytoband'];
                                }
                            }
                        },
                        {// #gene
                            "aTargets": [ 4 ],
                            "sClass": "right-align-td",
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else {
                                    return data[source[0]]['sangerGenes'].length
                                        + data[source[0]]['nonSangerGenes'].length;
                                }
                            }
                        },
                        {// gene
                            "aTargets": [ 5 ],
                            "iDataSort": 4,
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else {
                                    var genes = data[source[0]]['sangerGenes'].slice(0).concat(data[source[0]]['nonSangerGenes']);
                                   if (type==='display') {
                                        var linkedGenes = [];
                                        for (var i=0; i<genes.length; i++) {
                                            linkedGenes.push(genes[i]);
                                        }
                                        return linkedGenes.join(" ");
                                    } else {
                                        return genes.join(" ");
                                    }
                                }
                            }
                        },
                        {// qval
                            "aTargets": [ 6 ],
                            "sClass": "right-align-td",
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else if (type==='display') {
                                    return cbio.util.toPrecision(data[source[0]]['qval'], 3, 0.01);
                                } else {
                                    return data[source[0]]['qval'];
                                }
                            },
                            "asSorting": ["asc", "desc"]
                        }
                    ],
                    "aaSorting": [[6,'asc']],
                    "oLanguage": {
                        "sInfo": "&nbsp;&nbsp;(_START_ to _END_ of _TOTAL_)&nbsp;&nbsp;",
                        "sInfoFiltered": "",
                        "sLengthMenu": "Show _MENU_ per page"
                    },
                    "iDisplayLength": 25,
                    "aLengthMenu": [[5,10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"]]
                });
                
                oTable.css("width","100%");
                
                $('.gistic-table-name').html(n+" copy number alteration peaks by <a href='www.broadinstitute.org/cancer/pub/GISTIC2/'>GISTIC2</a>");
                $('.gistic-table-name').addClass('data-table-name');
                
                $('#gistic_wrapper_table').show();
            });
    }
</script>

<div id="gistic-msg"><img src="images/ajax-loader.gif"/></div><br/>
<table cellpadding="0" cellspacing="0" border="0" id="gistic_wrapper_table" width="100%"><commit_msg>fixed issue #245<commit_after>
<%@ page import="org.mskcc.cbio.portal.servlet.GisticJSON" %>
<%@ page import="org.mskcc.cbio.portal.util.SkinUtil" %>

<script type="text/javascript">   
    $(document).ready(function(){
        $('#gistic_wrapper_table').hide();
        loadGisticData(cancerStudyId);
    });
    
    function loadGisticData(cancerStudyId) {
        var params = {<%=GisticJSON.SELECTED_CANCER_STUDY%>: cancerStudyId};
        $.get("Gistic.json",
            params,
            function(data){
                if (data==null || (typeof data) != (typeof []) || data.length==0) {
                    $("#gistic-msg").html("Gistic data is not available for this cancer study.");
                    return;
                }
                $("#gistic-msg").hide();
                
                var ix = [];
                var n = data.length;
                for (var i=0; i<n; i++) {
                        ix.push([i]);
                }
                
                var oTable = $('#gistic_table').dataTable( {
                    "sDom": '<"H"<"gistic-table-name">fr>t<"F"<"datatable-paging"pil>>', // selectable columns
                    "bJQueryUI": true,
                    "bDestroy": true,
                    "aaData": ix,
                    "aoColumnDefs":[
                        {// data
                            "aTargets": [ 0 ],
                            "bVisible": false,
                            "mData" : 0
                        },
                        {// amp/del
                            "aTargets": [ 1 ],
                            "sClass": "center-align-td",
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else if (type==='display') {
                                    if (data[source[0]]['ampdel'])
                                        return "<font color='red'>AMP</font>";
                                    else
                                        return "<font color='blue'>DEL</font>";
                                } else {
                                    return data[source[0]]['ampdel'];
                                }
                            }
                        },
                        {// chr
                            "aTargets": [ 2 ],
                            "sClass": "right-align-td",
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else {
                                    return data[source[0]]['chromosome'];
                                }
                            }
                        },
                        {// cytoband
                            "aTargets": [ 3 ],
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else {
                                    return data[source[0]]['cytoband'];
                                }
                            }
                        },
                        {// #gene
                            "aTargets": [ 4 ],
                            "sClass": "right-align-td",
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else {
                                    return data[source[0]]['sangerGenes'].length
                                        + data[source[0]]['nonSangerGenes'].length;
                                }
                            }
                        },
                        {// gene
                            "aTargets": [ 5 ],
                            "iDataSort": 4,
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else {
                                    var genes = data[source[0]]['sangerGenes'].slice(0).concat(data[source[0]]['nonSangerGenes']);
                                   if (type==='display') {
                                        var linkedGenes = [];
                                        for (var i=0; i<genes.length; i++) {
                                            linkedGenes.push(genes[i]);
                                        }
                                        return linkedGenes.join(" ");
                                    } else {
                                        return genes.join(" ");
                                    }
                                }
                            }
                        },
                        {// qval
                            "aTargets": [ 6 ],
                            "sClass": "right-align-td",
                            "mDataProp": function(source,type,value) {
                                if (type==='set') {
                                    return;
                                } else if (type==='display') {
                                    return cbio.util.toPrecision(data[source[0]]['qval'], 3, 0.01);
                                } else {
                                    return data[source[0]]['qval'];
                                }
                            },
                            "asSorting": ["asc", "desc"]
                        }
                    ],
                    "aaSorting": [[6,'asc']],
                    "oLanguage": {
                        "sInfo": "&nbsp;&nbsp;(_START_ to _END_ of _TOTAL_)&nbsp;&nbsp;",
                        "sInfoFiltered": "",
                        "sLengthMenu": "Show _MENU_ per page"
                    },
                    "iDisplayLength": 25,
                    "aLengthMenu": [[5,10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"]]
                });
                
                oTable.css("width","100%");
                
                $('.gistic-table-name').html(n+" copy number alteration peaks by <a href='http://www.broadinstitute.org/cancer/pub/GISTIC2/'>GISTIC2</a>");
                $('.gistic-table-name').addClass('data-table-name');
                
                $('#gistic_wrapper_table').show();
            });
    }
</script>

<div id="gistic-msg"><img src="images/ajax-loader.gif"/></div><br/>
<table cellpadding="0" cellspacing="0" border="0" id="gistic_wrapper_table" width="100%">
{'fraction_non_alphanumeric': 0.12529691211401425, 'fraction_numerical': 0.009426959619952494, 'mean_word_length': 0.716961896266089, 'pattern_counts': {'":': 64, '<': 47, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 92, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3957381', 'n_tokens_mistral': 3257, 'n_tokens_neox': 2978, 'n_words': 467}