scripts/aiv_ui.js
/**
     * @function pearsonFilterEPPIonEles - Take filter value and use it to find edges with R more than that
     * value. Then find those nodes that connect to such edges. Within these nodes, filter again by comparing
     * how many total edges(degree) it has to how many edges connected to it fit the filter. If they're equal
     * hide the node. This later logic is useful for when we having interactions between interactions.
     * I had to do this because if you just hide the edges they'll leave the nodes left on the app
     * Lastly hide all the edges that fit the filter as a failsafe (because when you hide nodes, they hide the
     * edges).
     * @param {object} AIVObjReference - reference to the AIV namespace object
     */
@function pearsonFilterEPPIonEles - Take filter value and use it to find edges with R more than that
value. Then find those nodes that connect to such edges. Within these nodes, filter again by comparing
how many total edges(degree) it has to how many edges connected to it fit the filter. If they're equal
hide the node. This later logic is useful for when we having interactions between interactions.
I had to do this because if you just hide the edges they'll leave the nodes left on the app
Lastly hide all the edges that fit the filter as a failsafe (because when you hide nodes, they hide the
edges).
@param {object} AIVObjReference - reference to the AIV namespace object
@function pearsonFilterEPPIonEles - Take filter value and use it to find edges with R more than that value . Then find those nodes that connect to such edges . Within these nodes filter again by comparing how many total edges ( degree ) it has to how many edges connected to it fit the filter . If they ' re equal hide the node . This later logic is useful for when we having interactions between interactions . I had to do this because if you just hide the edges they ' ll leave the nodes left on the app Lastly hide all the edges that fit the filter as a failsafe ( because when you hide nodes they hide the edges ) . @param { object } AIVObjReference - reference to the AIV namespace object
function pearsonFilterEPPIonEles(AIVObjReference){
        let filterValue = document.getElementById('EPPICorrThreshold').value;
        let selector = `edge[pearsonR <= ${filterValue}][?published][target ^= 'Protein']`;
        let edges = AIVObjReference.cy.$(selector);
        edges.connectedNodes('node[!queryGene][id ^="Protein"]').forEach(function(ele){
            if (ele.connectedEdges(selector).size() === ele.degree()){
                ele.addClass('pearsonfilterEPPI');
            }
        });
        edges.addClass('pearsonfilterEPPI');
    }
function pearsonFilterEPPIonEles ( AIVObjReference ) { let filterValue = document . getElementById ( 'EPPICorrThreshold' ) . value ; let selector = ` ${ filterValue } ` ; let edges = AIVObjReference . cy . $ ( selector ) ; edges . connectedNodes ( 'node[!queryGene][id ^="Protein"]' ) . forEach ( function ( ele ) { if ( ele . connectedEdges ( selector ) . size ( ) === ele . degree ( ) ) { ele . addClass ( 'pearsonfilterEPPI' ) ; } } ) ; edges . addClass ( 'pearsonfilterEPPI' ) ; }
@function pearsonFilterEPPIonEles - Take filter value and use it to find edges with R more than that
 value.
@function pearsonFilterEPPIonEles - Take filter value and use it to find edges with R more than that value .
// console.log(ele.data(), "data, degree", ele.degree());