function formatDataToArray (data) {
                    var newdata = [];
                    data.forEach(function (item) {
                        // create rows:
                        var row = [];

                        try {
                            // col 0: data origin: public / private
                            row.push((item.access_level === otConsts.ACCESS_LEVEL_PUBLIC) ? otConsts.ACCESS_LEVEL_PUBLIC_DIR : otConsts.ACCESS_LEVEL_PRIVATE_DIR);

                            // disease
                            row.push(item.disease.efo_info.label);

                            // overview
                            row.push('<a class=\'ot-external-link\' href=\'' + item.evidence.urls[0].url + '\' target=\'_blank\'>' + item.evidence.urls[0].nice_name + '</a>');

                            // activity
                            row.push(otDictionary[item.target.activity.toUpperCase()] || otClearUnderscoresFilter(item.target.activity)); // "up_or_down"->"unclassified" via dictionary

                            // mutations
                            var mut = otDictionary.NA;
                            if (item.evidence.known_mutations && item.evidence.known_mutations.length > 0) {
                                mut = otUtils.arrayToList(item.evidence.known_mutations.map(function (i) { return i.preferred_name || otDictionary.NA; }), true);
                            }
                            row.push(mut);

                            // evidence codes
                            var db = Object.keys(otConsts.datasources).find(function (i) {
                                return otConsts.datasources[i].id === item.sourceID;
                            });
                            db = otConsts.datasources[db] || {};
                            db = db.label || item.evidence.provenance_type.database.id;
                            row.push('Curated in ' + db);
                            // row.push('Curated in ' + item.evidence.provenance_type.database.id);

                            // publications
                            var refs = [];
                            if (checkPath(item, 'evidence.provenance_type.literature.references')) {
                                refs = item.evidence.provenance_type.literature.references;
                            }
                            var pmidsList = otUtils.getPmidsList(refs);
                            row.push(otUtils.getPublicationsString(pmidsList));

                            // Publication ids (hidden)
                            row.push(pmidsList.join(', '));

                            // hidden columns for filtering
                            row.push(item.evidence.urls[0].nice_name); // overview

                            newdata.push(row); // use push() so we don't end up with empty rows
                        } catch (e) {
                            scope.ext.hasError = true;
                            $log.error('Error parsing pathways data:');
                            $log.error(e);
                        }
                    });
                    return newdata;
                }
/*
                 * Takes the data object returned by the API and formats it
                 * to an array of arrays to be displayed by the dataTable widget.
                 */
Takes the data object returned by the API and formats it
to an array of arrays to be displayed by the dataTable widget.
Takes the data object returned by the API and formats it to an array of arrays to be displayed by the dataTable widget .
function formatDataToArray (data) {
                    var newdata = [];
                    data.forEach(function (item) {
                        var row = [];
                        try {
                            row.push((item.access_level === otConsts.ACCESS_LEVEL_PUBLIC) ? otConsts.ACCESS_LEVEL_PUBLIC_DIR : otConsts.ACCESS_LEVEL_PRIVATE_DIR);
                            row.push(item.disease.efo_info.label);
                            row.push('<a class=\'ot-external-link\' href=\'' + item.evidence.urls[0].url + '\' target=\'_blank\'>' + item.evidence.urls[0].nice_name + '</a>');
                            row.push(otDictionary[item.target.activity.toUpperCase()] || otClearUnderscoresFilter(item.target.activity)); 
                            var mut = otDictionary.NA;
                            if (item.evidence.known_mutations && item.evidence.known_mutations.length > 0) {
                                mut = otUtils.arrayToList(item.evidence.known_mutations.map(function (i) { return i.preferred_name || otDictionary.NA; }), true);
                            }
                            row.push(mut);
                            var db = Object.keys(otConsts.datasources).find(function (i) {
                                return otConsts.datasources[i].id === item.sourceID;
                            });
                            db = otConsts.datasources[db] || {};
                            db = db.label || item.evidence.provenance_type.database.id;
                            row.push('Curated in ' + db);
                            var refs = [];
                            if (checkPath(item, 'evidence.provenance_type.literature.references')) {
                                refs = item.evidence.provenance_type.literature.references;
                            }
                            var pmidsList = otUtils.getPmidsList(refs);
                            row.push(otUtils.getPublicationsString(pmidsList));
                            row.push(pmidsList.join(', '));
                            row.push(item.evidence.urls[0].nice_name); 
                            newdata.push(row); 
                        } catch (e) {
                            scope.ext.hasError = true;
                            $log.error('Error parsing pathways data:');
                            $log.error(e);
                        }
                    });
                    return newdata;
                }
function formatDataToArray ( data ) { var newdata = [ ] ; data . forEach ( function ( item ) { var row = [ ] ; try { row . push ( ( item . access_level === otConsts . ACCESS_LEVEL_PUBLIC ) ? otConsts . ACCESS_LEVEL_PUBLIC_DIR : otConsts . ACCESS_LEVEL_PRIVATE_DIR ) ; row . push ( item . disease . efo_info . label ) ; row . push ( '<a class=\'ot-external-link\' href=\'' + item . evidence . urls [ 0 ] . url + '\' target=\'_blank\'>' + item . evidence . urls [ 0 ] . nice_name + '</a>' ) ; row . push ( otDictionary [ item . target . activity . toUpperCase ( ) ] || otClearUnderscoresFilter ( item . target . activity ) ) ; var mut = otDictionary . NA ; if ( item . evidence . known_mutations && item . evidence . known_mutations . length > 0 ) { mut = otUtils . arrayToList ( item . evidence . known_mutations . map ( function ( i ) { return i . preferred_name || otDictionary . NA ; } ) , true ) ; } row . push ( mut ) ; var db = Object . keys ( otConsts . datasources ) . find ( function ( i ) { return otConsts . datasources [ i ] . id === item . sourceID ; } ) ; db = otConsts . datasources [ db ] || { } ; db = db . label || item . evidence . provenance_type . database . id ; row . push ( 'Curated in ' + db ) ; var refs = [ ] ; if ( checkPath ( item , 'evidence.provenance_type.literature.references' ) ) { refs = item . evidence . provenance_type . literature . references ; } var pmidsList = otUtils . getPmidsList ( refs ) ; row . push ( otUtils . getPublicationsString ( pmidsList ) ) ; row . push ( pmidsList . join ( ', ' ) ) ; row . push ( item . evidence . urls [ 0 ] . nice_name ) ; newdata . push ( row ) ; } catch ( e ) { scope . ext . hasError = true ; $log . error ( 'Error parsing pathways data:' ) ; $log . error ( e ) ; } } ) ; return newdata ; }
Takes the data object returned by the API and formats it
 to an array of arrays to be displayed by the dataTable widget.
Takes the data object returned by the API and formats it to an array of arrays to be displayed by the dataTable widget .
// create rows: // col 0: data origin: public / private // disease // overview // activity // "up_or_down"->"unclassified" via dictionary // mutations // evidence codes // row.push('Curated in ' + item.evidence.provenance_type.database.id); // publications // Publication ids (hidden) // hidden columns for filtering // overview // use push() so we don't end up with empty rows