gbe_browser/static/manhattan_plot.js
/**
 * Read a .json to inicialaze the variables and call the function manhattan_plot() to craete the manhattan plot
 * @param {string} file_name
 */
Read a .json to inicialaze the variables and call the function manhattan_plot() to craete the manhattan plot
@param {string} file_name
Read a . json to inicialaze the variables and call the function manhattan_plot () to craete the manhattan plot @param { string } file_name
function read_file_to_manhattan_plot() {
    data = new Array();
 	data_weight_pvalue = [];
    links.forEach(
            function(d) { 
                if (allNodes[d.source].chrom === 1) { 
                    data.push([allNodes[d.source].bp_position, d[st_chosen], allNodes[d.source].degree, "chr" +
                        allNodes[d.source].chrom + ':' + allNodes[d.source].bp_position, d.source]);
                } else {
                    data.push([allNodes[d.source].bp_position + chrom_acum_length[allNodes[d.source].chrom - 2],
                        d[st_chosen], allNodes[d.source].degree, "chr" + allNodes[d.source].chrom + ':' +
                        allNodes[d.source].bp_position, d.source] );
                }
                if (allNodes[d.target].chrom === 1) {
                    data.push([allNodes[d.target].bp_position, d[st_chosen], allNodes[d.target].degree, "chr" +
                        allNodes[d.target].chrom + ':' + allNodes[d.target].bp_position, d.target]);
                } else {
                    data.push([allNodes[d.target].bp_position + chrom_acum_length[allNodes[d.target].chrom - 2],
                        d[st_chosen], allNodes[d.target].degree, "chr" + allNodes[d.target].chrom + ':' +
                        allNodes[d.target].bp_position, d.target]);
                }
            });
    var min_pvalue = d3.min(data_weight_pvalue, function(d) {
        return d;
    });
    var max_pvalue = d3.max(data_weight_pvalue, function(d) {
        return d;
    });
    var extend_scale = (max_pvalue - min_pvalue) *0.05;
    ix_1 = 0;
    ix_2 = chrom_lenght;
    iy_1 = min_pvalue - extend_scale;
    iy_2 = max_pvalue + extend_scale;
    data_from_HDS = "no"
    manhattan_plot_minmap(ix_1, ix_2, iy_1, iy_2, 0, 0, 0, 0, data);
    manhattan_plot(ix_1, ix_2, iy_1, iy_2, data);
}
function read_file_to_manhattan_plot ( ) { data = new Array ( ) ; data_weight_pvalue = [ ] ; links . forEach ( function ( d ) { if ( allNodes [ d . source ] . chrom === 1 ) { data . push ( [ allNodes [ d . source ] . bp_position , d [ st_chosen ] , allNodes [ d . source ] . degree , "chr" + allNodes [ d . source ] . chrom + ':' + allNodes [ d . source ] . bp_position , d . source ] ) ; } else { data . push ( [ allNodes [ d . source ] . bp_position + chrom_acum_length [ allNodes [ d . source ] . chrom - 2 ] , d [ st_chosen ] , allNodes [ d . source ] . degree , "chr" + allNodes [ d . source ] . chrom + ':' + allNodes [ d . source ] . bp_position , d . source ] ) ; } if ( allNodes [ d . target ] . chrom === 1 ) { data . push ( [ allNodes [ d . target ] . bp_position , d [ st_chosen ] , allNodes [ d . target ] . degree , "chr" + allNodes [ d . target ] . chrom + ':' + allNodes [ d . target ] . bp_position , d . target ] ) ; } else { data . push ( [ allNodes [ d . target ] . bp_position + chrom_acum_length [ allNodes [ d . target ] . chrom - 2 ] , d [ st_chosen ] , allNodes [ d . target ] . degree , "chr" + allNodes [ d . target ] . chrom + ':' + allNodes [ d . target ] . bp_position , d . target ] ) ; } } ) ; var min_pvalue = d3 . min ( data_weight_pvalue , function ( d ) { return d ; } ) ; var max_pvalue = d3 . max ( data_weight_pvalue , function ( d ) { return d ; } ) ; var extend_scale = ( max_pvalue - min_pvalue ) * 0.05 ; ix_1 = 0 ; ix_2 = chrom_lenght ; iy_1 = min_pvalue - extend_scale ; iy_2 = max_pvalue + extend_scale ; data_from_HDS = "no" manhattan_plot_minmap ( ix_1 , ix_2 , iy_1 , iy_2 , 0 , 0 , 0 , 0 , data ) ; manhattan_plot ( ix_1 , ix_2 , iy_1 , iy_2 , data ) ; }
Read a .json to inicialaze the variables and call the function manhattan_plot() to craete the manhattan plot
 @param {string} file_name
Read a . json to inicialaze the variables and call the function manhattan_plot () to craete the manhattan plot @param { string } file_name
//this will fill with data the array //"chr"+d.chrom+':'+d.bp_position //var for maximum and minimum value of p-values from the dataset  // var which defined the extra space in the bottom and the top of the -log(p-value) axis dynamically to the dataset